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/active-directory/app-provisioning/customize-application-attributes.md
+4-1Lines changed: 4 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -139,7 +139,10 @@ The SCIM RFC defines a core user and group schema, while also allowing for exten
139
139
4. Select **Edit attribute list for AppName**.
140
140
5. At the bottom of the attribute list, enter information about the custom attribute in the fields provided. Then select **Add Attribute**.
141
141
142
-
For SCIM applications, the attribute name must follow the pattern shown in the example below. The "CustomExtensionName" and "CustomAttribute" can be customized per your application's requirements, for example: urn:ietf:params:scim:schemas:extension:2.0:CustomExtensionName:CustomAttribute or urn:ietf:params:scim:schemas:extension:CustomExtensionName:2.0:User.CustomAttributeName:value
142
+
For SCIM applications, the attribute name must follow the pattern shown in the example below. The "CustomExtensionName" and "CustomAttribute" can be customized per your application's requirements, for example:
These instructions are only applicable to SCIM-enabled applications. Applications such as ServiceNow and Salesforce are not integrated with Azure AD using SCIM, and therefore they don't require this specific namespace when adding a custom attribute.
Copy file name to clipboardExpand all lines: articles/cosmos-db/managed-identity-based-authentication.md
+40-39Lines changed: 40 additions & 39 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
2
title: How to use a system-assigned managed identity to access Azure Cosmos DB data
3
-
description: Learn how to configure an Azure AD system-assigned managed identity to access keys from Azure Cosmos DB. msi, managed service identity, aad, azure active directory, identity
3
+
description: Learn how to configure an Azure Active Directory (Azure AD) system-assigned managed identity (managed service identity) to access keys from Azure Cosmos DB.
4
4
author: j-patrick
5
5
ms.service: cosmos-db
6
6
ms.topic: conceptual
@@ -10,71 +10,71 @@ ms.reviewer: sngun
10
10
11
11
---
12
12
13
-
# How to use a system-assigned managed identity to access Azure Cosmos DB data
13
+
# Use system-assigned managed identities to access Azure Cosmos DB data
14
14
15
-
In this article you will set up a **robust, key rotation agnostic,** solution to access Azure Cosmos DB keys by leveraging[managed identities](../active-directory/managed-identities-azure-resources/services-support-managed-identities.md). The example in this article uses an Azure Function. However, you can achieve this solution by using any service that supports managed identities.
15
+
In this article, you'll set up a *robust, key rotation agnostic* solution to access Azure Cosmos DB keys by using[managed identities](../active-directory/managed-identities-azure-resources/services-support-managed-identities.md). The example in this article uses Azure Functions, but you can use any service that supports managed identities.
16
16
17
-
You'll learn how to create an Azure Function that can access Azure Cosmos DB without needing to copy any Azure Cosmos DB keys. The function will wake up every minute and record the current temperature of an aquarium fish tank. To learn how to set up a timertriggered Azure Function see the [Create a function in Azure that is triggered by a timer](../azure-functions/functions-create-scheduled-function.md) article.
17
+
You'll learn how to create a function app that can access Azure Cosmos DB data without needing to copy any Azure Cosmos DB keys. The function app will wake up every minute and record the current temperature of an aquarium fish tank. To learn how to set up a timer-triggered function app, see the [Create a function in Azure that is triggered by a timer](../azure-functions/functions-create-scheduled-function.md) article.
18
18
19
-
To simplify the scenario, cleanup of older temperature documents is handled by an already configured [Time To Live](./time-to-live.md) setting.
19
+
To simplify the scenario, a [Time To Live](./time-to-live.md) setting is already configured to clean up older temperature documents.
20
20
21
-
## Assign a system-assigned managed identity to an Azure Function
21
+
## Assign a system-assigned managed identity to a function app
22
22
23
-
In this step, you'll assign a system-assigned managed identity to your Azure Function.
23
+
In this step, you'll assign a system-assigned managed identity to your function app.
24
24
25
-
1. In the [Azure portal](https://portal.azure.com/), open the **Azure Function** pane and navigate to your function app.
25
+
1. In the [Azure portal](https://portal.azure.com/), open the **Azure Function** pane and go to your function app.
26
26
27
27
1. Open the **Platform features** > **Identity** tab:

30
30
31
-
1. On the **Identity** tab, turn **On** the **System Identity**status. Be sure to select **Save**, and confirm that you want to turn on the system identity. At the end the **System Identity** pane should look as follows:
31
+
1. On the **Identity** tab, turn **On** the system identity **Status**and select **Save**. The **Identity** pane should look as follows:

34
34
35
-
## Grant the managed identity access to your Azure Cosmos account
35
+
## Grant access to your Azure Cosmos account
36
36
37
-
In this step, you'll assign a role to the Azure Function's system-assigned managed identity. Azure Cosmos DB has multiple built-in roles that you can assign to the managed identity. For this solution, you will use the following two roles:
37
+
In this step, you'll assign a role to the function app's system-assigned managed identity. Azure Cosmos DB has multiple built-in roles that you can assign to the managed identity. For this solution, you'll use the following two roles:
38
38
39
39
|Built-in role |Description |
40
40
|---------|---------|
41
41
|[DocumentDB Account Contributor](../role-based-access-control/built-in-roles.md#documentdb-account-contributor)|Can manage Azure Cosmos DB accounts. Allows retrieval of read/write keys. |
42
42
|[Cosmos DB Account Reader](../role-based-access-control/built-in-roles.md#cosmos-db-account-reader-role)|Can read Azure Cosmos DB account data. Allows retrieval of read keys. |
43
43
44
44
> [!IMPORTANT]
45
-
> RBAC support in Azure Cosmos DB is applicable to control plane operations only. Data plane operations are secured using master keys or resource tokens. To learn more, see the [Secure access to data](secure-access-to-data.md) article.
45
+
> Support for role-based access control in Azure Cosmos DB applies to control plane operations only. Data plane operations are secured through master keys or resource tokens. To learn more, see the [Secure access to data](secure-access-to-data.md) article.
46
46
47
47
> [!TIP]
48
-
> When assigning roles, only assign the needed access. If your service only requires reading data, then assign the managed identity to **Cosmos DB Account Reader** role. For more information about the importance of least privilege access, see the [lower exposure of privileged accounts](../security/fundamentals/identity-management-best-practices.md#lower-exposure-of-privileged-accounts) article.
48
+
> When you assign roles, assign only the needed access. If your service requires only reading data, then assign the **Cosmos DB Account Reader** role to the managed identity. For more information about the importance of least privilege access, see the [Lower exposure of privileged accounts](../security/fundamentals/identity-management-best-practices.md#lower-exposure-of-privileged-accounts) article.
49
49
50
-
For your scenario, you will read the temperature, then write back that data to a container in Azure Cosmos DB. Because you have to write the data, you will use the **DocumentDB Account Contributor** role.
50
+
In this scenario, the function app will read the temperature of the aquarium, then write back that data to a container in Azure Cosmos DB. Because the function app must write the data, you'll need to assign the **DocumentDB Account Contributor** role.
51
51
52
-
1. Sign in to the Azure portal and navigate to your Azure Cosmos DB account. Open the **Access Management (IAM) Pane**, and then the **Role Assignments** tab:
52
+
1. Sign in to the Azure portal and go to your Azure Cosmos DB account. Open the **Access control (IAM)** pane and then the **Role assignments** tab:
***Assign access to** - Under the Select **System-assigned managed identity** subsection, select**Function App**.
64
-
***Select** - The pane will be populated with all the function apps, in your subscription, that have a **Managed System Identity**. In our case I select the **SummaryService** function app:
***Assign access to**: Under the **Select system-assigned managed identity** subsection, select **Function App**.
64
+
***Select**: The pane will be populated with all the function apps in your subscription that have a **Managed System Identity**. In this case, select the **SummaryService** function app:

67
67
68
-
1. After the function app's identity is selected click**Save**.
68
+
1. After you have selected your function app, select**Save**.
69
69
70
-
## Programmatically access the Azure Cosmos DB keys from the Azure Function
70
+
## Programmatically access the Azure Cosmos DB keys
71
71
72
-
Now we have a function app that has a system-assigned managed identity. That identity is given the **DocumentDB Account Contributor** role in the Azure Cosmos DB permissions. The following function app code will get the Azure Cosmos DB keys, create a CosmosClient object, get the temperature, then save this to Cosmos DB.
72
+
Now we have a function app that has a system-assigned managed identity with the **DocumentDB Account Contributor** role in the Azure Cosmos DB permissions. The following function app code will get the Azure Cosmos DB keys, create a CosmosClient object, get the temperature of the aquarium, and then save this to Azure Cosmos DB.
73
73
74
74
This sample uses the [List Keys API](https://docs.microsoft.com/rest/api/cosmos-db-resource-provider/DatabaseAccounts/ListKeys) to access your Azure Cosmos DB account keys.
75
75
76
76
> [!IMPORTANT]
77
-
> If you want to [assign the **Cosmos DB Account Reader**](#grant-the-managed-identity-access-to-your-azure-cosmos-account) role, you will need to use the read only [List Keys api](https://docs.microsoft.com/rest/api/cosmos-db-resource-provider/DatabaseAccounts/ListReadOnlyKeys). This will only populate the readonly keys.
77
+
> If you want to [assign the Cosmos DB Account Reader](#grant-access-to-your-azure-cosmos-account) role, you'll need to use the [List Read Only Keys API](https://docs.microsoft.com/rest/api/cosmos-db-resource-provider/DatabaseAccounts/ListReadOnlyKeys). This will populate just the read-only keys.
78
78
79
79
The List Keys API returns the `DatabaseAccountListKeysResult` object. This type isn't defined in the C# libraries. The following code shows the implementation of this class:
80
80
@@ -91,7 +91,7 @@ namespace SummarizationService
91
91
}
92
92
```
93
93
94
-
The example also uses a simple document called "TemperatureRecord", which is defined as follows:
94
+
The example also uses a simple document called "TemperatureRecord," which is defined as follows:
95
95
96
96
```csharp
97
97
usingSystem;
@@ -108,7 +108,8 @@ namespace Monitor
108
108
}
109
109
```
110
110
111
-
You will use the [Microsoft.Azure.Services.AppAuthentication](https://www.nuget.org/packages/Microsoft.Azure.Services.AppAuthentication) library to get the system-assigned managed identity token. To learn other ways to get the token and more information about the `Microsoft.Azure.Service.AppAuthentication` library, see the [Service To Service Authentication](../key-vault/general/service-to-service-authentication.md) article.
111
+
You'll use the [Microsoft.Azure.Services.AppAuthentication](https://www.nuget.org/packages/Microsoft.Azure.Services.AppAuthentication) library to get the system-assigned managed identity token. To learn other ways to get the token and find out more information about the `Microsoft.Azure.Service.AppAuthentication` library, see the [Service-to-service authentication](../key-vault/general/service-to-service-authentication.md) article.
112
+
112
113
113
114
```csharp
114
115
usingSystem;
@@ -145,20 +146,20 @@ namespace Monitor
145
146
// AzureServiceTokenProvider will help us to get the Service Managed token.
0 commit comments