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/documentdb/how-to-connect-role-based-access-control.md
+28-33Lines changed: 28 additions & 33 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ description: Configure Microsoft Entra ID–based role-based access control (rol
4
4
author: seesharprun
5
5
ms.author: sidandrews
6
6
ms.topic: how-to
7
-
ms.date: 01/02/2026
7
+
ms.date: 02/04/2026
8
8
ms.devlang: python
9
9
defaultDevLang: python
10
10
dev_langs:
@@ -27,7 +27,7 @@ Role-based access control provides a centralized mechanism to assign and enforce
27
27
Enable Microsoft Entra ID to allow Microsoft Entra principals (users, service principals, or managed identities) to authenticate to the cluster. Microsoft Entra ID authentication is implemented using OpenID Connect (OIDC). Clients present an Entra-issued OIDC access token to the MongoDB driver. A cluster must have native authentication enabled; the supported configurations are native-only or Microsoft Entra ID authentication only or native and Microsoft Entra ID authentication.
28
28
29
29
> [!NOTE]
30
-
> You can enable or change authentication methods on a cluster at any time after provisioning. Changing authentication methods does **not** require a cluster restart and is non-disruptive. When a cluster is created, native DocumentDB authentication must be enabled. You can disable native authentication after the cluster is finished provisioning.
30
+
> You can enable or change authentication methods on a cluster at any time after provisioning. Changing authentication methods does **not** require a cluster restart and is nondisruptive. When a cluster is created, native DocumentDB authentication must be enabled. You can disable native authentication after the cluster is finished provisioning.
31
31
32
32
Benefits of using Microsoft Entra ID for authentication include:
33
33
@@ -809,7 +809,7 @@ When you create an Azure DocumentDB cluster, the cluster is configured to solely
809
809
810
810
## Manage DocumentDB administrative Microsoft Entra ID identities and native users
811
811
812
-
When Microsoft Entra ID authentication is enabled on an Azure DocumetnDB cluster, you can add one or more Microsoft Entra ID principals as *administrator users* to that cluster. The Microsoft Entra ID administrator can be a Microsoft Entra ID user, a service principal, or a managed identity. Multiple Microsoft Entra ID administrators can be configured at any time.
812
+
When Microsoft Entra ID authentication is enabled on an Azure DocumentDB cluster, you can add one or more Microsoft Entra ID principals as *administrator users* to that cluster. The Microsoft Entra ID administrator can be a Microsoft Entra ID user, a service principal, or a managed identity. Multiple Microsoft Entra ID administrators can be configured at any time.
813
813
814
814
Administrative Entra ID users are created as Azure entities under `Microsoft.DocumentDB/mongoClusters/users` and are replicated to the database.
815
815
@@ -1212,26 +1212,12 @@ The `tls` setting must also be enabled. The remaining recommended settings are b
1212
1212
1213
1213
::: zone-end
1214
1214
1215
-
## Connect using Microsoft Entra ID in MongoDB Shell
1216
-
1217
-
Use a client device with the [MongoDB Shell](https://www.mongodb.com/try/download/shell) installed to connect to your Azure DocumentDB cluster using a Microsoft Entra ID identity.
1218
-
1219
-
1. Open a terminal on a client with MongoDB shell installed.
1220
-
1221
-
1. Get the **name** of your Azure DocumentDB cluster and the **client ID** for the target identity.
1222
-
1223
-
1. Connect by using the following connection string:
## Connect using Microsoft Entra ID in Visual Studio Code
1230
1216
1231
1217
Use Visual Studio Code with the [DocumentDB extension](https://github.com/microsoft/vscode-documentdb) to connect to your Azure DocumentDB cluster using a Microsoft Entra ID identity.
1232
1218
1233
1219
> [!IMPORTANT]
1234
-
> When you authenticate to an Azure DocumentDB cluster using Microsoft Entra ID in Visual Studio Code with DocumentDB extension, `shell` functionality isn't supported. If you need to use MongoDB shell with Microsoft Entra ID authentication, use [MongoDB Shell directly on a client machine](#connect-using-microsoft-entra-id-in-mongodb-shell).
1220
+
> When you authenticate to an Azure DocumentDB cluster using Microsoft Entra ID in Visual Studio Code with DocumentDB extension, `shell` functionality isn't supported. If you need to use MongoDB shell with Microsoft Entra ID authentication, use [MongoDB Shell directly on a client machine](#connect-using-microsoft-entra-id-in-mongodb-compass-or-mongodb-shell).
1235
1221
1236
1222
1. Open Visual Studio Code.
1237
1223
@@ -1254,33 +1240,39 @@ Use Visual Studio Code with the [DocumentDB extension](https://github.com/micros
1254
1240
1255
1241
1. Wait for the connection to finalize. A new DocumentDB entry is then added to the **Connections** section for the cluster.
1256
1242
1257
-
## Connect using Microsoft Entra ID in MongoDB Compass
1243
+
## Connect using Microsoft Entra ID in MongoDB Compass or MongoDB Shell
1244
+
1245
+
Connect to your Azure DocumentDB cluster using a Microsoft Entra ID identity directly with the [MongoDB Compass](https://www.mongodb.com/products/tools/compass) application.
1258
1246
1259
-
Connect to your Azure DocumentDB cluster using a Microsoft Entra ID identity directly with the [MongoDB Compass](https://www.mongodb.com/products/tools/compass) application.
1247
+
1. Set up an execution environment for connecting to the Azure DocumentDB cluster by creating an Azure compute resource, like an Azure Virtual Machine.
1260
1248
1261
-
1. Start the MongoDB Compass application.
1249
+
1. Create either a system-assigned managed identity or a [user-assigned managed identity](/entra/identity/managed-identities-azure-resources/manage-user-assigned-managed-identities-azure-portal), and associate it with the virtual machine.
1262
1250
1263
-
1. Select **+** in the **Connections** menu to add a new connection.
1251
+
:::image source="media/how-to-connect-role-based-access-control/assign-managed-identity.png" alt-text="Screenshot to assign managed identity on the Azure portal.":::
1264
1252
1265
-
1. Toggle the **Edit Connection String** setting to enable in the **New Connection** dialog.
1253
+
1. Register the managed identity in the Azure DocumentDB Cluster.
1266
1254
1267
-
1. Enter the following connection string into the **URI** input box.
1255
+
:::image source="media/how-to-configure-entra-authentication/open-side-panel-to-add-entra-id-users.png" alt-text="Screenshot to register managed identity on the Azure DocumentDB Cluster.":::
1256
+
1257
+
1. Start the [MongoDB Compass](https://www.mongodb.com/products/tools/compass) application or [Mongo shell](https://www.mongodb.com/try/download/shell) in terminal.
1258
+
1259
+
1. Within MongoDB Compass, Select **+** in the **Connections** menu to add a new connection. While using the shell, get the **name** of your Azure DocumentDB cluster and the **client ID** for the target identity.
1260
+
1261
+
:::image source="media/how-to-connect-role-based-access-control/review-client-id.png" alt-text="Screenshot to review clientid needed for constructing the Entra connection string from portal on the Azure DocumentDB.":::
1262
+
1263
+
1. Enter the following credential into the **URI** input box.
1. Now, open the **Advanced Connection Options** dialog.
1269
+
1. Open the **Advanced Connection Options** dialog.
1274
1270
1275
1271
1. In the **General** section, select `mongodb+srv` for the **Connection String Scheme**.
1276
1272
1277
-
1. Next, navigate to the **Authentication** section.
1273
+
1. Navigate to the **Authentication** section and ensure that the **OIDC** option is selected.
1278
1274
1279
-
1. Ensure that the **OIDC** option is selected.
1280
-
1281
-
1. Now, navigate to the **OIDC Options** section.
1282
-
1283
-
1. Ensure that the **Consider Target Endpoint Trusted** option is also selected.
1275
+
1. Navigate to the **OIDC Options** section and then ensure that the **Consider Target Endpoint Trusted** option is also selected.
1284
1276
1285
1277
1. Select **Save & Connect**.
1286
1278
@@ -1289,9 +1281,12 @@ Connect to your Azure DocumentDB cluster using a Microsoft Entra ID identity dir
1289
1281
Sign in to the cluster with an administrative Microsoft Entra ID identity to perform management operations for nonadministrative Microsoft Entra ID identities.
1290
1282
1291
1283
> [!NOTE]
1292
-
> All management commands for nonadministrative users are supported for `SecurityPrincipal` and `user` principal types.
1284
+
> All management commands for nonadministrative users are supported for `securityPrincipal` and `user` principal types.
1285
+
>
1286
+
> Nonadministrative users aren't registered in the Azure portal.
1287
+
>
1293
1288
1294
-
1. Sign in to the cluster using an administrative Microsoft Entra ID identity and using a tool like [MongoDB Shell](#connect-using-microsoft-entra-id-in-mongodb-shell).
1289
+
1. Sign in to the cluster using an administrative Microsoft Entra ID identity and using a tool like [MongoDB Shell](#connect-using-microsoft-entra-id-in-mongodb-compass-or-mongodb-shell).
1295
1290
1296
1291
1. Add a nonadministrative Microsoft Entra ID identity with **read-write** permissions on the cluster using the `createUser` command:
Copy file name to clipboardExpand all lines: articles/documentdb/limitations.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -204,7 +204,7 @@ The [Microsoft Entra ID authentication](./how-to-connect-role-based-access-contr
204
204
- This feature doesn't support Microsoft Entra ID groups.
205
205
206
206
- When native DocumentDB authentication method is disabled, MongoDB Shell isn't supported in the Azure portal's **Quick start**.
207
-
- You can [use MongoDB Shell with Microsoft Entra ID authentication](./how-to-connect-role-based-access-control.md#connect-using-microsoft-entra-id-in-mongodb-shell) outside of the Azure portal.
207
+
- You can [use MongoDB Shell with Microsoft Entra ID authentication](./how-to-connect-role-based-access-control.md#connect-using-microsoft-entra-id-in-mongodb-compass-or-mongodb-shell) outside of the Azure portal.
0 commit comments