You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/app-service/overview-managed-identity.md
+16-17Lines changed: 16 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@ title: Managed identities
3
3
description: Learn how managed identities work in Azure App Service and Azure Functions, how to configure a managed identity and generate a token for a back-end resource.
This article shows you how to create a managed identity for App Service and Azure Functions applications and how to use it to access other resources.
14
14
15
15
> [!IMPORTANT]
16
-
> Managed identities for App Service and Azure Functions won't behave as expected if your app is migrated across subscriptions/tenants. The app needs to obtain a new identity, which is done by [disabling](#remove) and re-enabling the feature. Downstream resources also need to have access policies updated to use the new identity.
16
+
> Because [managed identities don't support cross-directory scenarios](../active-directory/managed-identities-azure-resources/managed-identities-faq.md#can-i-use-a-managed-identity-to-access-a-resource-in-a-different-directorytenant), they won't behave as expected if your app is migrated across subscriptions or tenants. To recreate the managed identities after such a move, see [Will managed identities be recreated automatically if I move a subscription to another directory?](../active-directory/managed-identities-azure-resources/managed-identities-faq.md#will-managed-identities-be-recreated-automatically-if-i-move-a-subscription-to-another-directory). Downstream resources also need to have access policies updated to use the new identity.
17
17
18
18
> [!NOTE]
19
19
> Managed identities are not available for [apps deployed in Azure Arc](overview-arc-integration.md).
The managed identity configuration is specific to the slot. To configure a managed identity for a deployment slot in the portal, navigate to the slot first. To find the managed identity for your web app or deployment slot in your Azure Active Directory tenant from the Azure portal, search for it directly from the **Overview** page of your tenant. Usually, the slot name is similar to `<appname>/slots/<slotname>`.
23
+
The managed identity configuration is specific to the slot. To configure a managed identity for a deployment slot in the portal, navigate to the slot first. To find the managed identity for your web app or deployment slot in your Azure Active Directory tenant from the Azure portal, search for it directly from the **Overview** page of your tenant. Usually, the slot name is similar to `<app-name>/slots/<slot-name>`.
24
24
25
25
## Add a system-assigned identity
26
26
@@ -78,7 +78,7 @@ For example, a web app's template might look like the following JSON:
78
78
79
79
```json
80
80
{
81
-
"apiVersion": "2016-08-01",
81
+
"apiVersion": "2022-03-01",
82
82
"type": "Microsoft.Web/sites",
83
83
"name": "[variables('appName')]",
84
84
"location": "[resourceGroup().location]",
@@ -103,8 +103,8 @@ When the site is created, it has the following additional properties:
103
103
```json
104
104
"identity": {
105
105
"type": "SystemAssigned",
106
-
"tenantId": "<TENANTID>",
107
-
"principalId": "<PRINCIPALID>"
106
+
"tenantId": "<tenant-id>",
107
+
"principalId": "<principal-id>"
108
108
}
109
109
```
110
110
@@ -135,14 +135,13 @@ First, you'll need to create a user-assigned identity resource.
135
135
136
136
1. Select **Identity**.
137
137
138
-
1.Within the **User assigned**tab, click**Add**.
138
+
1.Select **User assigned**>**Add**.
139
139
140
-
1. Search for the identity you created earlier and select it. Click**Add**.
140
+
1. Search for the identity you created earlier, select it, and select**Add**.
141
141
142
142

143
143
144
-
> [!IMPORTANT]
145
-
> If you select **Add** after you select a user-assigned identity to add, your application will restart.
144
+
Once you select **Add**, the app restarts.
146
145
147
146
# [Azure CLI](#tab/cli)
148
147
@@ -183,13 +182,13 @@ Adding a user-assigned identity in App Service is currently not supported.
183
182
184
183
An Azure Resource Manager template can be used to automate deployment of your Azure resources. To learn more about deploying to App Service and Functions, see [Automating resource deployment in App Service](../app-service/deploy-complex-application-predictably.md) and [Automating resource deployment in Azure Functions](../azure-functions/functions-infrastructure-as-code.md).
185
184
186
-
Any resource of type `Microsoft.Web/sites` can be created with an identity by including the following block in the resource definition, replacing `<RESOURCEID>` with the resource ID of the desired identity:
185
+
Any resource of type `Microsoft.Web/sites` can be created with an identity by including the following block in the resource definition, replacing `<resource-id>` with the resource ID of the desired identity:
187
186
188
187
```json
189
188
"identity": {
190
189
"type": "UserAssigned",
191
190
"userAssignedIdentities": {
192
-
"<RESOURCEID>": {}
191
+
"<resource-id>": {}
193
192
}
194
193
}
195
194
```
@@ -203,7 +202,7 @@ For example, a web app's template might look like the following JSON:
203
202
204
203
```json
205
204
{
206
-
"apiVersion": "2016-08-01",
205
+
"apiVersion": "2022-03-01",
207
206
"type": "Microsoft.Web/sites",
208
207
"name": "[variables('appName')]",
209
208
"location": "[resourceGroup().location]",
@@ -233,9 +232,9 @@ When the site is created, it has the following additional properties:
233
232
"identity": {
234
233
"type": "UserAssigned",
235
234
"userAssignedIdentities": {
236
-
"<RESOURCEID>": {
237
-
"principalId": "<PRINCIPALID>",
238
-
"clientId": "<CLIENTID>"
235
+
"<resource-id>": {
236
+
"principalId": "<principal-id>",
237
+
"clientId": "<client-id>"
239
238
}
240
239
}
241
240
}
@@ -365,7 +364,7 @@ When you remove a system-assigned identity, it's deleted from Azure Active Direc
365
364
1. Select **Identity**. Then follow the steps based on the identity type:
366
365
367
366
-**System-assigned identity**: Within the **System assigned** tab, switch **Status** to **Off**. Click **Save**.
368
-
-**User-assigned identity**: Click the **User assigned** tab, select the checkbox for the identity, and click**Remove**. Click**Yes** to confirm.
367
+
-**User-assigned identity**: Select the **User assigned** tab, select the checkbox for the identity, and select**Remove**. Select**Yes** to confirm.
0 commit comments