Skip to content

Commit 146c7dc

Browse files
authored
Merge pull request #295084 from MicrosoftDocs/main
2/21 11:00 AM IST Publish
2 parents 1c257ad + 155720e commit 146c7dc

19 files changed

+886
-773
lines changed

articles/app-service/overview-managed-identity.md

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,23 @@ This video shows you how to use managed identities for App Service.
3131
3232
The steps in the video are also described in the following sections.
3333

34+
## Prerequisites
35+
36+
To perform the steps covered in this document, you must have a minimum set of permissions over your Azure resources. The specific permissions set you need will vary based on your scenario. The most common scenarios are summarized in the following table:
37+
38+
| Scenario | Required permission | Example built-in roles |
39+
|-|-|-|
40+
| [Create a system-assigned identity for your app](#add-a-system-assigned-identity) | `Microsoft.Web/sites/write` over the app (or `Microsoft.Web/sites/slots/write` over the slot) | [Website Contributor] |
41+
| [Create a user-assigned identity][create-user-assigned] | `Microsoft.ManagedIdentity/userAssignedIdentities/write` over the resource group in which the identity will be created | [Managed Identity Contributor] |
42+
| [Assign a user-assigned identity to your app](#add-a-user-assigned-identity) | `Microsoft.Web/sites/write` over the app (or `Microsoft.Web/sites/slots/write` over the slot),<br/>`Microsoft.ManagedIdentity/userAssignedIdentities/*/assign/action` over the identity | [Website Contributor] and [Managed Identity Operator] |
43+
| [Create Azure role assignments][role-assignment] | `Microsoft.Authorization/roleAssignments/write` (over the target resource scope) | [Role Based Access Control Administrator] or [User Access Administrator] |
44+
45+
A different set of permissions might be needed for other scenarios.
46+
3447
## Add a system-assigned identity
3548

49+
To enable a system-assigned managed identity on your app or slot, you need write permissions over that app or slot. The [Website Contributor] role provides these permissions.
50+
3651
# [Azure portal](#tab/portal)
3752

3853
1. Access your app's settings in the [Azure portal](https://portal.azure.com) under the **Settings** group in the left navigation pane.
@@ -135,11 +150,13 @@ If you need to reference these properties in a later stage in the template, you
135150

136151
Creating an app with a user-assigned identity requires that you create the identity and then add its resource identifier to your app config.
137152

153+
To assign a user-assigned managed identity to your app or slot, you need write permissions over that app or slot. The [Website Contributor] role provides these permissions. You must also have permission to assign the user-assigned managed identity you will be using. The [Managed Identity Operator] role provides these permissions.
154+
138155
# [Azure portal](#tab/portal)
139156

140157
First, you'll need to create a user-assigned identity resource.
141158

142-
1. Create a user-assigned managed identity resource according to [these instructions](../active-directory/managed-identities-azure-resources/how-to-manage-ua-identity-portal.md#create-a-user-assigned-managed-identity).
159+
1. Create a user-assigned managed identity resource according to [these instructions][create-user-assigned].
143160

144161
1. In the left navigation for your app's page, scroll down to the **Settings** group.
145162

@@ -256,10 +273,12 @@ The principalId is a unique identifier for the identity that's used for Microsof
256273

257274
## Configure target resource
258275

259-
You may need to configure the target resource to allow access from your app or function. For example, if you [request a token](#connect-to-azure-services-in-app-code) to access Key Vault, you must also add an access policy that includes the managed identity of your app or function. Otherwise, your calls to Key Vault will be rejected, even if you use a valid token. The same is true for Azure SQL Database. To learn more about which resources support Microsoft Entra tokens, see [Azure services that support Microsoft Entra authentication](../active-directory/managed-identities-azure-resources/services-support-managed-identities.md#azure-services-that-support-azure-ad-authentication).
276+
You need to configure the target resource to allow access from your app. For most Azure services, you do this by [creating a role assignment][role-assignment]. Some services use mechanisms other than Azure RBAC. Refer to the documentation for each target resource to understand how to configure access using an identity. To learn more about which resources support Microsoft Entra tokens, see [Azure services that support Microsoft Entra authentication](../active-directory/managed-identities-azure-resources/services-support-managed-identities.md#azure-services-that-support-azure-ad-authentication).
277+
278+
For example, if you [request a token](#connect-to-azure-services-in-app-code) to access a secret in Key Vault, you must also create a role assignment that allows the managed identity to work with secrets in the target vault. Otherwise, your calls to Key Vault will be rejected, even if you use a valid token. The same is true for Azure SQL Database and other services.
260279

261280
> [!IMPORTANT]
262-
> The back-end services for managed identities maintain a cache per resource URI for around 24 hours. This means that it can take several hours for changes to a managed identity's group or role membership to take effect. Today, it is not possible to force a managed identity's token to be refreshed before its expiry. If you change a managed identity’s group or role membership to add or remove permissions, you may therefore need to wait several hours for the Azure resource using the identity to have the correct access. For alternatives to groups or role memberships, see [Limitation of using managed identities for authorization](/entra/identity/managed-identities-azure-resources/managed-identity-best-practice-recommendations).
281+
> The back-end services for managed identities maintain a cache per resource URI for around 24 hours. This means that it can take several hours for changes to a managed identity's group or role membership to take effect. Today, it is not possible to force a managed identity's token to be refreshed before its expiry. If you change a managed identity’s group or role membership to add or remove permissions, you may therefore need to wait several hours for the Azure resource using the identity to have the correct access. For alternatives to groups or role memberships, see [Limitation of using managed identities for authorization](/entra/identity/managed-identities-azure-resources/managed-identity-best-practice-recommendations#limitation-of-using-managed-identities-for-authorization).
263282
264283
## Connect to Azure services in app code
265284

@@ -363,10 +382,13 @@ $accessToken = $tokenResponse.access_token
363382
-----
364383

365384
For more information on the REST endpoint, see [REST endpoint reference](#rest-endpoint-reference).
385+
366386
## <a name="remove"></a>Remove an identity
367387

368388
When you remove a system-assigned identity, it's deleted from Microsoft Entra ID. System-assigned identities are also automatically removed from Microsoft Entra ID when you delete the app resource itself.
369389

390+
To remove a managed identity from your app or slot, you need write permissions over that app or slot. The [Website Contributor] role provides these permissions.
391+
370392
# [Azure portal](#tab/portal)
371393

372394
1. In the left navigation of your app's page, scroll down to the **Settings** group.
@@ -453,3 +475,11 @@ The **IDENTITY_ENDPOINT** is a local URL from which your app can request tokens.
453475
- [Access Azure Storage securely using a managed identity](scenario-secure-app-access-storage.md)
454476
- [Call Microsoft Graph securely using a managed identity](scenario-secure-app-access-microsoft-graph-as-app.md)
455477
- [Connect securely to services with Key Vault secrets](tutorial-connect-msi-key-vault.md)
478+
479+
[create-user-assigned]: /entra/identity/managed-identities-azure-resources/how-manage-user-assigned-managed-identities#create-a-user-assigned-managed-identity
480+
[role-assignment]: ../role-based-access-control/role-assignments-steps.md
481+
[Managed Identity Contributor]: ../role-based-access-control/built-in-roles/identity.md#managed-identity-contributor
482+
[Managed Identity Operator]: ../role-based-access-control/built-in-roles/identity.md#managed-identity-operator
483+
[Website Contributor]: ../role-based-access-control/built-in-roles/web-and-mobile.md#website-contributor
484+
[Role Based Access Control Administrator]: ../role-based-access-control/built-in-roles/privileged.md#role-based-access-control-administrator
485+
[User Access Administrator]: ../role-based-access-control/built-in-roles/privileged.md#user-access-administrator

articles/application-gateway/toc.yml

Lines changed: 102 additions & 107 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,14 @@
11
- name: Application Gateway documentation
22
href: index.yml
3-
- name: Overview
3+
- name: Get started
4+
expanded: true
45
items:
5-
- name: About application gateways
6+
- name: Application Gateway overview
67
href: overview.md
78
- name: Application Gateway v2
89
href: overview-v2.md
910
- name: Application Gateway for Containers
1011
href: ./for-containers/overview.md
11-
- name: Well-Architected review of Application Gateway
12-
href: /azure/architecture/framework/services/networking/azure-application-gateway?toc=/azure/application-gateway/toc.json&bc=/azure/application-gateway/breadcrumb/toc.json
13-
- name: Quickstarts
14-
expanded: true
15-
items:
1612
- name: Create Application Gateway - Portal
1713
href: quick-create-portal.md
1814
- name: Create Application Gateway - PowerShell
@@ -27,26 +23,10 @@
2723
href: quick-create-template.md
2824
- name: Create Application Gateway - Terraform
2925
href: quick-create-terraform.md
30-
- name: Tutorials
31-
items:
32-
- name: Secure with SSL
33-
href: create-ssl-portal.md
34-
- name: Host multiple sites
35-
href: create-multiple-sites-portal.md
36-
- name: Route by URL
37-
href: create-url-route-portal.md
38-
- name: Redirect web traffic
39-
href: tutorial-url-redirect-cli.md
40-
- name: Autoscaling and zone redundant
41-
href: tutorial-autoscale-ps.md
42-
- name: Ingress Controller add-on for AKS (Greenfield)
43-
href: tutorial-ingress-controller-add-on-new.md
44-
- name: Ingress Controller add-on for AKS (Brownfield)
45-
href: tutorial-ingress-controller-add-on-existing.md
46-
- name: Deploy Application Gateway with DDoS protection
47-
href: tutorial-protect-application-gateway.md
48-
- name: Concepts
26+
- name: Design
4927
items:
28+
- name: Well-Architected review of Application Gateway
29+
href: /azure/architecture/framework/services/networking/azure-application-gateway?toc=/azure/application-gateway/toc.json&bc=/azure/application-gateway/breadcrumb/toc.json
5030
- name: Basics
5131
items:
5232
- name: Application Gateway features
@@ -55,20 +35,20 @@
5535
href: how-application-gateway-works.md
5636
- name: Application Gateway components
5737
href: application-gateway-components.md
58-
- name: Configuration
59-
items:
60-
- name: Overview
61-
href: configuration-overview.md
62-
- name: Infrastructure
63-
href: configuration-infrastructure.md
64-
- name: Frontend IP address
65-
href: configuration-frontend-ip.md
66-
- name: Listeners
67-
href: configuration-listeners.md
68-
- name: Request routing rules
69-
href: configuration-request-routing-rules.md
70-
- name: HTTP settings
71-
href: configuration-http-settings.md
38+
- name: Configuration
39+
items:
40+
- name: Overview
41+
href: configuration-overview.md
42+
- name: Infrastructure
43+
href: configuration-infrastructure.md
44+
- name: Frontend IP address
45+
href: configuration-frontend-ip.md
46+
- name: Listeners
47+
href: configuration-listeners.md
48+
- name: Request routing rules
49+
href: configuration-request-routing-rules.md
50+
- name: HTTP settings
51+
href: configuration-http-settings.md
7252
- name: Routing
7353
items:
7454
- name: Multi-site hosting
@@ -79,38 +59,7 @@
7959
href: redirect-overview.md
8060
- name: Rewrite HTTP headers and URL
8161
href: rewrite-http-headers-url.md
82-
- name: Security
83-
items:
84-
- name: Security baseline
85-
href: /security/benchmark/azure/baselines/application-gateway-security-baseline?toc=/azure/application-gateway/toc.json
86-
- name: Private Deployment
87-
href: application-gateway-private-deployment.md
88-
- name: Private Link
89-
href: private-link.md
90-
- name: SSL
91-
items:
92-
- name: SSL termination and end to end SSL
93-
href: ssl-overview.md
94-
- name: SSL policy overview
95-
href: application-gateway-ssl-policy-overview.md
96-
- name: Mutual authentication
97-
href: mutual-authentication-overview.md
98-
- name: Using Key Vault
99-
href: key-vault-certs.md
100-
- name: SSL certificate management
101-
href: ssl-certificate-management.md
102-
- name: Health monitoring
103-
items:
104-
- name: Monitor Application Gateway
105-
href: monitor-application-gateway.md
106-
- name: Health probe
107-
href: application-gateway-probe-overview.md
108-
- name: Backend health
109-
href: application-gateway-backend-health.md
110-
- name: Diagnostic logs
111-
href: application-gateway-diagnostics.md
112-
- name: Metrics
113-
href: application-gateway-metrics.md
62+
11463
- name: TCP/TLS proxy
11564
href: tcp-tls-proxy-overview.md
11665
- name: Support for working remotely
@@ -127,8 +76,38 @@
12776
href: understanding-pricing.md
12877
- name: FAQ
12978
href: application-gateway-faq.yml
130-
- name: How-to guides
79+
- name: Security
80+
items:
81+
- name: Private Deployment
82+
href: application-gateway-private-deployment.md
83+
- name: Private Link
84+
href: private-link.md
85+
- name: Secure with SSL
86+
href: create-ssl-portal.md
87+
- name: SSL termination and end to end SSL
88+
href: ssl-overview.md
89+
- name: SSL policy overview
90+
href: application-gateway-ssl-policy-overview.md
91+
- name: Mutual authentication
92+
href: mutual-authentication-overview.md
93+
- name: Using Key Vault
94+
href: key-vault-certs.md
95+
- name: SSL certificate management
96+
href: ssl-certificate-management.md
97+
- name: Security baseline
98+
href: /security/benchmark/azure/baselines/application-gateway-security-baseline?toc=/azure/application-gateway/toc.json
99+
- name: Deploy
131100
items:
101+
- name: Host multiple sites
102+
href: create-multiple-sites-portal.md
103+
- name: Route by URL
104+
href: create-url-route-portal.md
105+
- name: Redirect web traffic
106+
href: tutorial-url-redirect-cli.md
107+
- name: Autoscaling and zone redundant
108+
href: tutorial-autoscale-ps.md
109+
- name: Deploy Application Gateway with DDoS protection
110+
href: tutorial-protect-application-gateway.md
132111
- name: Configure TCP/TLS proxy
133112
items:
134113
- name: Azure portal
@@ -187,10 +166,14 @@
187166
href: application-gateway-configure-listener-specific-ssl-policy.md
188167
- name: Ingress for AKS
189168
items:
190-
- name: Ingress for AKS via Helm (Brownfield)
191-
href: ingress-controller-install-existing.md
192169
- name: Ingress for AKS via Helm (Greenfield)
193170
href: ingress-controller-install-new.md
171+
- name: Ingress Controller add-on for AKS (Greenfield)
172+
href: tutorial-ingress-controller-add-on-new.md
173+
- name: Ingress for AKS via Helm (Brownfield)
174+
href: ingress-controller-install-existing.md
175+
- name: Ingress Controller add-on for AKS (Brownfield)
176+
href: tutorial-ingress-controller-add-on-existing.md
194177
- name: Migrate from Helm deployment to AKS add-on
195178
href: ingress-controller-migration.md
196179
- name: Disable and re-enable AKS Ingress Controller add-on
@@ -301,50 +284,62 @@
301284
href: ../operational-excellence/relocation-app-gateway.md?toc=/azure/application-gateway/toc.json
302285
- name: Migrate to availability zone support
303286
href: ../reliability/migrate-app-gateway-v2.md?toc=/azure/application-gateway/toc.json
304-
- name: Troubleshoot
305-
items:
306-
- name: ILB with an App Service Environment
307-
href: create-gateway-internal-load-balancer-app-service-environment.md
308-
- name: App service issues
309-
href: troubleshoot-app-service-redirection-app-service-url.md
310-
- name: Session affinity issues
311-
href: how-to-troubleshoot-application-gateway-session-affinity-issues.md
312-
- name: Bad Gateway (502) errors
313-
href: application-gateway-troubleshooting-502.md
314-
- name: HTTP response codes
315-
href: http-response-codes.md
316-
- name: Mutual authentication
317-
href: mutual-authentication-troubleshooting.md
318-
- name: Ingress for AKS
319-
href: ingress-controller-troubleshoot.md
320-
- name: Resource Health
321-
href: resource-health-overview.md
322-
- name: Use Log Analytics
323-
href: log-analytics.md
324-
- name: Backend health issues
325-
href: application-gateway-backend-health-troubleshooting.md
326-
- name: Key Vault errors
327-
href: application-gateway-key-vault-common-errors.md
328-
- name: Disabled listeners
329-
href: disabled-listeners.md
330287
- name: Proxy buffer configuration
331288
href: proxy-buffers.md
332289
- name: Custom error pages
333290
href: custom-error.md
334291
- name: Migrate to v2 SKU
335292
items:
336-
- name: About v1 retirement
337-
href: v1-retirement.md
338-
- name: Migrate from v1 to v2
339-
href: migrate-v1-v2.md
340-
- name: FAQ
341-
href: retirement-faq.md
293+
- name: About v1 retirement
294+
href: v1-retirement.md
295+
- name: Migrate from v1 to v2
296+
href: migrate-v1-v2.md
297+
- name: Migration FAQ
298+
href: retirement-faq.md
342299
- name: Configure alerts
343300
href: configure-alerts-with-templates.md
344301
- name: Classic to Resource Manager
345302
href: classic-to-resource-manager.md
346303
- name: Configure Private Link
347304
href: private-link-configure.md
305+
- name: Health monitoring
306+
items:
307+
- name: Monitor Application Gateway
308+
href: monitor-application-gateway.md
309+
- name: Health probe
310+
href: application-gateway-probe-overview.md
311+
- name: Backend health
312+
href: application-gateway-backend-health.md
313+
- name: Diagnostic logs
314+
href: application-gateway-diagnostics.md
315+
- name: Metrics
316+
href: application-gateway-metrics.md
317+
- name: Troubleshoot
318+
items:
319+
- name: ILB with an App Service Environment
320+
href: create-gateway-internal-load-balancer-app-service-environment.md
321+
- name: App service issues
322+
href: troubleshoot-app-service-redirection-app-service-url.md
323+
- name: Session affinity issues
324+
href: how-to-troubleshoot-application-gateway-session-affinity-issues.md
325+
- name: Bad Gateway (502) errors
326+
href: application-gateway-troubleshooting-502.md
327+
- name: HTTP response codes
328+
href: http-response-codes.md
329+
- name: Mutual authentication
330+
href: mutual-authentication-troubleshooting.md
331+
- name: Ingress for AKS
332+
href: ingress-controller-troubleshoot.md
333+
- name: Resource Health
334+
href: resource-health-overview.md
335+
- name: Use Log Analytics
336+
href: log-analytics.md
337+
- name: Backend health issues
338+
href: application-gateway-backend-health-troubleshooting.md
339+
- name: Key Vault errors
340+
href: application-gateway-key-vault-common-errors.md
341+
- name: Disabled listeners
342+
href: disabled-listeners.md
348343
- name: Reference
349344
items:
350345
- name: Monitoring data reference

0 commit comments

Comments
 (0)