Skip to content

Commit 18ccadf

Browse files
committed
https://github.com/MicrosoftDocs/azure-docs/issues/43368
1 parent b952ca5 commit 18ccadf

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

articles/app-service/app-service-web-tutorial-connect-msi.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,9 @@ GO
236236

237237
Type `EXIT` to return to the Cloud Shell prompt.
238238

239+
> [!NOTE]
240+
> The back-end services of managed identities also [maintains a token cache](overview-managed-identity.md#obtain-tokens-for-azure-resources) that updates the token for a target resource only when it expires. If you make a mistake configuring your SQL Database permissions and try to modify the permissions *after* trying to get a token with your app, you don't actually get a new token with the updated permissions until the cached token expires.
241+
239242
### Modify connection string
240243

241244
Remember that the same changes you made in *Web.config* or *appsettings.json* works with the managed identity, so the only thing to do is to remove the existing connection string in App Service, which Visual Studio created deploying your app the first time. Use the following command, but replace *\<app-name>* with the name of your app.

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

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Your application can be granted two types of identities:
2121
- A **system-assigned identity** is tied to your application and is deleted if your app is deleted. An app can only have one system-assigned identity.
2222
- A **user-assigned identity** is a standalone Azure resource which can be assigned to your app. An app can have multiple user-assigned identities.
2323

24-
## Adding a system-assigned identity
24+
## Add a system-assigned identity
2525

2626
Creating an app with a system-assigned identity requires an additional property to be set on the application.
2727

@@ -146,7 +146,7 @@ When the site is created, it has the following additional properties:
146146
Where `<TENANTID>` and `<PRINCIPALID>` are replaced with GUIDs. The tenantId property identifies what AAD tenant the identity belongs to. The principalId is a unique identifier for the application's new identity. Within AAD, the service principal has the same name that you gave to your App Service or Azure Functions instance.
147147

148148

149-
## Adding a user-assigned identity
149+
## Add a user-assigned identity
150150

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

@@ -230,12 +230,14 @@ When the site is created, it has the following additional properties:
230230
Where `<PRINCIPALID>` and `<CLIENTID>` are replaced with GUIDs. The principalId is a unique identifier for the identity which is used for AAD administration. The clientId is a unique identifier for the application's new identity that is used for specifying which identity to use during runtime calls.
231231

232232

233-
## Obtaining tokens for Azure resources
233+
## Obtain tokens for Azure resources
234234

235235
An app can use its managed identity to get tokens to access other resources protected by AAD, such as Azure Key Vault. These tokens represent the application accessing the resource, and not any specific user of the application.
236236

237+
You may need to configure the target resource to allow access from your application. For example, if you request a token to access Key Vault, you need to make sure you have added an access policy that includes your application's identity. Otherwise, your calls to Key Vault will be rejected, even if they include the token. To learn more about which resources support Azure Active Directory tokens, see [Azure services that support Azure AD authentication](../active-directory/managed-identities-azure-resources/services-support-managed-identities.md#azure-services-that-support-azure-ad-authentication).
238+
237239
> [!IMPORTANT]
238-
> You may need to configure the target resource to allow access from your application. For example, if you request a token to access Key Vault, you need to make sure you have added an access policy that includes your application's identity. Otherwise, your calls to Key Vault will be rejected, even if they include the token. To learn more about which resources support Azure Active Directory tokens, see [Azure services that support Azure AD authentication](../active-directory/managed-identities-azure-resources/services-support-managed-identities.md#azure-services-that-support-azure-ad-authentication).
240+
> The back-end services for managed identities maintain a cache per resource URI for around 8 hours. If you update the access policy of a particular target resource and immediately retrieve a token for that resource, you may continue to get a cached token with outdated permissions until that token expires. There's currently no way to force a token refresh.
239241
240242
There is a simple REST protocol for obtaining a token in App Service and Azure Functions. This can be used for all applications and languages. For .NET and Java, the Azure SDK provides an abstraction over this protocol and facilitates a local development experience.
241243

@@ -408,7 +410,7 @@ For Java applications and functions, the simplest way to work with a managed ide
408410
```
409411

410412

411-
## <a name="remove"></a>Removing an identity
413+
## <a name="remove"></a>Remove an identity
412414

413415
A system-assigned identity can be removed by disabling the feature using the portal, PowerShell, or CLI in the same way that it was created. User-assigned identities can be removed individually. To remove all identities, in the REST/ARM template protocol, this is done by setting the type to "None":
414416

0 commit comments

Comments
 (0)