Skip to content

Commit aac9233

Browse files
committed
draft
1 parent d97f23d commit aac9233

File tree

9 files changed

+83
-62
lines changed

9 files changed

+83
-62
lines changed

articles/app-service/includes/tutorial-sidecar/common-faqs.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,20 @@ In the **Edit container** dialog, the **Port** box isn't currently used by App S
1414

1515
### Can a sidecar container receive internet requests?
1616

17-
No. App Service routes internet requests only to the main container. For code-based Linux apps, the built-in Linux container is the main container, and any sidecar container [sitecontainers](/azure/templates/microsoft.web/sites/sitecontainers) should be added with `IsMain=false`. For custom containers, all except one of the [sitecontainers](/azure/templates/microsoft.web/sites/sitecontainers) should have `IsMain=false`.
17+
No. App Service routes internet requests only to the main container. For code-based Linux apps, the built-in Linux container is the main container, and any sidecar [sitecontainers](/azure/templates/microsoft.web/sites/sitecontainers) should be added with `IsMain=false`.
1818

19-
For more information on configuring `IsMain`, see [Microsoft.Web sites/sitecontainers](/azure/templates/microsoft.web/sites/sitecontainers).
19+
For custom containers, all except one of the [sitecontainers](/azure/templates/microsoft.web/sites/sitecontainers) should have `IsMain=false`. For more information on configuring `IsMain`, see [Microsoft.Web sites/sitecontainers](/azure/templates/microsoft.web/sites/sitecontainers).
2020

2121
### How do I use volume mounts?
2222

23-
The volume mounts feature enables you to share non-persistent files and directories between containers within your web app.
23+
The volume mounts feature lets you share non-persistent files and directories between containers within your web app. To add or configure volume mounts, use **Volume mounts** on the **Add container** or **Edit container** page.
2424

2525
:::image type="content" source="../../media/tutorial-custom-container-sidecar/configure-volume-mounts.png" alt-text="Screenshot showing a volume mount configuration for a sidecar container.":::
2626

27-
**Volume sub path** is a logical directory path that's automatically created and isn't referenced within the container. Containers that are configured with the same volume sub path can share files and directories.
27+
- **Volume sub path** is a logical directory path that's automatically created and isn't referenced within the container. Containers that are configured with the same volume sub path can share files and directories.
28+
- **Container mount path** corresponds to a directory path that you reference within the container. The container mount path is mapped to the volume sub path.
2829

29-
**Container mount path** corresponds to a directory path that you reference within the container. The container mount path is mapped to the volume sub path.
30-
31-
For example, suppose the following volume mounts are configured:
30+
For example, suppose you configure the following volume mounts:
3231

3332
| Sidecar name | Volume sub path | Container mount path | Read-only |
3433
| ------------ | --------------- | -------------------- | --------- |

articles/app-service/includes/tutorial-sidecar/sidecar-overview.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
author: cephalin
33
ms.service: azure-app-service
44
ms.topic: include
5-
ms.date: 05/08/2025
5+
ms.date: 06/19/2025
66
ms.author: cephalin
77
---
88

99
Sidecar containers in App Service let you deploy extra services and features to your Linux apps without tightly coupling them to the built-in or custom main container. The sidecar containers run alongside the main application container in the same App Service plan.
1010

11-
You can add up to nine sidecar containers for each Linux app in App Service. For example, you can add monitoring, logging, configuration, and networking services as sidecar containers. An OpenTelemetry collector sidecar is one monitoring example.
11+
You can add up to nine sidecar containers for each Linux app in App Service. For example, you can add monitoring, logging, configuration, and networking services as sidecar containers. An OpenTelemetry collector sidecar is one such monitoring example.
1212

7.31 KB
Loading
12.4 KB
Loading
7.12 KB
Loading
1.24 KB
Loading
-43.8 KB
Loading
-15.4 KB
Loading

articles/app-service/tutorial-custom-container-sidecar.md

