Skip to content

Commit 8221b55

Browse files
committed
update sidecar tutorials
1 parent 0c96e09 commit 8221b55

File tree

4 files changed

+75
-36
lines changed

4 files changed

+75
-36
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
author: cephalin
3+
ms.service: azure-app-service
4+
ms.topic: include
5+
ms.date: 05/08/2025
6+
ms.author: cephalin
7+
---
8+
9+
### How do sidecar containers handle internal communication?
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.
12+
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+
15+
### Can a sidecar container receive internet requests?
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`.
18+
19+
For more information on configuring `IsMain`, see [Microsoft.Web sites/sitecontainers](/azure/templates/microsoft.web/sites/sitecontainers).
20+
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
author: cephalin
3+
ms.service: azure-app-service
4+
ms.topic: include
5+
ms.date: 05/08/2025
6+
ms.author: cephalin
7+
---
8+
9+
## What's a sidecar container?
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.
12+
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: 29 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
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: 04/07/2024
5+
ms.date: 05/07/2025
66
ms.author: cephalin
77
author: cephalin
88
keywords: azure app service, web app, linux, windows, docker, container, sidecar
@@ -12,15 +12,10 @@ keywords: azure app service, web app, linux, windows, docker, container, sidecar
1212

1313
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).
1414

15-
In Azure App Service, you can add up to nine sidecar containers for each sidecar-enabled custom container app. Sidecar containers let you deploy extra services and features to your container application without making them tightly coupled to your main application container. For example, you can add monitoring, logging, configuration, and networking services as sidecar containers. An OpenTelemetry collector sidecar is one such monitoring example.
16-
17-
For more information about side container in App Service, see:
18-
19-
- [Introducing Sidecars for Azure App Service for Linux: Now Generally Available](https://azure.github.io/AppService/2024/11/08/Global-Availability-Sidecars.html)
20-
- [Announcing the general availability of sidecar extensibility in Azure App Service](https://techcommunity.microsoft.com/blog/appsonazureblog/announcing-the-general-availability-of-sidecar-extensibility-in-azure-app-servic/4267985)
21-
2215
[!INCLUDE [quickstarts-free-trial-note](~/reusable-content/ce-skilling/azure/includes/quickstarts-free-trial-note.md)]
2316

17+
[!INCLUDE [sidecar-overview](includes/tutorial-sidecar/sidecar-overview.md)]
18+
2419
## 1. Set up the needed resources
2520

2621
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.
@@ -154,22 +149,39 @@ When you no longer need the environment, you can delete the resource group, App
154149
azd down
155150
```
156151

