Skip to content

Commit d97f23d

Browse files
committed
draft
1 parent 184e20e commit d97f23d

File tree

3 files changed

+78
-87
lines changed

3 files changed

+78
-87
lines changed

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

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

99
### How do sidecar containers handle internal communication?
1010

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.
1212

1313
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.
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 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`.
1818

1919
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 enables you to share non-persistent files and directories between containers within your web app.
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:** 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.
2828

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.
3030

3131
For example, suppose the following volume mounts are configured:
3232

@@ -38,9 +38,9 @@ For example, suppose the following volume mounts are configured:
3838
| Container4 | /directory4 | /container1Vol | False |
3939

4040
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.
4444

4545
> [!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.

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ ms.date: 05/08/2025
66
ms.author: cephalin
77
---
88

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.
1010

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 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.
1212

13-
The sidecar containers run alongside the main application container in the same App Service plan.

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

Lines changed: 66 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -2,61 +2,64 @@
22
title: 'Tutorial: Configure a sidecar for a custom container app'
33
description: Add sidecar containers to your custom container in Azure App Service. Add or update services to your application without changing your application container.
44
ms.topic: tutorial
5-
ms.date: 05/07/2025
5+
ms.date: 06/18/2025
66
ms.author: cephalin
77
author: cephalin
88
keywords: azure app service, web app, linux, windows, docker, container, sidecar
99
---
1010

11-
# Tutorial: Configure a sidecar container for custom container in Azure App Service
11+
# Tutorial: Configure a sidecar container for a custom container app
1212

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).
14-
15-
[!INCLUDE [quickstarts-free-trial-note](~/reusable-content/ce-skilling/azure/includes/quickstarts-free-trial-note.md)]
13+
This tutorial shows you how to add an OpenTelemetry collector as a sidecar container to a Linux custom container app in Azure App Service.
1614

1715
[!INCLUDE [sidecar-overview](includes/tutorial-sidecar/sidecar-overview.md)]
1816

19-
## 1. Set up the needed resources
17+
For bring-your-own-code Linux apps, see [Tutorial: Configure a sidecar container for a Linux app in Azure App Service](tutorial-sidecar.md).
2018

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
2220

23-
1. In the [Azure Cloud Shell](https://shell.azure.com), run the following commands:
21+
- [!INCLUDE [quickstarts-free-trial-note](~/reusable-content/ce-skilling/azure/includes/quickstarts-free-trial-note.md)]
22+
- 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:
2423

25-
```azurecli-interactive
26-
git clone https://github.com/Azure-Samples/app-service-sidecar-tutorial-prereqs
27-
cd app-service-sidecar-tutorial-prereqs
28-
azd env new my-sidecar-env
29-
azd provision
30-
```
24+
1. Select the following **Launch Cloud Shell** button or go to https://shell.azure.com to open Cloud Shell in your browser.
3125

32-
1. When prompted, supply the subscription and region you want. For example:
26+
:::image type="icon" source="~/reusable-content/ce-skilling/azure/media/cloud-shell/launch-cloud-shell-button.png" alt-text="Button to launch the Azure Cloud Shell." border="false" link="https://shell.azure.com":::
3327

34-
- Subscription: Your subscription.
35-
- Region: *(Europe) West Europe*.
28+
1. Sign in to Azure if necessary, and make sure you're in the **Bash** environment of Cloud Shell.
29+
1. Select **Copy** in a code block, paste the code into Cloud Shell, and run it.
3630

37-
When deployment completes, you should see the following output:
31+
## 1. Set up the tutorial resources
3832

39-
<pre>
40-
APPLICATIONINSIGHTS_CONNECTION_STRING = <b>InstrumentationKey=...;IngestionEndpoint=...;LiveEndpoint=...</b>
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.
4134

42-
Open resource group in the portal: <b>https://portal.azure.com/#@/resource/subscriptions/.../resourceGroups/...</b>
43-
</pre>
35+
```bash
36+
git clone https://github.com/Azure-Samples/app-service-sidecar-tutorial-prereqs
37+
cd app-service-sidecar-tutorial-prereqs
38+
azd env new my-sidecar-env
39+
azd provision
40+
```
4441

45-
1. Open the resource group link in a browser tab. You'll need to use the connection string later.
42+
The `azd provision` command uses the included templates to create the following Azure resources:
43+
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).
48+
- A [Log Analytics workspace](/azure/azure-monitor/logs/log-analytics-overview).
49+
- An [Application Insights](/azure/azure-monitor/app/app-insights-overview) component.
50+
51+
When deployment completes, you should see the following output:
52+
53+
```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+
```
57+
58+
Open the resource group link in a browser tab. Take note of the connection string to use later.
4659

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-
5760
## 2. Create a sidecar-enabled app
5861

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**.
6063
1. Search for *web app*, then select the down arrow on **Create** and select **Web App**.
6164
6265
:::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
8992
9093
1. In a new browser tab, navigate to `https://<app-name>.azurewebsites.net` and see the default Nginx page.
9194
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
9596
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.
9998

10099
1. Select **Add** and configure the new container as follows:
101100
- **Name**: *otel-collector*
@@ -108,43 +107,42 @@ In this section, you add a sidecar container to your custom container app.
108107

109108
:::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.":::
110109

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.
112111

113112
## 4. Configure environment variables
114113

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).
118115

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 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:
122120
- **Name**: *APPLICATIONINSIGHTS_CONNECTION_STRING*
123121
- **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-
125122
1. Select **Apply**, then **Apply**, then **Confirm**.
126123
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.":::
128125
129126
> [!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+
131129
## 5. Verify in Application Insights
132130
133-
The otel-collector sidecar should export data to Application Insights now.
131+
The `otel-collector` sidecar should export data to Application Insights now.
134132
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.
137135
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.":::
139137
140138
> [!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.
142140
143-
## Clean up resources
141+
## 6. Clean up resources
144142
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.
146144
147-
```azurecli-interactive
145+
```azurecli
148146
azd down
149147
```
150148
@@ -156,29 +154,23 @@ azd down
156154
157155
### What are the differences for sidecar-enabled custom containers?
158156
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.
160158
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).
162161
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:
169163
170-
#### Sidecar-enabled
164+
- `DOCKER_REGISTRY_SERVER_URL`
165+
- `DOCKER_REGISTRY_SERVER_USERNAME`
166+
- `DOCKER_REGISTRY_SERVER_PASSWORD`
167+
- `WEBSITES_PORT`
171168
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.
178170
179171
[!INCLUDE [common-faqs](includes/tutorial-sidecar/common-faqs.md)]
180172
181-
## More resources
173+
## Related resources
182174
183175
- [Configure custom container](configure-custom-container.md)
184176
- [REST API: Web Apps - Create Or Update Site Container](/rest/api/appservice/web-apps/create-or-update-site-container)

0 commit comments

Comments
 (0)