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
- Any Linux-based x86-64 (`linux/amd64`) container image
22
22
- Containers from any public or private container registry
23
23
24
-
Additional features include:
24
+
Features include:
25
25
26
-
- There is no required base container image.
27
-
- Changes to the `template` ARM configuration section triggers a new [container app revision](application-lifecycle-management.md).
26
+
- There's no required base container image.
27
+
- Changes to the `template` ARM configuration section trigger a new [container app revision](application-lifecycle-management.md).
28
28
- If a container crashes, it automatically restarts.
29
29
30
30
> [!NOTE]
@@ -141,6 +141,53 @@ The following example shows how to deploy an app from the Azure Container Regist
141
141
}
142
142
```
143
143
144
+
### Managed identity with Azure Container Registry
145
+
146
+
You can use an Azure managed identity to authenticate with Azure Container Registry instead of using a username and password. To use a managed identity, assign a system-assigned or user-assigned managed identity to your container app, then specify the managed identity you want to use for each registry using the managed identity resource ID for user-assigned, or "system" for system-assigned.
147
+
148
+
```json
149
+
{
150
+
"identity": {
151
+
"type": "SystemAssigned,UserAssigned",
152
+
"userAssignedIdentities": {
153
+
"<IDENTITY1_RESOURCE_ID>": {}
154
+
}
155
+
}
156
+
"properties": {
157
+
"configuration": {
158
+
"registries": [
159
+
{
160
+
"server": "myacr1.azurecr.io",
161
+
"identity": "<IDENTITY1_RESOURCE_ID>"
162
+
},
163
+
{
164
+
"server": "myacr2.azurecr.io",
165
+
"identity": "system"
166
+
}]
167
+
}
168
+
...
169
+
}
170
+
}
171
+
```
172
+
173
+
The managed identity must have `AcrPull` access on the Azure Container Registry. For more information about assigning Azure Container Registry permissions to managed identities, see [Authenticate with managed identity](../container-registry/container-registry-authentication-managed-identity).
174
+
175
+
System-assigned identities are created at the time your container app is created, and therefore, won't have `AcrPull` access to your Azure Container Registry. As a result, the image can't be pulled from your private registry when your app is first deployed.
176
+
177
+
To configure a system-assigned identity, you must use one of the following methods.
178
+
179
+
Use a public registry for the initial deployment:
180
+
181
+
1. Create your container app using a public image and a system-assigned identity.
182
+
1. Give the new system-assigned identity `AcrPull` access to your private Azure Container Registry.
183
+
1. Update your container app replacing the public image with the image from your private Azure Container Registry.
184
+
185
+
Restart your app after assigning permissions:
186
+
187
+
1. Create your container app using a private image and a system-assigned identity. (The deployment will result in a failure to pull the image.)
188
+
1. Give the new system-assigned identity `AcrPull` access to your private Azure Container Registry.
189
+
1. Restart your container app revision.
190
+
144
191
## Limitations
145
192
146
193
Azure Container Apps has the following limitations:
Copy file name to clipboardExpand all lines: articles/container-apps/managed-identity.md
+6-9Lines changed: 6 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ services: container-apps
5
5
author: cebundy
6
6
ms.service: container-apps
7
7
ms.topic: how-to
8
-
ms.date: 04/11/2022
8
+
ms.date: 05/11/2022
9
9
ms.author: v-bcatherine
10
10
---
11
11
@@ -28,6 +28,7 @@ With managed identities:
28
28
- You can use role-based access control to grant specific permissions to a managed identity.
29
29
- System-assigned identities are automatically created and managed. They're deleted when your container app is deleted.
30
30
- You can add and delete user-assigned identities and assign them to multiple resources. They're independent of your container app's life cycle.
31
+
- You can use managed identity to [authenticate with a private Azure Container Registry](container.md#container-registries) without a username and password to pull containers for your Container App.
31
32
32
33
### Common use cases
33
34
@@ -43,11 +44,7 @@ User-assigned identities are ideal for workloads that:
43
44
44
45
## Limitations
45
46
46
-
The identity is only available within a running container, which means you can't use a managed identity to:
47
-
48
-
- Pull an image from Azure Container Registry
49
-
- Define scaling rules or Dapr configuration
50
-
- To access resources that require a connection string or key, such as storage resources, you'll still need to include the connection string or key in the `secretRef` of the scaling rule.
47
+
The identity is only available within a running container, which means you can't use a managed identity in scaling rules or Dapr configuration. To access resources that require a connection string or key, such as storage resources, you'll still need to include the connection string or key in the `secretRef` of the scaling rule.
51
48
52
49
## Configure managed identities
53
50
@@ -268,11 +265,11 @@ A container app with a managed identity exposes the identity endpoint by definin
268
265
- IDENTITY_ENDPOINT - local URL from which your container app can request tokens.
269
266
- IDENTITY_HEADER - a header used to help mitigate server-side request forgery (SSRF) attacks. The value is rotated by the platform.
270
267
271
-
To get a token for a resource, make an HTTP GET request to this endpoint, including the following parameters:
268
+
To get a token for a resource, make an HTTP GET request to the endpoint, including the following parameters:
272
269
273
270
| Parameter name | In | Description|
274
271
|---------|---------|---------|
275
-
| resource | Query | The Azure AD resource URI of the resource for which a token should be obtained. This could be one of the [Azure services that support Azure AD authentication](../active-directory/managed-identities-azure-resources/services-support-managed-identities.md#azure-services-that-support-azure-ad-authentication) or any other resource URI. |
272
+
| resource | Query | The Azure AD resource URI of the resource for which a token should be obtained. The resource could be one of the [Azure services that support Azure AD authentication](../active-directory/managed-identities-azure-resources/services-support-managed-identities.md#azure-services-that-support-azure-ad-authentication) or any other resource URI. |
276
273
| api-version | Query | The version of the token API to be used. Use "2019-08-01" or later. |
277
274
| X-IDENTITY-HEADER | Header | The value of the `IDENTITY_HEADER` environment variable. This header mitigates server-side request forgery (SSRF) attacks. |
278
275
| client_id | Query | (Optional) The client ID of the user-assigned identity to be used. Can't be used on a request that includes `principal_id`, `mi_res_id`, or `object_id`. If all ID parameters (`client_id`, `principal_id`, `object_id`, and `mi_res_id`) are omitted, the system-assigned identity is used.|
@@ -343,4 +340,4 @@ To remove all identities, set the `type` of the container app's identity to `Non
0 commit comments