Lines changed: 75 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: 'Tutorial: Configure a sidecar for a custom container app'
3-
description: Add sidecar containers to your custom container in Azure App Service. Add or update services to your application without changing your application container.
3+
description: Add sidecar containers to your custom container in Azure App Service to add or update application services without changing your main container.
44
ms.topic: tutorial
55
ms.date: 06/18/2025
66
ms.author: cephalin
@@ -28,9 +28,11 @@ For bring-your-own-code Linux apps, see [Tutorial: Configure a sidecar container
2828
1. Sign in to Azure if necessary, and make sure you're in the **Bash** environment of Cloud Shell.
2929
1. Select **Copy** in a code block, paste the code into Cloud Shell, and run it.
3030

31+
The commands in this tutorial use the [Azure Developer CLI](/azure/developer/azure-developer-cli/overview), an open-source tool that accelerates provisioning and deploying app resources on Azure.
32+
3133
## 1. Set up the tutorial resources
3234

33-
To create the resources that this tutorial uses, run the following commands in Cloud Shell. When prompted, provide the Azure subscription and Azure region you want to use.
35+
To create the resources that this tutorial uses, run the following commands in Cloud Shell. When prompted, select the Azure subscription and Azure region you want to use.
3436

3537
```bash
3638
git clone https://github.com/Azure-Samples/app-service-sidecar-tutorial-prereqs
@@ -39,98 +41,118 @@ To create the resources that this tutorial uses, run the following commands in C
3941
azd provision
4042
```
4143

42-
The `azd provision` command uses the included templates to create the following Azure resources:
44+
The `azd provision` command uses the included templates to create an Azure resource group called `my-sidecar-env_group` that contains the following Azure resources:
4345

44-
- A resource group called *my-sidecar-env_group*.
45-
- A [container registry](/azure/container-registry/container-registry-intro) with two images deployed:
46-
- An Nginx image with the `OpenTelemetry` module.
47-
- An `OpenTelemetry` collector image, configured to export to [Azure Monitor](/azure/azure-monitor/overview).
46+
- A [container registry](/azure/container-registry/container-registry-intro) with two repositories, containing the following images:
47+
- An `nginx` image with the OpenTelemetry module.
48+
- An `otel-collector` OpenTelemetry collector image, configured to export to [Azure Monitor](/azure/azure-monitor/overview).
4849
- A [Log Analytics workspace](/azure/azure-monitor/logs/log-analytics-overview).
49-
- An [Application Insights](/azure/azure-monitor/app/app-insights-overview) component.
50+
- An [Application Insights](/azure/azure-monitor/app/app-insights-overview) component and Application Insights Smart Detection action group.
51+
- A user-assigned [managed identity](/entra/identity/managed-identities-azure-resources/overview) called `id-my-sidecar-env_group`.
5052

51-
When deployment completes, you should see the following output:
53+
When deployment completes, you should see similar to the following output:
5254

5355
```bash
54-
APPLICATIONINSIGHTS_CONNECTION_STRING = InstrumentationKey=...;IngestionEndpoint=...;LiveEndpoint=...
55-
Open resource group in the portal: https://portal.azure.com/#@/resource/subscriptions/<your-subscription>/resourceGroups/my-sidecar-env_group
56+
Success!
57+
58+
APPLICATIONINSIGHTS_CONNECTION_STRING = InstrumentationKey=2462f7fd-02ad-4af1-9ca1-ceb8b48d7893;IngestionEndpoint=https://eastus2-3.in.applicationinsights.azure.com/;LiveEndpoint=https://eastus2.livediagnostics.monitor.azure.com/;ApplicationId=753ad4ce-d852-4118-8d11-d9c5ad3b2252
59+
Azure container registry name = acro2lc774l6vjgg
60+
Managed identity resource ID = /subscriptions/116dc797-1663-4e33-92f6-195da3734e6e/resourceGroups/my-sidecar-env_group/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id-my-sidecar-env_group
61+
Managed identity client ID = ca492300-1051-401e-b5b1-74be61ca03c1
62+
63+
Open resource group in the portal: https://portal.azure.com/#@/resource/subscriptions/116dc797-1663-4e33-92f6-195da3734e6e/resourceGroups/my-sidecar-env_group
5664
```
5765

58-
Open the resource group link in a browser tab. Take note of the connection string to use later.
66+
Copy and save the value for `APPLICATIONINSIGHTS_CONNECTION_STRING` to use later in this tutorial. Select the `Open resource group in the portal` link to open the resource group in the Azure portal.
5967

6068
## 2. Create a sidecar-enabled app
6169

62-
1. In the resource group's page in the Azure portal, select **Create**.
63-
1. Search for *web app*, then select the down arrow on **Create** and select **Web App**.
70+
In this section, you create the Linux custom container app and main container, and enable sidecar support for the app.
71+
72+
1. On the resource group's page in the Azure portal, select **Create**.
73+
1. On the **Marketplace** page, search for *web app*, select the down arrow next to **Create** on the **Web App** tile, and then select **Web App**.
6474
65-
:::image type="content" source="media/tutorial-custom-container-sidecar/create-web-app.png" alt-text="Screenshot showing the Azure Marketplace page with the web app being searched and create web app buttons being clicked.":::
75+
:::image type="content" source="media/tutorial-custom-container-sidecar/create-web-app.png" alt-text="Screenshot showing Azure Marketplace page with web app being searched and create web app button highlighted.":::
6676
67-
1. Configure the **Basics** panel as follows:
68-
- **Name**: A unique name
69-
- **Publish**: **Container**
70-
- **Operating System**: **Linux**
71-
- **Region**: Same region as the one you chose with `azd provision`
72-
- **Linux Plan**: A new App Service plan
77+
1. On the **Basics** tab of the **Create Web App** screen, provide the following information:
78+
- **Name**: Enter a unique name for the web app.
79+
- **Publish**: Select **Container**.
80+
- **Operating System**: Select **Linux**.
81+
- **Region**: Select the same region as the one you chose with `azd provision`.
82+
- **Linux Plan**: Select the provided **(New)** App Service plan.
7383
74-
:::image type="content" source="media/tutorial-custom-container-sidecar/create-wizard-basics-panel.png" alt-text="Screenshot showing the web app create wizard and settings for a Linux custom container app highlighted.":::
84+
:::image type="content" source="media/tutorial-custom-container-sidecar/create-wizard-basics-panel.png" alt-text="Screenshot showing the Basic settings for the Linux custom container web app.":::
7585
76-
1. Select **Container**. Configure the **Container** panel as follows:
77-
- **Sidecar support**: **Enabled**
78-
- **Image Source**: **Azure Container Registry**
79-
- **Registry**: The registry created by `azd provision`
80-
- **Image**: **nginx**
81-
- **Tag**: **latest**
82-
- **Port**: **80**
86+
1. Leave the rest of the settings as they are, and select the **Container** tab at the top of the page.
8387
84-
:::image type="content" source="media/tutorial-custom-container-sidecar/create-wizard-container-panel.png" alt-text="Screenshot showing the web app create wizard and settings for the container image and the sidecar support highlighted.":::
88+
1. On the **Container** tab, select the following settings:
89+
- **Sidecar support**: Set to **Enhanced configuration with sidecar support on**.
90+
- **Image Source**: Select **Azure Container Registry**.
91+
- **Name**: Make sure *main* appears.
92+
- **Registry**: Select the registry created by `azd provision`.
93+
- **Authentication**: Select **Managed Identity**.
94+
- **Identity**: Select the managed identity created by `azd provision`.
95+
- **Image**: Enter *nginx*.
96+
- **Tag**: Enter *latest*.
97+
- **Port**: Enter *80* if not already set.
98+
99+
:::image type="content" source="media/tutorial-custom-container-sidecar/create-wizard-container-panel.png" alt-text="Screenshot showing the Container settings for the Linux custom container web app with settings for the container image and the sidecar support highlighted.":::
85100
86101
> [!NOTE]
87-
> These settings are configured differently in sidecar-enabled apps. For more information, see [What are the differences for sidecar-enabled custom containers?](#what-are-the-differences-for-sidecar-enabled-custom-containers).
102+
> These settings are configured differently in sidecar-enabled apps than in non-sidecar enabled apps. For more information, see [What are the differences for sidecar-enabled custom containers](#what-are-the-differences-for-sidecar-enabled-custom-containers).
88103
89-
1. Select **Review + create**, then select **Create**.
104+
1. Select **Review + create**, and when validation passes, select **Create**.
90105
91106
1. Once the deployment completes, select **Go to resource**.
92107
93-
1. In a new browser tab, navigate to `https://<app-name>.azurewebsites.net` and see the default Nginx page.
108+
1. On your app's page, open the URL next to **Default domain**, such as `https://<app-name>.azurewebsites.net`, in a new browser tab to see the default **nginx** page.
94109

95110
## 3. Add a sidecar container to the app
96111

97-
1. On the app's page in the Azure portal, select **Deployment Center** from the left navigation menu. The **Deployment Center** page shows the main app container.
112+
In this section, you add a sidecar container to your Linux custom container app.
113+
114+
1. On the app's page in the Azure portal, select **Deployment Center** under **Deployment** in the left navigation menu. The **Deployment Center** page shows all the containers in the app, which is currently only the main container.
115+
116+
1. Select **Add** > **Custom container**.
98117
99-
1. Select **Add** and configure the new container as follows:
100-
- **Name**: *otel-collector*
101-
- **Image source**: **Azure Container Registry**
102-
- **Registry**: The registry created by `azd provision`
103-
- **Image**: **otel-collector**
104-
- **Tag**: **latest**
118+
1. On the **Add container** pane, complete the following information:
119+
- **Name**: Enter *otel-collector*.
120+
- **Image source**: Select **Azure Container Registry**.
121+
- **Registry**: Select the registry created by `azd provision`.
122+
- **Authentication**: Select **Managed Identity**.
123+
- **Identity**: Under **User assigned**, select the managed identity created by `azd provision`.
124+
- **Image**: Enter *otel-collector*.
125+
- **Image tag**: Enter *latest*.
126+
- **Port**: Enter *4317*.
105127
106128
1. Select **Apply**.
107129
108130
:::image type="content" source="media/tutorial-custom-container-sidecar/add-sidecar-container.png" alt-text="Screenshot showing how to configure a sidecar container in a web app's deployment center.":::
109131
110-
You should now see two containers in the deployment center labeled **Main** and **Sidecar**. An app must have one main container and can have multiple sidecar containers.
132+
There are now two containers in the deployment center labeled **Main** and **Sidecar**. An app must have one main container and can have multiple sidecar containers.
111133
112134
## 4. Configure environment variables
113135
114-
For the sample scenario, the otel-collector sidecar is configured to export the OpenTelemetry data to Azure Monitor using the connection string as an environment variable. For more information, see the [OpenTelemetry configuration file for the otel-collector image](https://github.com/Azure-Samples/app-service-sidecar-tutorial-prereqs/blob/main/images/otel-collector/otel-collector-config.yaml).
136+
For the sample scenario, the `otel-collector` sidecar is configured to export the OpenTelemetry data to Azure Monitor using the connection string as an environment variable. For more information, see the [OpenTelemetry configuration file for the otel-collector image](https://github.com/Azure-Samples/app-service-sidecar-tutorial-prereqs/blob/main/images/otel-collector/otel-collector-config.yaml).
115137
116138
You configure environment variables for the containers like for any App Service app by configuring [app settings](configure-common.md#configure-app-settings). The app settings are accessible to all the containers in the app.
117-
1. On the app's page in the Azure portal, select **Environment variables** from the left navigation menu.
118-
1. On the **Environment variables** page, select **Add** to add an app setting.
119-
1. Configure it as follows:
120-
- **Name**: *APPLICATIONINSIGHTS_CONNECTION_STRING*
121-
- **Value**: The connection string in the output of `azd provision`. If you lost the Cloud Shell session, you can also find it in the **Overview** page of the Application Insight resource, under **Connection String**.
122-
1. Select **Apply**, then **Apply**, then **Confirm**.
139+
1. On the app's page in the Azure portal, select **Environment variables** under **Settings** in the left navigation menu.
140+
1. On the **App settings** tab of the **Environment variables** page, select **Add**.
141+
1. On the **Add/Edit application setting** pane, enter the following values:
142+
- **Name**: *APPLICATIONINSIGHTS_CONNECTION_STRING*
143+
- **Value**: The `APPLICATIONINSIGHTS_CONNECTION_STRING` value from the output of `azd provision`. You can also find the value on the **Overview** page of the Application Insight resource, under **Connection String**.
144+
1. Select **Apply**, then select **Apply** again, and then select **Confirm**.
123145
124146
:::image type="content" source="media/tutorial-custom-container-sidecar/configure-app-settings.png" alt-text="Screenshot showing a web app's Configuration page with two app settings added.":::
125147
126148
> [!NOTE]
127-
> Some app settings don't apply to sidecar-enabled apps. For more information, see [What are the differences for sidecar-enabled custom containers?](#what-are-the-differences-for-sidecar-enabled-custom-containers)
149+
> Some app settings don't apply to sidecar-enabled apps. For more information, see [What are the differences for sidecar-enabled custom containers](#what-are-the-differences-for-sidecar-enabled-custom-containers).
128150

129151
## 5. Verify in Application Insights
130152

131153
The `otel-collector` sidecar should export data to Application Insights now.
132154

133-
1. Go to the browser tab for `https://<app-name>.azurewebsites.net` and refresh the page a few times to generate some web requests.
155+
1. Go to the browser tab for your app and refresh the page a few times to generate some web requests.
134156
1. On the resource group page in the Azure portal, select the **Application Insights** resource. You should now see some data in the default charts.
135157

136158
:::image type="content" source="media/tutorial-custom-container-sidecar/app-insights-view.png" alt-text="Screenshot of the Application Insights page showing data in the default charts.":::
@@ -156,10 +178,10 @@ azd down
156178

157179
Sidecar-enabled apps are configured differently than apps that aren't sidecar-enabled.
158180
159-
- A sidecar-enabled app is designated by `LinuxFxVersion=sitecontainers` and configured with a [sitecontainers](/azure/templates/microsoft.web/sites/sitecontainers) resource. For more information, see [az webapp config set --linux-fx-version](/cli/azure/webapp/config).
160-
- For non-sidecar enabled apps, container name and types are configured directly with `LinuxFxVersion=DOCKER|<image-details>`. For more information, see [az webapp config set --linux-fx-version](/cli/azure/webapp/config).
181+
- Sidecar-enabled apps are designated by `LinuxFxVersion=sitecontainers` and configured with [sitecontainers](/azure/templates/microsoft.web/sites/sitecontainers) resources. For more information, see [az webapp config set --linux-fx-version](/cli/azure/webapp/config).
182+
- Non-sidecar enabled app container names and types are configured directly with `LinuxFxVersion=DOCKER|<image-details>`. For more information, see [az webapp config set --linux-fx-version](/cli/azure/webapp/config).
161183
162-
For non-sidecar enabled apps, the main container is configured with app settings such as:
184+
Non-sidecar enabled apps configure the main container with app settings such as:
163185
164186
- `DOCKER_REGISTRY_SERVER_URL`
165187
- `DOCKER_REGISTRY_SERVER_USERNAME`

0 commit comments

Comments
 (0)