157-
## How do sidecar containers handle internal communication?
152+
## Frequently asked questions
153+
154+
- [What are the differences for sidecar-enabled custom containers?](#what-are-the-differences-for-sidecar-enabled-custom-containers)
155+
- [How do sidecar containers handle internal communication?](includes/tutorial-sidecar/common-faqs.md#how-do-sidecar-containers-handle-internal-communication)
156+
- [Can a sidecar container receive internet requests?](includes/tutorial-sidecar/common-faqs.md#can-a-sidecar-container-receive-internet-requests)
157+
158+
## What are the differences for sidecar-enabled custom containers?
159+
160+
You configure sidecar-enabled apps differently than apps that aren't sidecar-enabled.
158161

159-
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>`. This is exactly how the Nginx container sends data to the sidecar (see the [OpenTelemetry module configuration for the sample Nginx image](https://github.com/Azure-Samples/app-service-sidecar-tutorial-prereqs/blob/main/images/nginx/opentelemetry_module.conf)).
162+
### Not sidecar-enabled
160163

161-
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.
164+
- Container name and types are configured directly with `LinuxFxVersion=DOCKER|<image-details>` (see [az webapp config set --linux-fx-version](/cli/azure/webapp/config)).
165+
- The main container is configured with app settings, such as:
166+
- `DOCKER_REGISTRY_SERVER_URL`
167+
- `DOCKER_REGISTRY_SERVER_USERNAME`
168+
- `DOCKER_REGISTRY_SERVER_PASSWORD`
169+
- `WEBSITES_PORT`
162170

163-
## Differences for sidecar-enabled apps
171+
### Sidecar-enabled
164172

165-
You configure sidecar-enabled apps differently than apps that aren't sidecar-enabled. Specifically, you don't configure the main container and sidecars with app settings, but directly in the resource properties. These app settings don't apply for sidecar-enabled apps:
173+
- A sidecar-enabled app is designated by `LinuxFxVersion=sitecontainers` (see [az webapp config set --linux-fx-version](/cli/azure/webapp/config)).
174+
- The main container is configured with a [sitecontainers](/azure/templates/microsoft.web/sites/sitecontainers) resource. These settings don't apply for sidecar-enabled apps
175+
- `DOCKER_REGISTRY_SERVER_URL`
176+
- `DOCKER_REGISTRY_SERVER_USERNAME`
177+
- `DOCKER_REGISTRY_SERVER_PASSWORD`
178+
- `WEBSITES_PORT`
166179

167-
- Registry authentication settings: `DOCKER_REGISTRY_SERVER_URL`, `DOCKER_REGISTRY_SERVER_USERNAME` and `DOCKER_REGISTRY_SERVER_PASSWORD`.
168-
- Container port: `WEBSITES_PORT`
180+
[!INCLUDE [common-faqs](includes/tutorial-sidecar/common-faqs.md)]
169181

170182
## More resources
171183

172184
- [Configure custom container](configure-custom-container.md)
173-
- [Try out sidecars in this guided lab](https://mslabs.cloudguides.com/guides/Sidecars%20in%20Azure%20App%20Service)
185+
- [REST API: Web Apps - Create Or Update Site Container](/rest/api/appservice/web-apps/create-or-update-site-container)
186+
- [Infrastructure as Code: Microsoft.Web sites/sitecontainers](/azure/templates/microsoft.web/sites/sitecontainers)
174187
- [Deploy custom containers with GitHub Actions](deploy-container-github-action.md)
175-
- [OpenTelemetry](https://opentelemetry.io/)

articles/app-service/tutorial-sidecar.md

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: 'Tutorial: Configure a sidecar container'
33
description: Add sidecar containers to your Linux app in Azure App Service. Add or update services to your application without changing your application code.
44
ms.topic: tutorial
5-
ms.date: 02/20/2025
5+
ms.date: 05/08/2025
66
ms.author: cephalin
77
author: cephalin
88
keywords: azure app service, web app, linux, windows, docker, sidecar
@@ -12,15 +12,10 @@ keywords: azure app service, web app, linux, windows, docker, sidecar
1212

1313
In this tutorial, you add an OpenTelemetry collector as a sidecar container to a Linux (bring-your-own-code) app in Azure App Service. For custom containers, see [Tutorial: Configure a sidecar container for custom container in Azure App Service](tutorial-custom-container-sidecar.md).
1414

15-
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 (built-in) container. For example, you can add monitoring, logging, configuration, and networking services as sidecar containers. An OpenTelemetry collector sidecar is one such monitoring example.
16-
17-
For more information about side container in App Service, see:
18-
19-
- [Introducing Sidecars for Azure App Service for Linux: Now Generally Available](https://azure.github.io/AppService/2024/11/08/Global-Availability-Sidecars.html)
20-
- [Announcing the general availability of sidecar extensibility in Azure App Service](https://techcommunity.microsoft.com/blog/appsonazureblog/announcing-the-general-availability-of-sidecar-extensibility-in-azure-app-servic/4267985)
21-
2215
[!INCLUDE [quickstarts-free-trial-note](~/reusable-content/ce-skilling/azure/includes/quickstarts-free-trial-note.md)]
2316

17+
[!INCLUDE [sidecar-overview](includes/tutorial-sidecar/sidecar-overview.md)]
18+
2419
## 1. Set up the needed resources
2520

2621
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.
@@ -248,16 +243,13 @@ azd down
248243

249244
## Frequently asked questions
250245

251-
- [How do sidecar containers handle internal communication?](#how-do-sidecar-containers-handle-internal-communication)
246+
- [How do sidecar containers handle internal communication?](includes/tutorial-sidecar/common-faqs.md#how-do-sidecar-containers-handle-internal-communication)
247+
- [Can a sidecar container receive internet requests?](includes/tutorial-sidecar/common-faqs.md#can-a-sidecar-container-receive-internet-requests)
252248
- [How do I instrument other language stacks?](#how-do-i-instrument-other-language-stacks)
253249

254-
#### How do sidecar containers handle internal communication?
255-
256-
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.
257-
258-
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.
250+
[!INCLUDE [common-faqs](includes/tutorial-sidecar/common-faqs.md)]
259251

260-
#### How do I instrument other language stacks?
252+
### How do I instrument other language stacks?
261253

262254
You can use a similar approach to instrument apps in other language stacks. For more information, see OpenTelemetry documentation:
263255

@@ -269,7 +261,9 @@ You can use a similar approach to instrument apps in other language stacks. For
269261

270262
## More resources
271263

272-
- [Run a local SLM in a sidecar container in Azure App Service](tutorial-sidecar-local-small-language-model.md)
273-
- [Try out sidecars in this guided lab](https://mslabs.cloudguides.com/guides/Sidecars%20in%20Azure%20App%20Service)
274-
- [Deploy to App Service using GitHub Actions](deploy-github-actions.md)
275-
- [OpenTelemetry](https://opentelemetry.io/)
264+
- [Tutorial: Run chatbot in App Service with a Phi-3 sidecar extension (ASP.NET Core)](tutorial-ai-slm-dotnet.md)
265+
- [Tutorial: Run chatbot in App Service with a Phi-3 sidecar extension (Spring Boot)](tutorial-ai-slm-spring-boot.md)
266+
- [Tutorial: Run chatbot in App Service with a Phi-3 sidecar extension (FastAPI)](tutorial-ai-slm-fastapi.md)
267+
- [Tutorial: Run chatbot in App Service with a Phi-3 sidecar extension (Express.js)](tutorial-ai-slm-expressjs.md)
268+
- [REST API: Web Apps - Create Or Update Site Container](/rest/api/appservice/web-apps/create-or-update-site-container)
269+
- [Infrastructure as Code: Microsoft.Web sites/sitecontainers](/azure/templates/microsoft.web/sites/sitecontainers)

0 commit comments

Comments
 (0)