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/tutorial-custom-container-sidecar.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
@@ -3,8 +3,8 @@ 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.
Copy file name to clipboardExpand all lines: articles/app-service/tutorial-sidecar.md
+29-40Lines changed: 29 additions & 40 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,8 +3,8 @@ title: 'Tutorial: Configure a sidecar container'
3
3
description: Add sidecar containers to your Linux app in Azure App Service. Add or update services to your application without changing your application code.
4
4
ms.topic: tutorial
5
5
ms.date: 11/19/2024
6
-
ms.author: msangapu
7
-
author: msangapu-msft
6
+
ms.author: cephalin
7
+
author: cephalin
8
8
keywords: azure app service, web app, linux, windows, docker, sidecar
9
9
---
10
10
@@ -25,12 +25,12 @@ For more information about side container in App Service, see:
25
25
26
26
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.
27
27
28
-
1. In the [Azure Cloud Shell](https://shell.azure.com), run the following commands:
28
+
1. In the [Azure Cloud Shell](https://shell.azure.com), run the following commands. Be sure to supply the `<environment-name>`
Open resource group in the portal: <b>https://portal.azure.com/#@/resource/subscriptions/.../resourceGroups/my-sidecar-env_group</b>
46
+
Azure container registry name = <b><registry-name></b>
47
+
Managed identity resource ID = <b><managed-identity-resource-id></b>
48
+
Managed identity client ID = <b><managed-identity-client-id></b>
49
+
50
+
Open resource group in the portal: <b>https://portal.azure.com/#@/resource/subscriptions/<subscription-id>/resourceGroups/<group-name></b>
48
51
</pre>
49
52
50
-
1. Open the resource group link in a browser tab. You'll need to use the connection string later.
53
+
1. Open the resource group link in a browser tab. You'll need these output values later.
51
54
52
55
> [!NOTE]
53
56
> `azd provision` uses the included templates to create the following Azure resources:
54
57
>
55
-
> - A resource group called *my-sidecar-env_group*.
58
+
> - A resource group based on the environment name.
56
59
> - A [container registry](/azure/container-registry/container-registry-intro) with two images deployed:
57
60
> - An Nginx image with the OpenTelemetry module.
58
61
> - An OpenTelemetry collector image, configured to export to [Azure Monitor](/azure/azure-monitor/overview).
@@ -70,7 +73,7 @@ cd MyFirstAzureWebApp
70
73
az webapp up --name <app-name> --os-type linux
71
74
```
72
75
73
-
This basic web application is deployed as MyFirstAzureWebApp.dll to App Service.
76
+
After a few minutes, this basic web application is deployed as MyFirstAzureWebApp.dll to App Service.
74
77
75
78
## 3. Add a sidecar container
76
79
@@ -88,6 +91,7 @@ In this section, you add a sidecar container to your Linux app. The portal exper
88
91
1. Select **Add** and configure the new container as follows:
89
92
-**Name**: *otel-collector*
90
93
-**Image source**: **Azure Container Registry**
94
+
-**Authentication**: **Admin Credentials**
91
95
-**Registry**: The registry created by `azd provision`
92
96
-**Image**: **otel-collector**
93
97
-**Tag**: **latest**
@@ -98,42 +102,34 @@ In this section, you add a sidecar container to your Linux app. The portal exper
98
102
99
103
### [Use ARM template](#tab/template)
100
104
105
+
1. In the Cloud Shell, run the following command to add to the web app the user-assigned managed identity that `azd provision` created. This identity already has the permissions to pull from the container registry. Use the value of `<managed-identity-resource-id>` in the `azd provision` output.
106
+
107
+
```azurecli-interactive
108
+
az webapp identity assign --identities <managed-identity-resource-id>
109
+
```
110
+
111
+
If you run this command inside *~/MyFirstAzureWebApp*, you don't need to add any other parameters because `az webapp up` set defaults already for the resource group and the app name.
112
+
101
113
1. Navigate to the [custom deployment](https://portal.azure.com/#create/Microsoft.Template) template in the portal.
102
114
103
115
1. Select **Build your own template in the editor**.
104
116
105
-
1. Replace the content in the textbox with the following JSON code and select **Save**:
117
+
1. Replace the content in the textbox with the following JSON code and select **Save**. For `<registry-name>` and `<managed-identity-client-id>`, use the output values from `azd provision` earlier. For `<app-name>`, use the app name in `az webapp up earlier`. For `<sidecar-name>`, supply a name for the sidecar container.
@@ -155,14 +151,7 @@ In this section, you add a sidecar container to your Linux app. The portal exper
155
151
> }
156
152
> ```
157
153
158
-
1. Configure the template input with the following information:
159
-
160
-
- **Resource Group**: Select the resource group with the App Service app you created with `az webapp up` earlier.
161
-
- **App Name**: Type the name of the App Service app.
162
-
- **Azure Container Registry Name**: Type the name of the registry you created with `azd up` earlier.
163
-
- **Azure Container Registry Image Name**: Leave the default value of *otel-collector:latest*. This points to the OpenTelemtry image in the registry.
164
-
165
-
1. Select **Review + Create**, then select **Create**.
154
+
1. For the template input, select the resource group that has the web app. Select **Review + Create**, then select **Create**.
166
155
167
156
Since the portal UI isn't available to you, you can't see this sidecar container as part of the app, but you should be able to [see related start-up logs for the sidecar](troubleshoot-diagnostic-logs.md).
168
157
@@ -217,7 +206,7 @@ In this step, you create the autoinstrumentation for your app according to the s
217
206
EOF
218
207
```
219
208
220
-
1. Deploy this file to your app with the following Azure CLI command:
209
+
1. Deploy this file to your app with the following Azure CLI command. If you're still in the `~/MyFirstAzureWebApp`, then no other parameters are necessary because the resource group and web app were saved as defaults by `az webapp up`.
221
210
222
211
```azurecli-interactive
223
212
az webapp deploy --src-path startup.sh --target-path /home/site/startup.sh --type static
0 commit comments