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/app-service-key-vault-references.md
+6-8Lines changed: 6 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,7 +29,7 @@ To read secrets from a key vault, you first need to create a vault and give your
29
29
30
30
1. Authorize [read access to secrets in your key vault](/azure/key-vault/general/security-features#privileged-access) for the managed identity that you created. How you do it depends on the permissions model of your key vault:
31
31
32
-
-**Azure role-based access control**: Assign the **Key Vault Secrets User** role to the managed identity. For instructions, see [Provide access to Key Vault keys, certificates, and secrets with an Azure role-based access control](/azure/key-vault/general/rbac-guide).
32
+
-**Azure role-based access control**: Assign the **Key Vault Secrets User** role to the managed identity. For instructions, see [Provide access to Key Vault keys, certificates, and secrets with Azure role-based access control](/azure/key-vault/general/rbac-guide).
33
33
-**Vault access policy**: Assign the **Get** secrets permission to the managed identity. For instructions, see [Assign a Key Vault access policy](/azure/key-vault/general/assign-access-policy).
34
34
35
35
### Access network-restricted vaults
@@ -126,14 +126,12 @@ Apps can use the `WEBSITE_CONTENTAZUREFILECONNECTIONSTRING` application setting
126
126
127
127
The platform relies on having a content share within Azure Files, and it assumes a default name unless one is specified via the `WEBSITE_CONTENTSHARE` setting. For any requests that modify these settings, the platform validates if this content share exists. If the content share doesn't exist, the platform tries to create it. If the platform can't locate or create the content share, it blocks the request.
128
128
129
-
When you use Key Vault references in this setting, the validation check fails by default, because the secret itself can't be resolved while during processing of the incoming request. To avoid this problem, you can skip the validation by setting `WEBSITE_SKIP_CONTENTSHARE_VALIDATION` to `1`. This setting tells App Service to bypass all checks, and it doesn't create the content share for you. You should ensure that it's created in advance.
129
+
When you use Key Vault references in this setting, the validation check fails by default, because the secret can't be resolved during processing of the incoming request. To avoid this problem, you can skip the validation by setting `WEBSITE_SKIP_CONTENTSHARE_VALIDATION` to `1`. This setting tells App Service to bypass all checks, and it doesn't create the content share for you. You should ensure that the content share is created in advance.
130
130
131
131
> [!CAUTION]
132
-
> If you skip validation and either the connection string or the content share is invalid, the app will be unable to start properly and will only serve HTTP 500 errors.
132
+
> If you skip validation and either the connection string or the content share is invalid, the app won't start properly and will serve HTTP 500 errors.
133
133
134
-
As part of creating the app, attempted mounting of the content share could fail because managed identity permissions aren't being propagated or the virtual network integration isn't set up. You can defer setting up Azure Files until later in the deployment template to accommodate this behavior. To learn more, see [Azure Resource Manager deployment](#azure-resource-manager-deployment) later in this article.
135
-
136
-
In this case, App Service uses a default file system until Azure Files is set up, and files aren't copied over. You must ensure that no deployment attempts occur during the interim period before Azure Files is mounted.
134
+
As part of creating the app, attempted mounting of the content share could fail because managed identity permissions aren't being propagated or the virtual network integration isn't set up. You can defer setting up Azure Files until later in the deployment template to accommodate this behavior. To learn more, see [Azure Resource Manager deployment](#azure-resource-manager-deployment) later in this article. In this case, App Service uses a default file system until Azure Files is set up, and files aren't copied over. You must ensure that no deployment attempts occur during the interim period before Azure Files is mounted.
137
135
138
136
### Considerations for Application Insights instrumentation
139
137
@@ -261,14 +259,14 @@ If the syntax is correct, you can view other causes for error by checking the cu
261
259
262
260
You can also use one of the built-in detectors to get additional information.
263
261
264
-
### Use the detector for App Service
262
+
To use the detector for App Service:
265
263
266
264
1. In the portal, go to your app.
267
265
2. Select **Diagnose and solve problems**.
268
266
3. Select **Availability and Performance** > **Web app down**.
269
267
4. In the search box, search for and select **Key Vault Application Settings Diagnostics**.
Copy file name to clipboardExpand all lines: articles/app-service/configure-authentication-provider-aad.md
+27-8Lines changed: 27 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -75,7 +75,7 @@ To use an existing registration, select either:
75
75
76
76
-**Application (client) ID**.
77
77
-**Client secret (recommended)**. A secret value that the application uses to prove its identity when it requests a token. This value is saved in your app's configuration as a slot-sticky application setting named `MICROSOFT_PROVIDER_AUTHENTICATION_SECRET`. If the client secret isn't set, sign-in operations from the service use the OAuth 2.0 implicit grant flow, which we *don't* recommend.
78
-
-**Issuer URL**. This URL takes the form `<authentication-endpoint>/<tenant-id>/v2.0`. Replace `<authentication-endpoint>` with the authentication endpoint [value specific to the cloud environment](/entra/identity-platform/authentication-national-cloud#azure-ad-authentication-endpoints). For example, a workforce tenant in global Azure would use `https://sts.windows.net` as its authentication endpoint.
78
+
-**Issuer URL**. This URL takes the form `<authentication-endpoint>/<tenant-id>/v2.0`. Replace `<authentication-endpoint>` with the authentication endpoint [value that's specific to the cloud environment](/entra/identity-platform/authentication-national-cloud#azure-ad-authentication-endpoints). For example, a workforce tenant in global Azure would use `https://sts.windows.net` as its authentication endpoint.
79
79
80
80
If you need to manually create an app registration in a workforce tenant, see [Register an application with the Microsoft identity platform](/entra/identity-platform/quickstart-register-app). As you go through the registration process, be sure to note the application (client) ID and client secret values.
81
81
@@ -301,53 +301,72 @@ In prior sections, you registered your App Service or Azure Functions app to aut
301
301
302
302
### Native client application
303
303
304
-
You can register native clients to request access to your App Service app's APIs on behalf of a signed-in user.
304
+
You can register native clients to request access to your App Service app's APIs on behalf of a signed-in user:
305
305
306
306
1. On the Azure portal menu, select **Microsoft Entra ID**.
307
-
1. On the left pane, select **Manage** > **App registrations** > **New registration**.
307
+
308
+
1. On the left pane, select **Manage** > **App registrations**. Then select **New registration**.
309
+
308
310
1. On the **Register an application** pane, for **Name**, enter a name for your app registration.
311
+
309
312
1. In **Redirect URI**, select **Public client/native (mobile & desktop)** and enter the URL `<app-url>/.auth/login/aad/callback`. For example, enter `https://contoso.azurewebsites.net/.auth/login/aad/callback`.
313
+
310
314
1. Select **Register**.
315
+
311
316
1. After the app registration is created, copy the value of **Application (client) ID**.
312
317
313
318
> [!NOTE]
314
319
> For a Microsoft Store application, use the [package SID](/previous-versions/azure/app-service-mobile/app-service-mobile-dotnet-how-to-use-client-library#package-sid) as the URI instead.
315
320
316
321
1. On the left pane, select **Manage** > **API permissions**. Then select **Add a permission** > **My APIs**.
322
+
317
323
1. Select the app registration that you created earlier for your App Service app. If you don't see the app registration, be sure to add the **user_impersonation** scope in the app registration.
324
+
318
325
1. Under **Delegated permissions**, select **user_impersonation**, and then select **Add permissions**.
319
326
320
-
You configured a native client application that can request access your App Service app on behalf of a user.
327
+
You've now configured a native client application that can request access your App Service app on behalf of a user.
In an N-tier architecture, your client application can acquire a token to call an App Service or Azure Functions app on behalf of the client app itself, not on behalf of a user. This scenario is useful for non-interactive daemon applications that perform tasks without a logged-in user. It uses the standard OAuth 2.0 client credentials grant. For more information, see [Microsoft identity platform and the OAuth 2.0 client credentials flow](../active-directory/develop/v2-oauth2-client-creds-grant-flow.md).
325
332
326
333
1. On the Azure portal menu, select **Microsoft Entra ID**.
327
-
1. On the left pane, select **Manage** > **App registrations** > **New registration**.
334
+
335
+
1. On the left pane, select **Manage** > **App registrations**. Then select **New registration**.
336
+
328
337
1. On the **Register an application** pane, for **Name**, enter a name for your app registration.
338
+
329
339
1. For a daemon application, you don't need a redirect URI, so you can keep the **Redirect URI** box empty.
340
+
330
341
1. Select **Register**.
342
+
331
343
1. After the app registration is created, copy the value of **Application (client) ID**.
344
+
332
345
1. On the left pane, select **Manage** > **Certificates & secrets**. Then select **Client secrets** > **New client secret**.
346
+
333
347
1. Enter a description and expiration, and then select **Add**.
348
+
334
349
1. In the **Value** field, copy the client secret value. After you move away from this page, it doesn't appear again.
335
350
336
351
You can now [request an access token by using the client ID and client secret](../active-directory/develop/v2-oauth2-client-creds-grant-flow.md#first-case-access-token-request-with-a-shared-secret). Set the `resource` parameter to the **Application ID URI** value of the target app. The resulting access token can then be presented to the target app via the standard [OAuth 2.0 Authorization header](../active-directory/develop/v2-oauth2-client-creds-grant-flow.md#use-a-token). App Service authentication validates and uses the token to indicate that the caller is authenticated. In this case, the caller is an application, not a user.
337
352
338
-
This approach allows *any* client application in your Microsoft Entra tenant to request an access token and authenticate to the target app. If you also want to enforce *authorization* to allow only certain client applications, you must perform extra configuration.
353
+
This approach allows *any* client application in your Microsoft Entra tenant to request an access token and authenticate to the target app. If you also want to enforce authorization to allow only certain client applications, you must perform extra configuration.
339
354
340
355
1.[Define an app role](../active-directory/develop/howto-add-app-roles-in-azure-ad-apps.md) in the manifest of the app registration that represents the App Service or Azure Functions app that you want to protect.
356
+
341
357
1. On the app registration that represents the client that needs to be authorized, select **API permissions** > **Add a permission** > **My APIs**.
358
+
342
359
1. Select the app registration that you created earlier. If you don't see the app registration, make sure that you [added an app role](../active-directory/develop/howto-add-app-roles-in-azure-ad-apps.md).
360
+
343
361
1. Under **Application permissions**, select the app role that you created earlier. Then select **Add permissions**.
362
+
344
363
1. Select **Grant admin consent** to authorize the client application to request the permission.
345
364
346
365
Similar to the previous scenario (before you added any roles), you can now [request an access token](../active-directory/develop/v2-oauth2-client-creds-grant-flow.md#first-case-access-token-request-with-a-shared-secret) for the same target resource. The access token includes a `roles` claim that contains the app roles that were authorized for the client application.
347
366
348
367
Within the target App Service or Azure Functions app code, you can now validate that the token has the expected roles. App Service authentication doesn't perform this validation. For more information, see [Access user claims in app code](configure-authentication-user-identities.md#access-user-claims-in-app-code).
349
368
350
-
You've configured a daemon client application that can access your App Service app by using its own identity.
369
+
You've now configured a daemon client application that can access your App Service app by using its own identity.
351
370
352
371
## Best practices
353
372
@@ -379,7 +398,7 @@ With these changes, when App Service authentication tries to sign in, it no long
0 commit comments