Skip to content

Commit 4b2b9a0

Browse files
committed
fixes
1 parent 0892a62 commit 4b2b9a0

File tree

1 file changed

+18
-22
lines changed

1 file changed

+18
-22
lines changed

docs/azure/sdk/authentication/user-assigned-managed-identity.md

Lines changed: 18 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ The recommended approach to authenticate an Azure-hosted app to other Azure reso
1919

2020
## Create a user-assigned managed identity
2121

22-
User-assigned identities are created as standalone resources in your Azure subscription. You can create them using the Azure portal or the Azure CLI.
22+
User-assigned identities are created as standalone resources in your Azure subscription. You can create them using the Azure portal or the Azure CLI. Azure CLI commands can be run in the [Azure Cloud Shell](https://shell.azure.com) or on a workstation with the [Azure CLI installed](/cli/azure/install-azure-cli).
2323

2424
### [Azure portal](#tab/azure-portal)
2525

@@ -30,30 +30,29 @@ User-assigned identities are created as standalone resources in your Azure subsc
3030

3131
1. On the **Create User Assigned Managed Identity** page, select a subscription, resource group, and region for the user-assigned identity, and then provide a name.
3232
1. Select **Review + create** to review and validate your inputs.
33-
1. Select **Create** to create the user-assigned identity.
3433

3534
:::image type="content" source="../media/user-assigned-identity-form.png" alt-text="A screenshot showing the form to create a user-assigned identity.":::
3635

36+
1. Select **Create** to create the user-assigned identity.
3737
1. After the identity is created, select **Go to resource**.
3838
1. On the new identity's **Overview** page, copy the `Client ID` value to use for later when you configure the application code.
3939

4040
### [Azure CLI](#tab/azure-cli)
4141

42-
Azure CLI commands can be run in the [Azure Cloud Shell](https://shell.azure.com) or on a workstation with the [Azure CLI installed](/cli/azure/install-azure-cli).
43-
44-
Use the Azure CLI command [`az identity create`](/cli/azure/identity?view=azure-cli-latest#az-identity-create) to create a managed identity for an Azure resource:
42+
Use the Azure CLI command [`az identity create`](/cli/azure/identity?view=azure-cli-latest#az-identity-create) to create a managed identity:
4543

4644
```azurecli
4745
az identity create --resource-group <resource-group-name> --name <identity-name>
4846
```
4947

5048
The command output prints the following values:
51-
- **ClientID**: Used to configure application code that uses the identity.
52-
- **Location**: The Azure region that contains the identity.
53-
- **Name**: The name of the identity.
54-
- **PrincipalId**: Used for access control and role assignments in Azure.
55-
- **ResourceGroup**: The resource group that contains the identity.
56-
- **TenantId**: The Microsoft Entra tenant that contains the identity.
49+
50+
- **ClientID**: Used to configure application code that uses the identity.
51+
- **Location**: The Azure region that contains the identity.
52+
- **Name**: The name of the identity.
53+
- **PrincipalId**: Used for access control and role assignments in Azure.
54+
- **ResourceGroup**: The resource group that contains the identity.
55+
- **TenantId**: The Microsoft Entra tenant that contains the identity.
5756

5857
---
5958

@@ -63,25 +62,22 @@ A user-assigned can be associated with one or more Azure resources. All of the r
6362

6463
### [Azure portal](#tab/azure-portal)
6564

66-
1. In the Azure portal, navigate to the resource that hosts your application code, such as an Azure App Service or Azure Container App instance.
65+
1. In the Azure portal, navigate to the resource that hosts your app code, such as an Azure App Service or Azure Container App instance.
6766
1. From the resource's **Overview** page, expand **Settings** and select **Identity** from the navigation.
6867
1. On the **Identity** page, switch to the **User assigned** tab.
6968
1. Select **+ Add** to open the **Add user assigned managed identity** panel.
7069
1. On the **Add user assigned managed identity** panel, use the **Subscription** dropdown to filter the search results for your identities. Use the **Select** search box to locate the user-assigned managed identity you enabled for the Azure resource hosting your app.
70+
1. Select the identity and choose **Add** at the bottom of the panel to continue.
7171

72-
:::image type="content" source="../media/add-user-assigned-identity-to-app.png" alt-text="A screenshot showing the form to create a user-assigned identity.":::
73-
74-
1. Select the identity and choose **Select** at the bottom of the panel to continue.
75-
1. Select **Review + assign** at the bottom of the page.
76-
1. On the final **Review + assign** tab, select **Review + assign** to complete the workflow.
72+
:::image type="content" source="../media/add-user-assigned-identity-to-app.png" alt-text="A screenshot showing how to associate a user-assigned identity with an app.":::
7773

7874
### [Azure CLI](#tab/azure-cli)
7975

8076
The Azure CLI provides different commands to assign a user-assigned identity to different types of hosting services.
8177

82-
To assign a user-assigned identity to an Azure App Service web app using the Azure CLI, you'll need the resource ID of the identity. Use the `az identity show` command to retrieve the resource ID:
78+
To assign a user-assigned identity to an Azure App Service web app using the Azure CLI, you'll need the resource ID of the identity. Use the [`az identity show`](/cli/azure/identity?view=azure-cli-latest#az-identity-show) command to retrieve the resource ID:
8379

84-
```dotnetcli
80+
```azurecli
8581
az identity show -n cli-identity -g aitesting -o json --query id
8682
```
8783

@@ -105,7 +101,7 @@ az webapp identity assign \
105101
--identities <user-assigned-identity-resource-id>
106102
```
107103

108-
For Azure Container Apps, use the Azure CLI command [`az vm identity assign`](/cli/azure/vm/identity?view=azure-cli-latest#az-vm-identity-assign):
104+
For Azure Virtual Machines, use the Azure CLI command [`az vm identity assign`](/cli/azure/vm/identity?view=azure-cli-latest#az-vm-identity-assign):
109105

110106
```azurecli
111107
az vm identity assign \
@@ -150,7 +146,7 @@ The following example shows how to assign roles at the resource group scope, sin
150146

151147
To assign a user-assigned identity to an Azure App Service web app using the Azure CLI, you'll need the principal ID of the identity. Use the `az identity show` command to retrieve the resource ID:
152148

153-
```dotnetcli
149+
```azurecli
154150
az identity show \
155151
--resource-group <your-resource-group> \
156152
--name <your-managed-identity-name> \
@@ -166,7 +162,7 @@ az role assignment create \
166162
--scope <scope>
167163
```
168164

169-
To get the role names to which a service principal can be assigned, use the [az role definition list](/cli/azure/role/definition#az-role-definition-list) command:
165+
To explore which roles a managed identity can be assigned, use the [az role definition list](/cli/azure/role/definition#az-role-definition-list) command:
170166

171167
```azurecli
172168
az role definition list \

0 commit comments

Comments
 (0)