You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/app-service/includes/tutorial-sidecar/common-faqs.md
+6-7Lines changed: 6 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,21 +14,20 @@ In the **Edit container** dialog, the **Port** box isn't currently used by App S
14
14
15
15
### Can a sidecar container receive internet requests?
16
16
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`.
18
18
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).
20
20
21
21
### How do I use volume mounts?
22
22
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.
24
24
25
25
:::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.":::
26
26
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.
28
29
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:
32
31
33
32
| Sidecar name | Volume sub path | Container mount path | Read-only |
Copy file name to clipboardExpand all lines: articles/app-service/includes/tutorial-sidecar/sidecar-overview.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,11 +2,11 @@
2
2
author: cephalin
3
3
ms.service: azure-app-service
4
4
ms.topic: include
5
-
ms.date: 05/08/2025
5
+
ms.date: 06/19/2025
6
6
ms.author: cephalin
7
7
---
8
8
9
9
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.
10
10
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.
Copy file name to clipboardExpand all lines: articles/app-service/tutorial-custom-container-sidecar.md
+75-53Lines changed: 75 additions & 53 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
2
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.
4
4
ms.topic: tutorial
5
5
ms.date: 06/18/2025
6
6
ms.author: cephalin
@@ -28,9 +28,11 @@ For bring-your-own-code Linux apps, see [Tutorial: Configure a sidecar container
28
28
1. Sign in to Azure if necessary, and make sure you're in the **Bash** environment of Cloud Shell.
29
29
1. Select **Copy** in a code block, paste the code into Cloud Shell, and run it.
30
30
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
+
31
33
## 1. Set up the tutorial resources
32
34
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.
@@ -39,98 +41,118 @@ To create the resources that this tutorial uses, run the following commands in C
39
41
azd provision
40
42
```
41
43
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:
43
45
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).
48
49
- 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`.
50
52
51
-
When deployment completes, you should see the following output:
53
+
When deployment completes, you should see similar to the following output:
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
56
64
```
57
65
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 laterin this tutorial. Select the `Open resource group inthe portal` link to open the resource group in the Azure portal.
59
67
60
68
## 2. Create a sidecar-enabled app
61
69
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**.
64
74
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.":::
66
76
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.
73
83
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.":::
75
85
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.
83
87
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**.
- **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.":::
85
100
86
101
> [!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).
88
103
89
-
1. Select **Review + create**, then select **Create**.
104
+
1. Select **Review + create**, and when validation passes, select **Create**.
90
105
91
106
1. Once the deployment completes, select **Go to resource**.
92
107
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.
94
109
95
110
## 3. Add a sidecar container to the app
96
111
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**.
98
117
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:
- **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*.
105
127
106
128
1. Select **Apply**.
107
129
108
130
:::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.":::
109
131
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.
111
133
112
134
## 4. Configure environment variables
113
135
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).
115
137
116
138
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.
- **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:
- **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**.
123
145
124
146
:::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.":::
125
147
126
148
> [!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).
128
150
129
151
## 5. Verify in Application Insights
130
152
131
153
The `otel-collector` sidecar should export data to Application Insights now.
132
154
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 foryour app and refresh the page a few times to generate some web requests.
134
156
1. On the resource group page in the Azure portal, selectthe**Application Insights** resource. You should now see some data in the default charts.
135
157
136
158
:::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
156
178
157
179
Sidecar-enabled apps are configured differently than apps that aren't sidecar-enabled.
158
180
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).
161
183
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:
0 commit comments