Skip to content

Commit ceb1f9b

Browse files
authored
Merge pull request #210413 from cebundy/managed-identity-acr-pull
[Container Apps]: Add managed identity acrpull article
2 parents a8c4539 + daf9398 commit ceb1f9b

File tree

7 files changed

+659
-47
lines changed

7 files changed

+659
-47
lines changed

articles/container-apps/TOC.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,12 @@
7878
href: scale-app.md
7979
- name: Manage secrets
8080
href: manage-secrets.md
81-
- name: Use managed identities
82-
href: managed-identity.md
81+
- name: Managed identities
82+
items:
83+
- name: Use managed identities
84+
href: managed-identity.md
85+
- name: Azure Container Registry image pull with managed identity
86+
href: managed-identity-image-pull.md
8387
- name: Monitor an app
8488
href: monitor.md
8589
- name: Manage revisions

articles/container-apps/containers.md

Lines changed: 5 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Features include:
3333
## Configuration
3434

3535

36-
The following is an example of the `containers` array in the [`properties.template`](azure-resource-manager-api-spec.md#propertiestemplate) section of a container app resource template. The excerpt shows the available configuration options when setting up a container.
36+
The following code is an example of the `containers` array in the [`properties.template`](azure-resource-manager-api-spec.md#propertiestemplate) section of a container app resource template. The excerpt shows the available configuration options when setting up a container.
3737

3838
```json
3939
"containers": [
@@ -115,7 +115,7 @@ The following is an example of the `containers` array in the [`properties.templa
115115
| `volumeMounts` | An array of volume mount definitions. | You can define a temporary volume or multiple permanent storage volumes for your container. For more information about storage volumes, see [Use storage mounts in Azure Container Apps](storage-mounts.md).|
116116
| `probes`| An array of health probes enabled in the container. | This feature is based on Kubernetes health probes. For more information about probes settings, see [Health probes in Azure Container Apps](health-probes.md).|
117117

118-
When allocating resources, the total amount of CPUs and memory requested for all the containers in a container app must add up to one of the following combinations.
118+
The total CPU and memory allocations requested for all the containers in a container app must add up to one of the following combinations.
119119

120120
| vCPUs (cores) | Memory |
121121
|---|---|
@@ -162,7 +162,7 @@ To use a container registry, you define the required fields in `registries` arra
162162
}
163163
```
164164

165-
With the registry information set up, the saved credentials can be used to pull a container image from the private registry when your app is deployed.
165+
With the registry information added, the saved credentials can be used to pull a container image from the private registry when your app is deployed.
166166

167167
The following example shows how to configure Azure Container Registry credentials in a container app.
168168

@@ -193,17 +193,9 @@ The following example shows how to configure Azure Container Registry credential
193193
194194
### Managed identity with Azure Container Registry
195195

196-
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:
196+
You can use an Azure managed identity to authenticate with Azure Container Registry instead of using a username and password. For more information, see [Managed identities in Azure Container Apps](managed-identity.md).
197197

198-
- Assign a system-assigned or user-assigned managed identity to your container app.
199-
- Specify the managed identity you want to use for each registry.
200-
201-
> [!NOTE]
202-
> You will need to [enable an admin user account](../container-registry/container-registry-authentication.md) in your Azure
203-
> Container Registry even when you use an Azure managed identity. You will not need to use the ACR admin credentials to pull images into Azure
204-
> Container Apps, however, it is a prequisite to have the ACR admin user account enabled in the registry Azure Container Apps is pulling from.
205-
206-
When assigned a managed identity to a registry, use the managed identity resource ID for a user-assigned identity, or "system" for the system-assigned identity. For more information about using managed identities see, [Managed identities in Azure Container Apps Preview](managed-identity.md).
198+
When assigning a managed identity to a registry, use the managed identity resource ID for a user-assigned identity, or "system" for the system-assigned identity.
207199

208200
```json
209201
{
@@ -230,36 +222,9 @@ When assigned a managed identity to a registry, use the managed identity resourc
230222
}
231223
```
232224

233-
The managed identity must have `AcrPull` access for 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.md).
234-
235-
#### Configure a user-assigned managed identity
236-
237-
To configure a user-assigned managed identity:
238-
239-
1. Create the user-assigned identity if it doesn't exist.
240-
1. Give the user-assigned identity `AcrPull` permission to your private repository.
241-
1. Add the identity to your container app configuration as shown above.
242-
243225
For more information about configuring user-assigned identities, see [Add a user-assigned identity](managed-identity.md#add-a-user-assigned-identity).
244226

245227

246-
#### Configure a system-assigned managed identity
247-
248-
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.
249-
250-
To configure a system-assigned identity, you must use one of the following methods.
251-
252-
- **Option 1**: Use a public registry for the initial deployment:
253-
1. Create your container app using a public image and a system-assigned identity.
254-
1. Give the new system-assigned identity `AcrPull` access to your private Azure Container Registry.
255-
1. Update your container app replacing the public image with the image from your private Azure Container Registry.
256-
- **Option 2**: Restart your app after assigning permissions:
257-
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.)
258-
1. Give the new system-assigned identity `AcrPull` access to your private Azure Container Registry.
259-
1. Restart your container app revision.
260-
261-
For more information about configuring system-assigned identities, see [Add a system-assigned identity](managed-identity.md#add-a-system-assigned-identity).
262-
263228
## Limitations
264229

265230
Azure Container Apps has the following limitations:

0 commit comments

Comments
 (0)