From 32fb1b9c5e64b7007dbed4e6d2bb15923e448d44 Mon Sep 17 00:00:00 2001 From: Tulika Chaudharie Date: Wed, 29 Oct 2025 15:37:29 +0530 Subject: [PATCH 1/3] Blog for VSTS tasks for sidecars --- _posts/2025-10-29-VSTS-tasks-for-sidecars.md | 93 ++++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 _posts/2025-10-29-VSTS-tasks-for-sidecars.md diff --git a/_posts/2025-10-29-VSTS-tasks-for-sidecars.md b/_posts/2025-10-29-VSTS-tasks-for-sidecars.md new file mode 100644 index 0000000000..f42a972803 --- /dev/null +++ b/_posts/2025-10-29-VSTS-tasks-for-sidecars.md @@ -0,0 +1,93 @@ +--- +title: "Azure Pipeline samples: add sidecars to Azure App Service for Linux" +author_name: "Tulika Chaudharie" +toc: true +toc_sticky: true +--- + +Sidecars on Azure App Service let you attach extra containers — logging, telemetry, lightweight APIs, caches, AI inference helpers — alongside your main app, in the same App Service. They start and run with your app, but you don’t have to bake that logic into your main code. + +We’re publishing two Azure Pipelines (Azure DevOps / VSTS) YAML samples to make this easy. + +## VSTS samples + +* **[`vsts-blessed-sitecontainers.yml`](https://github.com/Azure/actions-workflow-samples/blob/master/AppService/vsts-blessed-sitecontainers.yml)** + For built-in runtimes on App Service for Linux (for example, Python or Node on the built-in stack). + + * Builds your app, zips it, and deploys it using `AzureWebApp@1`. + * In the same deploy step, it sends a `sitecontainersConfig` payload that defines one or more sidecar containers by image, port, and config. + * Your app keeps running on the App Service runtime; the sidecars run next to it. + +* **[`vsts-only-sitecontainers.yml`](https://github.com/Azure/actions-workflow-samples/blob/master/AppService/vsts-only-sitecontainers.yml)** + For containerized apps (Web App for Containers style). + + * Builds and pushes multiple images (main app container + sidecars) to your container registry. + * Uses `AzureWebAppContainer@1` to deploy them all together to App Service for Linux. + * One container is marked `"isMain": true`; the rest are `"isMain": false`. + +Both samples assume Azure App Service for Linux and the sidecar model, where containers in the same app can talk to each other over localhost. + +## How the pipelines work + +1. **Build** + + * `vsts-blessed-sitecontainers.yml`: sets up your language/runtime, installs dependencies, and produces a ZIP artifact of your app. + * `vsts-only-sitecontainers.yml`: uses Docker tasks to build and tag multiple container images. + +2. **Publish artifacts / push images** + + * Code-based flow: publishes the ZIP as a pipeline artifact. + * Container flow: pushes tagged images to Azure Container Registry. + +3. **Deploy to App Service for Linux** + + * Code-based flow: `AzureWebApp@1` deploys the ZIP and also applies a `sitecontainersConfig` block that defines your sidecar containers. + * Container flow: `AzureWebAppContainer@1` deploys your main container plus any sidecars in one shot, using `sitecontainersConfig`. + +That’s it: one pipeline run builds, packages, and deploys your main app plus its helper containers. + +## Quick start + +1. **Pick a template** + + * Built-in runtime on App Service for Linux? Use `vsts-blessed-sitecontainers.yml`. + * Already running containers? Use `vsts-only-sitecontainers.yml`. + +2. **Add it to your repo** + Save the YAML as `azure-pipelines.yml` (or add it as a new pipeline in Azure DevOps). + +3. **Fill in the placeholders** + + * `azureServiceConnectionId` / `azureSubscription`: your Azure RM service connection. + * `webAppName` / `appName`: the target App Service for Linux app. + * `resourceGroup`: where that app lives. + * `containerRegistry`, image names, and ports for each container in the multi-container case. + * Each container in `sitecontainersConfig` declares its port and whether it’s the main app or a sidecar. + +4. **Run it in Azure DevOps** + Create a new pipeline from YAML, authorize the service connections, and run. + +5. **Check your app** + In the Azure portal, go to Deployment Center->Containers and your App Service will now show your primary app plus the sidecar containers defined in the pipeline. + +## Customize to fit + +These YAMLs are starting points. You can: + +* Add test/lint stages before deployment so you only ship good builds. +* Swap the agent pool (`ubuntu-latest` vs your own self-hosted pool). +* Deploy to a staging slot first, then swap to production. +* Tune each sidecar in `sitecontainersConfig`: env vars, ports, credentials, etc. + +You don’t have to redesign CI/CD every time you want to add observability, a cache container, or a small inference helper next to your app — you just describe the containers and ship. + + +## Learn more + +* **Deploy to Azure App Service using Azure Pipelines** + Full walkthrough for setting up [Azure Pipelines with App Service](https://learn.microsoft.com/en-us/azure/app-service/deploy-azure-pipelines?tabs=yaml), including service connections and the `AzureWebApp@1` / `AzureWebAppContainer@1` tasks. + +* **Sidecars on App Service for Linux** + [How sidecars work](https://learn.microsoft.com/en-us/azure/app-service/overview-sidecar), how `isMain` is used, networking rules (localhost between containers), and common patterns like telemetry/OTEL agents, API helpers, and lightweight caches. + +Drop these templates into your pipeline, point them at your app, and you’ve got repeatable CI/CD for multi-containers in App Service. From a0f2b954e071903cf481314eddb3a89d1c442472 Mon Sep 17 00:00:00 2001 From: Tulika Chaudharie Date: Wed, 29 Oct 2025 15:46:44 +0530 Subject: [PATCH 2/3] changed line spacing --- _posts/2025-10-29-VSTS-tasks-for-sidecars.md | 8 -------- 1 file changed, 8 deletions(-) diff --git a/_posts/2025-10-29-VSTS-tasks-for-sidecars.md b/_posts/2025-10-29-VSTS-tasks-for-sidecars.md index f42a972803..6d065df959 100644 --- a/_posts/2025-10-29-VSTS-tasks-for-sidecars.md +++ b/_posts/2025-10-29-VSTS-tasks-for-sidecars.md @@ -13,14 +13,12 @@ We’re publishing two Azure Pipelines (Azure DevOps / VSTS) YAML samples to mak * **[`vsts-blessed-sitecontainers.yml`](https://github.com/Azure/actions-workflow-samples/blob/master/AppService/vsts-blessed-sitecontainers.yml)** For built-in runtimes on App Service for Linux (for example, Python or Node on the built-in stack). - * Builds your app, zips it, and deploys it using `AzureWebApp@1`. * In the same deploy step, it sends a `sitecontainersConfig` payload that defines one or more sidecar containers by image, port, and config. * Your app keeps running on the App Service runtime; the sidecars run next to it. * **[`vsts-only-sitecontainers.yml`](https://github.com/Azure/actions-workflow-samples/blob/master/AppService/vsts-only-sitecontainers.yml)** For containerized apps (Web App for Containers style). - * Builds and pushes multiple images (main app container + sidecars) to your container registry. * Uses `AzureWebAppContainer@1` to deploy them all together to App Service for Linux. * One container is marked `"isMain": true`; the rest are `"isMain": false`. @@ -30,17 +28,14 @@ Both samples assume Azure App Service for Linux and the sidecar model, where con ## How the pipelines work 1. **Build** - * `vsts-blessed-sitecontainers.yml`: sets up your language/runtime, installs dependencies, and produces a ZIP artifact of your app. * `vsts-only-sitecontainers.yml`: uses Docker tasks to build and tag multiple container images. 2. **Publish artifacts / push images** - * Code-based flow: publishes the ZIP as a pipeline artifact. * Container flow: pushes tagged images to Azure Container Registry. 3. **Deploy to App Service for Linux** - * Code-based flow: `AzureWebApp@1` deploys the ZIP and also applies a `sitecontainersConfig` block that defines your sidecar containers. * Container flow: `AzureWebAppContainer@1` deploys your main container plus any sidecars in one shot, using `sitecontainersConfig`. @@ -49,7 +44,6 @@ That’s it: one pipeline run builds, packages, and deploys your main app plus i ## Quick start 1. **Pick a template** - * Built-in runtime on App Service for Linux? Use `vsts-blessed-sitecontainers.yml`. * Already running containers? Use `vsts-only-sitecontainers.yml`. @@ -57,7 +51,6 @@ That’s it: one pipeline run builds, packages, and deploys your main app plus i Save the YAML as `azure-pipelines.yml` (or add it as a new pipeline in Azure DevOps). 3. **Fill in the placeholders** - * `azureServiceConnectionId` / `azureSubscription`: your Azure RM service connection. * `webAppName` / `appName`: the target App Service for Linux app. * `resourceGroup`: where that app lives. @@ -73,7 +66,6 @@ That’s it: one pipeline run builds, packages, and deploys your main app plus i ## Customize to fit These YAMLs are starting points. You can: - * Add test/lint stages before deployment so you only ship good builds. * Swap the agent pool (`ubuntu-latest` vs your own self-hosted pool). * Deploy to a staging slot first, then swap to production. From c833fe42dd07203c858f3c77268d115f65a4894a Mon Sep 17 00:00:00 2001 From: Tulika Chaudharie Date: Wed, 29 Oct 2025 16:12:15 +0530 Subject: [PATCH 3/3] Some changes in the definitions --- _posts/2025-10-29-VSTS-tasks-for-sidecars.md | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/_posts/2025-10-29-VSTS-tasks-for-sidecars.md b/_posts/2025-10-29-VSTS-tasks-for-sidecars.md index 6d065df959..9d895f4d4e 100644 --- a/_posts/2025-10-29-VSTS-tasks-for-sidecars.md +++ b/_posts/2025-10-29-VSTS-tasks-for-sidecars.md @@ -27,17 +27,13 @@ Both samples assume Azure App Service for Linux and the sidecar model, where con ## How the pipelines work -1. **Build** - * `vsts-blessed-sitecontainers.yml`: sets up your language/runtime, installs dependencies, and produces a ZIP artifact of your app. - * `vsts-only-sitecontainers.yml`: uses Docker tasks to build and tag multiple container images. +1. **Build and Publish** + * `vsts-blessed-sitecontainers.yml`: sets up your language/runtime, installs dependencies, and produces a ZIP artifact of your app. It also uses Docker tasks to build and publish the sidecar container. + * `vsts-only-sitecontainers.yml`: uses Docker tasks to build and push multiple container images. -2. **Publish artifacts / push images** - * Code-based flow: publishes the ZIP as a pipeline artifact. - * Container flow: pushes tagged images to Azure Container Registry. - -3. **Deploy to App Service for Linux** - * Code-based flow: `AzureWebApp@1` deploys the ZIP and also applies a `sitecontainersConfig` block that defines your sidecar containers. - * Container flow: `AzureWebAppContainer@1` deploys your main container plus any sidecars in one shot, using `sitecontainersConfig`. +2. **Deploy to App Service for Linux** + * Code-based flow: `AzureWebApp@1` deploys the ZIP and sidecar containers defined in `sitecontainersConfig`. + * Container flow: `AzureWebAppContainer@1` deploys your main container and sidecars, defined in `sitecontainersConfig`. That’s it: one pipeline run builds, packages, and deploys your main app plus its helper containers.