Skip to content

Commit e43486c

Browse files
committed
Merge branch 'ami-updates' of https://github.com/cebundy/azure-docs-pr
2 parents 91591ba + e2d8b07 commit e43486c

File tree

2 files changed

+57
-13
lines changed

2 files changed

+57
-13
lines changed

articles/container-apps/containers.md

Lines changed: 51 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ services: container-apps
55
author: craigshoemaker
66
ms.service: container-apps
77
ms.topic: conceptual
8-
ms.date: 02/18/2022
8+
ms.date: 05/11/2022
99
ms.author: cshoe
1010
ms.custom: ignite-fall-2021
1111
---
@@ -21,10 +21,10 @@ Azure Container Apps supports:
2121
- Any Linux-based x86-64 (`linux/amd64`) container image
2222
- Containers from any public or private container registry
2323

24-
Additional features include:
24+
Features include:
2525

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).
2828
- If a container crashes, it automatically restarts.
2929

3030
> [!NOTE]
@@ -141,6 +141,53 @@ The following example shows how to deploy an app from the Azure Container Regist
141141
}
142142
```
143143

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+
144191
## Limitations
145192

146193
Azure Container Apps has the following limitations:

articles/container-apps/managed-identity.md

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ services: container-apps
55
author: cebundy
66
ms.service: container-apps
77
ms.topic: how-to
8-
ms.date: 04/11/2022
8+
ms.date: 05/11/2022
99
ms.author: v-bcatherine
1010
---
1111

@@ -28,6 +28,7 @@ With managed identities:
2828
- You can use role-based access control to grant specific permissions to a managed identity.
2929
- System-assigned identities are automatically created and managed. They're deleted when your container app is deleted.
3030
- 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.
3132

3233
### Common use cases
3334

@@ -43,11 +44,7 @@ User-assigned identities are ideal for workloads that:
4344

4445
## Limitations
4546

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

5249
## Configure managed identities
5350

@@ -268,11 +265,11 @@ A container app with a managed identity exposes the identity endpoint by definin
268265
- IDENTITY_ENDPOINT - local URL from which your container app can request tokens.
269266
- IDENTITY_HEADER - a header used to help mitigate server-side request forgery (SSRF) attacks. The value is rotated by the platform.
270267

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:
272269

273270
| Parameter name | In | Description|
274271
|---------|---------|---------|
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. |
276273
| api-version | Query | The version of the token API to be used. Use "2019-08-01" or later. |
277274
| X-IDENTITY-HEADER | Header | The value of the `IDENTITY_HEADER` environment variable. This header mitigates server-side request forgery (SSRF) attacks. |
278275
| 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
343340
## Next steps
344341

345342
> [!div class="nextstepaction"]
346-
> [Monitor an app](monitor.md)
343+
> [Monitor an app](monitor.md)

0 commit comments

Comments
 (0)