Skip to content

Commit 3c34438

Browse files
committed
updating code samples and wording
1 parent 84efefe commit 3c34438

File tree

1 file changed

+16
-14
lines changed

1 file changed

+16
-14
lines changed

articles/container-apps/managed-identity.md

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ User-assigned identities are ideal for workloads that:
4646

4747
## Limitations
4848

49-
[Init containers](containers.md#init-containers) can't access managed identities in [Consumption-only environments](environment.md#types)
49+
[Init containers](containers.md#init-containers) can't access managed identities in [consumption-only environments](environment.md#types) and [dedicated workload profile environments](environment.md#types)
5050

5151
## Configure managed identities
5252

@@ -333,28 +333,30 @@ The queue storage account uses the `accountName` property to identify the storag
333333
"accountName": "mystorageaccount",
334334
"queueName": "myqueue",
335335
"queueLength": 2,
336-
"identity": "/subscriptions/580c472d-3045-4ca1-9773-f58d56ffe662/resourceGroups/myRg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity"
336+
"identity": "<IDENTITY1_RESOURCE_ID>"
337337
}
338338
}]
339339
}
340340
```
341341

342342
## Control managed identity availability
343343

344-
Container Apps allow you to specify [init containers](containers.md#init-containers) and main containers. By default, both main and init containers in a consumption workload profile environment can use managed identity to access other Azure services. Managed identity access tokens are available for every managed identity configured on the container app. However, in some situations where only the init container or the main container require access tokens for a managed identity. Other times, you may use a managed identity only to access your Azure Container Registry to pull the container image, and your application itself doesn't need to have access to your Azure Container Registry.
344+
Container Apps allow you to specify [init containers](containers.md#init-containers) and main containers. By default, both main and init containers in a consumption workload profile environment can use managed identity to access other Azure services. In consumption-only environments and dedicated workload profile environments, only main containers can use managed identity. Managed identity access tokens are available for every managed identity configured on the container app. However, in some situations only the init container or the main container require access tokens for a managed identity. Other times, you may use a managed identity only to access your Azure Container Registry to pull the container image, and your application itself doesn't need to have access to your Azure Container Registry.
345345

346346
Starting in API version `2024-02-02-preview`, you can control which managed identities are available to your container app during the init and main phases to follow the security principle of least privilege. The following options are available:
347347

348-
- `Init`: available only to init containers. Use this when you want to perform some intilization work that requires a managed identity, but you no longer need the managed identity in the main container. This option is currently not supported in [Consumption-only environments](environment.md#types)
348+
- `Init`: available only to init containers. Use this when you want to perform some intilization work that requires a managed identity, but you no longer need the managed identity in the main container. This option is currently only supported in [workload profile consumption environments](environment.md#types)
349349
- `Main`: available only to main containers. Use this if your init container does not need managed identity.
350350
- `All`: available to all containers. This is the default setting.
351-
- `None`: not available to any containers. Use this when you have a managed identity that is only used for ACR image pull or scale rules, and does not need to be available to the code running in your containers.
351+
- `None`: not available to any containers. Use this when you have a managed identity that is only used for ACR image pull, scale rules, or Key Vault secrets and does not need to be available to the code running in your containers.
352352

353-
The following example shows how to configure a workload profile consumption environment that:
353+
The following example shows how to configure a container app on a workload profile consumption environment that:
354354

355355
- Restricts the container app's system-assigned identity to main containers only.
356356
- Restricts a specific user-assigned identity to init containers only.
357-
- Uses a specific user-assigned identity for Azure Container Registry image pull without allowing the code in the containers to use that managed identity to access the registry. In this example, the containers themselves don't need to access the registry. This approach reduces the access if a malicious actor were to gain unauthorized access to the containers.
357+
- Uses a specific user-assigned identity for Azure Container Registry image pull without allowing the code in the containers to use that managed identity to access the registry. In this example, the containers themselves don't need to access the registry.
358+
359+
This approach limits the resources that can be accessed if a malicious actor were to gain unauthorized access to the containers.
358360

359361
# [ARM template](#tab/arm)
360362

@@ -364,26 +366,26 @@ The following example shows how to configure a workload profile consumption envi
364366
"identity":{
365367
"type": "SystemAssigned, UserAssigned",
366368
"userAssignedIdentities": {
367-
"/subscriptions/580c472d-3045-4ca1-9773-f58d56ffe662/resourceGroups/myRg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity":{},
368-
"/subscriptions/580c472d-3045-4ca1-9773-f58d56ffe662/resourceGroups/myRg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myAcrPullIdentity":{}
369+
"<IDENTITY1_RESOURCE_ID>":{},
370+
"<ACR_IMAGEPULL_IDENTITY_RESOURCE_ID>":{}
369371
}
370372
},
371373
"properties": {
372-
"workloadProfileName":"Consumption",
373-
"environmentId": "/subscriptions/1d7aa588-e409-456c-95c2-5b48a03ad562/resourceGroups/myRg/providers/Microsoft.App/managedEnvironments/myenv",
374+
"workloadProfileName":"Consumption",
375+
"environmentId": "<CONTAINER_APPS_ENVIRONMENT_ID>",
374376
"configuration": {
375377
"registries": [
376378
{
377379
"server": "myregistry.azurecr.io",
378-
"identity": "/subscriptions/580c472d-3045-4ca1-9773-f58d56ffe662/resourceGroups/myRg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myAcrPullIdentity"
380+
"identity": "ACR_IMAGEPULL_IDENTITY_RESOURCE_ID"
379381
}],
380382
"identitySettings":[
381383
{
382-
"identity": "/subscriptions/580c472d-3045-4ca1-9773-f58d56ffe662/resourceGroups/myRg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myAcrPullIdentity",
384+
"identity": "ACR_IMAGEPULL_IDENTITY_RESOURCE_ID",
383385
"lifecycle": "none"
384386
},
385387
{
386-
"identity": "/subscriptions/580c472d-3045-4ca1-9773-f58d56ffe662/resourceGroups/myRg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity",
388+
"identity": "<IDENTITY1_RESOURCE_ID>",
387389
"lifecycle": "init"
388390
},
389391
{

0 commit comments

Comments
 (0)