Skip to content

Commit bc8efa9

Browse files
authored
Merge pull request #85583 from mattchenderson/msi-lu-ga
Updating Managed Identity Topics for GA releases
2 parents 8e61109 + b8ea05c commit bc8efa9

File tree

1 file changed

+24
-14
lines changed

1 file changed

+24
-14
lines changed

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

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,22 @@ ms.service: app-service
1010
ms.tgt_pltfrm: na
1111
ms.devlang: multiple
1212
ms.topic: article
13-
ms.date: 11/20/2018
13+
ms.date: 08/15/2019
1414
ms.author: mahender
1515
ms.reviewer: yevbronsh
1616

1717
---
1818

1919
# How to use managed identities for App Service and Azure Functions
2020

21-
> [!NOTE]
22-
> Managed identity support for App Service on Linux and Web App for Containers is currently in preview.
23-
2421
> [!Important]
2522
> Managed identities for App Service and Azure Functions will not behave as expected if your app is migrated across subscriptions/tenants. The app will need to obtain a new identity, which can be done by disabling and re-enabling the feature. See [Removing an identity](#remove) below. Downstream resources will also need to have access policies updated to use the new identity.
2623
2724
This topic shows you how to create a managed identity for App Service and Azure Functions applications and how to use it to access other resources. A managed identity from Azure Active Directory allows your app to easily access other AAD-protected resources such as Azure Key Vault. The identity is managed by the Azure platform and does not require you to provision or rotate any secrets. For more about managed identities in AAD, see [Managed identities for Azure resources](../active-directory/managed-identities-azure-resources/overview.md).
2825

2926
Your application can be granted two types of identities:
30-
- 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. System-assigned identity support is generally available for Windows apps.
31-
- A **user-assigned identity** is a standalone Azure resource which can be assigned to your app. An app can have multiple user-assigned identities. User-assigned identity support is in preview for all app types.
27+
- 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.
28+
- A **user-assigned identity** is a standalone Azure resource which can be assigned to your app. An app can have multiple user-assigned identities.
3229

3330
## Adding a system-assigned identity
3431

@@ -155,18 +152,12 @@ When the site is created, it has the following additional properties:
155152
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.
156153

157154

158-
## Adding a user-assigned identity (preview)
159-
160-
> [!NOTE]
161-
> User-assigned identities are currently in preview. Sovereign clouds are not yet supported.
155+
## Adding a user-assigned identity
162156

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

165159
### Using the Azure portal
166160

167-
> [!NOTE]
168-
> This portal experience is being deployed and may not yet be available in all regions.
169-
170161
First, you'll need to create a user-assigned identity resource.
171162

172163
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).
@@ -177,7 +168,7 @@ First, you'll need to create a user-assigned identity resource.
177168

178169
4. Select **Managed identity**.
179170

180-
5. Within the **User assigned (preview)** tab, click **Add**.
171+
5. Within the **User assigned** tab, click **Add**.
181172

182173
6. Search for the identity you created earlier and select it. Click **Add**.
183174

@@ -387,6 +378,25 @@ const getToken = function(resource, apiver, cb) {
387378
}
388379
```
389380

381+
<a name="token-python"></a>In Python:
382+
383+
```python
384+
import os
385+
import requests
386+
387+
msi_endpoint = os.environ["MSI_ENDPOINT"]
388+
msi_secret = os.environ["MSI_SECRET"]
389+
390+
def get_bearer_token(resource_uri, token_api_version):
391+
token_auth_uri = f"{msi_endpoint}?resource={resource_uri}&api-version={token_api_version}"
392+
head_msi = {'Secret':msi_secret}
393+
394+
resp = requests.get(token_auth_uri, headers=head_msi)
395+
access_token = resp.json()['access_token']
396+
397+
return access_token
398+
```
399+
390400
<a name="token-powershell"></a>In PowerShell:
391401

392402
```powershell

0 commit comments

Comments
 (0)