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
+10-10Lines changed: 10 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,31 +2,31 @@
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/18/2025
6
6
ms.author: cephalin
7
7
---
8
8
9
9
### How do sidecar containers handle internal communication?
10
10
11
-
Sidecar containers share the same network host as the main container, so the main container (and other sidecar containers) can reach any port on the sidecar with `localhost:<port>`. The example *startup.sh* uses `localhost:4318` to access port 4318 on the **otel-collector** sidecar.
11
+
Sidecar containers share the same network host as the main container, so the main container and other sidecar containers can reach any port on the sidecar with `localhost:<port>`. The example *startup.sh* uses `localhost:4318` to access port 4318 on the **otel-collector** sidecar.
12
12
13
13
In the **Edit container** dialog, the **Port** box isn't currently used by App Service. You can use it as part of the sidecar metadata, such as to indicate which port the sidecar is listening to.
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 but 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 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`.
18
18
19
19
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 enables you to share non-persistent files and directories between containers within your web app.
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:**This is a logical directory path that is automatically created, and is not referenced within the container. Containers that are configured with the same volume sub path can share files and directories with each other.
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
28
29
-
**Container mount path:** This corresponds to a directory path that you reference within the container. The container mount path is mapped to the volume sub path.
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
30
31
31
For example, suppose the following volume mounts are configured:
32
32
@@ -38,9 +38,9 @@ For example, suppose the following volume mounts are configured:
Based on these settings, the following conditions apply:
41
-
-If Container1 creates **/container1Vol/myfile.txt**, Container2 can read the file via **/container2Vol/myfile.txt**.
42
-
-If Container1 creates **/container1Vol/directory3/myfile.txt**, Container2 can read the file via **/container2Vol/directory3/myfile.txt**, and Container3 can read and write to the file via **/container3Vol/myfile.txt**.
43
-
-Container4 does not share a volume mount in common with any of the other containers.
41
+
-If Container1 creates */container1Vol/myfile.txt*, Container2 can read the file via */container2Vol/myfile.txt*.
42
+
-If Container1 creates */container1Vol/directory3/myfile.txt*, Container2 can read the file via */container2Vol/directory3/myfile.txt*, and Container3 can read and write to the file via */container3Vol/myfile.txt*.
43
+
-Container4 doesn't share a volume mount in common with any of the other containers.
44
44
45
45
> [!Note]
46
-
> For code-based Linux apps, the built-in Linux container cannot use volume mounts.
46
+
> For code-based Linux apps, the built-in Linux container can't use volume mounts.
Copy file name to clipboardExpand all lines: articles/app-service/includes/tutorial-sidecar/sidecar-overview.md
+2-3Lines changed: 2 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,8 +6,7 @@ ms.date: 05/08/2025
6
6
ms.author: cephalin
7
7
---
8
8
9
-
## What's a sidecar container?
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
-
In Azure App Service, you can add up to nine sidecar containers for each Linux app. Sidecar containers let you deploy extra services and features to your Linux apps without making them tightly coupled to the main container (built-in or custom). For example, you can add monitoring, logging, configuration, and networking services as sidecar containers. An OpenTelemetry collector sidecar is one such monitoring example.
11
+
You can add up to nine sidecar containers for each Linux appin App Service. For example, you can add monitoring, logging, configuration, and networking services as sidecar containers. An OpenTelemetry collector sidecar is one monitoring example.
12
12
13
-
The sidecar containers run alongside the main application container in the same App Service plan.
Copy file name to clipboardExpand all lines: articles/app-service/tutorial-custom-container-sidecar.md
+66-74Lines changed: 66 additions & 74 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,61 +2,64 @@
2
2
title: 'Tutorial: Configure a sidecar for a custom container app'
3
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.
# Tutorial: Configure a sidecar container for custom container in Azure App Service
11
+
# Tutorial: Configure a sidecar container for a custom container app
12
12
13
-
In this tutorial, you add an OpenTelemetry collector as a sidecar container to a Linux custom container app in Azure App Service. For bring-your-own-code Linux apps, see [Tutorial: Configure a sidecar container for a Linux app in Azure App Service](tutorial-sidecar.md).
For bring-your-own-code Linux apps, see [Tutorial: Configure a sidecar container for a Linux app in Azure App Service](tutorial-sidecar.md).
20
18
21
-
First you create the resources that the tutorial uses. They're used for this particular scenario and aren't required for sidecar containers in general.
19
+
## Prerequisites
22
20
23
-
1. In the [Azure Cloud Shell](https://shell.azure.com), run the following commands:
- Run the commands in this tutorial by using Azure Cloud Shell, an interactive shell that you can use through your browser to work with Azure services. To use Cloud Shell:
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.
41
34
42
-
Open resource group in the portal: <b>https://portal.azure.com/#@/resource/subscriptions/.../resourceGroups/...</b>
Open resource group in the portal: https://portal.azure.com/#@/resource/subscriptions/<your-subscription>/resourceGroups/my-sidecar-env_group
56
+
```
57
+
58
+
Open the resource group link in a browser tab. Take note of the connection string to use later.
46
59
47
-
> [!NOTE]
48
-
> `azd provision` uses the included templates to create the following Azure resources:
49
-
>
50
-
> - A resource group called *my-sidecar-env_group*.
51
-
> - A [container registry](/azure/container-registry/container-registry-intro) with two images deployed:
52
-
> - An Nginx image with the OpenTelemetry module.
53
-
> - An OpenTelemetry collector image, configured to export to [Azure Monitor](/azure/azure-monitor/overview).
54
-
> - A [log analytics workspace](/azure/azure-monitor/logs/log-analytics-overview)
55
-
> - An [Application Insights](/azure/azure-monitor/app/app-insights-overview) component
56
-
57
60
## 2. Create a sidecar-enabled app
58
61
59
-
1. In the resource group's management page, select **Create**.
62
+
1. In the resource group's page in the Azure portal, select **Create**.
60
63
1. Search for *web app*, then select the down arrow on **Create** and select **Web App**.
61
64
62
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.":::
@@ -89,13 +92,9 @@ First you create the resources that the tutorial uses. They're used for this par
89
92
90
93
1. In a new browser tab, navigate to `https://<app-name>.azurewebsites.net` and see the default Nginx page.
91
94
92
-
## 3. Add a sidecar container
93
-
94
-
In this section, you add a sidecar container to your custom container app.
95
+
## 3. Add a sidecar container to the app
95
96
96
-
1. In the app's management page, from the left menu, select **Deployment Center**.
97
-
98
-
The deployment center shows you all the containers in the app. Right now, it only has the main container.
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.
99
98
100
99
1. Select **Add** and configure the new container as follows:
101
100
- **Name**: *otel-collector*
@@ -108,43 +107,42 @@ In this section, you add a sidecar container to your custom container app.
108
107
109
108
:::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.":::
110
109
111
-
You should now see two containers in the deployment center. The main container is marked **Main**, and the sidecar container is marked **Sidecar**. Each app must have one main container but can have multiple sidecar containers.
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.
112
111
113
112
## 4. Configure environment variables
114
113
115
-
For the sample scenario, the otel-collector sidecar is configured to export the OpenTelemetry data to Azure Monitor, but it needs the connection string as an environment variable (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)).
116
-
117
-
You configure environment variables for the containers like 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.
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).
118
115
119
-
1. In the app's management page, from the left menu, select **Environment variables**.
120
-
121
-
1. Add an app setting by selecting **Add** and configure it as follows:
116
+
You configure environment variables forthe 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 containersin 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**.
124
-
125
122
1. Select **Apply**, then **Apply**, then **Confirm**.
126
123
127
-
:::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.":::
124
+
:::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.":::
128
125
129
126
> [!NOTE]
130
-
> Certain 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)
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)
128
+
131
129
## 5. Verify in Application Insights
132
130
133
-
The otel-collector sidecar should export data to Application Insights now.
131
+
The `otel-collector` sidecar should export data to Application Insights now.
134
132
135
-
1. Back in the browser tab for `https://<app-name>.azurewebsites.net`, refresh the page a few times to generate some web requests.
136
-
1. Go back to the resource group overview page, then select the Application Insights resource. You should now see some data in the default charts.
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.
134
+
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.
137
135
138
-
:::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.":::
136
+
:::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.":::
139
137
140
138
> [!NOTE]
141
-
> In this very common monitoring scenario, Application Insights is just one of the OpenTelemetry targets you can use, such as Jaeger, Prometheus, and Zipkin.
139
+
> In this common monitoring scenario, Application Insights is just one of the OpenTelemetry targets you can use, such as Jaeger, Prometheus, and Zipkin.
142
140
143
-
## Clean up resources
141
+
## 6. Clean up resources
144
142
145
-
When you no longer need the environment, you can delete the resource group, App service, and all related resources. Just run this command in the Cloud Shell, in the cloned repository:
143
+
When you no longer need the environment, you can delete the resource group, app service, and all related resources. Run the following command in the cloned repository in Cloud Shell.
146
144
147
-
```azurecli-interactive
145
+
```azurecli
148
146
azd down
149
147
```
150
148
@@ -156,29 +154,23 @@ azd down
156
154
157
155
### What are the differences for sidecar-enabled custom containers?
158
156
159
-
You configure sidecar-enabled apps differently than apps that aren't sidecar-enabled.
157
+
Sidecar-enabled apps are configured differently than apps that aren't sidecar-enabled.
160
158
161
-
#### Not sidecar-enabled
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).
162
161
163
-
- Container name and types are configured directly with `LinuxFxVersion=DOCKER|<image-details>` (see [az webapp config set --linux-fx-version](/cli/azure/webapp/config)).
164
-
- The main container is configured with app settings, such as:
165
-
-`DOCKER_REGISTRY_SERVER_URL`
166
-
-`DOCKER_REGISTRY_SERVER_USERNAME`
167
-
-`DOCKER_REGISTRY_SERVER_PASSWORD`
168
-
-`WEBSITES_PORT`
162
+
For non-sidecar enabled apps, the main container is configured with app settings such as:
169
163
170
-
#### Sidecar-enabled
164
+
- `DOCKER_REGISTRY_SERVER_URL`
165
+
- `DOCKER_REGISTRY_SERVER_USERNAME`
166
+
- `DOCKER_REGISTRY_SERVER_PASSWORD`
167
+
- `WEBSITES_PORT`
171
168
172
-
- A sidecar-enabled app is designated by `LinuxFxVersion=sitecontainers` (see [az webapp config set --linux-fx-version](/cli/azure/webapp/config)).
173
-
- The main container is configured with a [sitecontainers](/azure/templates/microsoft.web/sites/sitecontainers) resource. These settings don't apply for sidecar-enabled apps
174
-
-`DOCKER_REGISTRY_SERVER_URL`
175
-
-`DOCKER_REGISTRY_SERVER_USERNAME`
176
-
-`DOCKER_REGISTRY_SERVER_PASSWORD`
177
-
-`WEBSITES_PORT`
169
+
These settings don't apply for sidecar-enabled apps.
0 commit comments