Skip to content

Commit 4ea02fd

Browse files
committed
[ACA] Address public PR 126903 re remove all user-assigned identity assignments
1 parent 32e1de6 commit 4ea02fd

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

articles/container-apps/managed-identity.md

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ author: craigshoemaker
66
ms.service: azure-container-apps
77
ms.custom: devx-track-azurecli
88
ms.topic: how-to
9-
ms.date: 10/25/2023
9+
ms.date: 05/29/2025
1010
ms.author: cshoe
1111
---
1212

@@ -487,9 +487,28 @@ To remove all user-assigned identities:
487487

488488
```azurecli
489489
az containerapp identity remove --name <APP_NAME> --resource-group <GROUP_NAME> \
490-
--user-assigned <IDENTITY1_RESOURCE_ID> <IDENTITY2_RESOURCE_ID>
490+
--user-assigned $(az containerapp show \
491+
--name <APP_NAME> \
492+
--resource-group <GROUP_NAME> \
493+
--query "identity.userAssignedIdentities | keys(@)" \
494+
--output tsv)
491495
```
492496

497+
Replace the `<PLACEHOLDERS>` with your values.
498+
499+
The command to remove all user-assigned identities works as follows.
500+
501+
| Command or argument | Description |
502+
|---|---|
503+
| `--user-assigned $(...)` | Run the command enclosed by the parentheses. Send the output to `--user-assigned`. |
504+
| `az containerapp show...` | Get information about the specified container app. |
505+
| `--query "identity.userAssignedIdentities...` | Get the user-assigned identities for the specified container app. |
506+
| `|` | The pipe operator sends the user-assigned identities to the `keys` command. |
507+
| `keys(@)` | The user-assigned identities are returned as a set of key/value pairs. Each key is the ID of a user-assigned identity. This command extracts each key. |
508+
| `--output tsv` | Output the results in tab-separated format. |
509+
510+
For more information see [How to query Azure CLI command output using a JMESPath query](/cli/azure/use-azure-cli-successfully-query).
511+
493512
# [ARM template](#tab/arm)
494513

495514
To remove all identities, set the `type` of the container app's identity to `None` in the ARM template:

0 commit comments

Comments
 (0)