Skip to content

Commit b825f11

Browse files
Merge pull request #311298 from v-thpra/tjp-lf-servconnect-003
Q&M: Light Freshness - Service Connector - TJP003
2 parents 7ebe849 + cd4aa89 commit b825f11

1 file changed

Lines changed: 17 additions & 13 deletions

File tree

articles/service-connector/how-to-integrate-cosmos-db.md

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
---
22
title: Integrate Azure Cosmos DB for MongoDB with Service Connector
3-
description: Integrate Azure Cosmos DB for MongoDB into your application with Service Connector
3+
description: Learn how to integrate Azure Cosmos DB for MongoDB into your application with Service Connector by using the supported authentication methods and clients.
44
author: maud-lv
55
ms.author: malev
66
ms.service: service-connector
77
ms.topic: how-to
8-
ms.date: 03/14/2025
8+
ms.date: 02/03/2026
99
---
1010

1111
# Integrate Azure Cosmos DB for MongoDB with Service Connector
1212

13-
This page shows supported authentication methods and clients, and shows sample code you can use to connect the Azure Cosmos DB for MongoDB to other cloud services using Service Connector. You might still be able to connect to Azure Cosmos DB for MongoDB in other programming languages without using Service Connector. This page also shows default environment variable names and values (or Spring Boot configuration) you get when you create the service connection.
13+
This article shows supported authentication methods and clients, and shows sample code you can use to connect the Azure Cosmos DB for MongoDB to other cloud services using Service Connector. You might still be able to connect to Azure Cosmos DB for MongoDB in other programming languages without using Service Connector. This page also shows default environment variable names and values (or Spring Boot configuration) you get when you create the service connection.
1414

1515
## Supported compute services
1616

@@ -24,7 +24,7 @@ Service Connector can be used to connect the following compute services to Azure
2424

2525
## Supported authentication types and client types
2626

27-
The table below shows which combinations of client types and authentication methods are supported for connecting your compute service to Azure Cosmos DB for MongoDB using Service Connector. A Yes indicates that the combination is supported, while a “No” indicates that it is not supported.
27+
The following table shows which combinations of client types and authentication methods are supported for connecting your compute service to Azure Cosmos DB for MongoDB using Service Connector. A *Yes* indicates that the combination is supported, while a *No* indicates that it isn't supported.
2828

2929
| Client type | System-assigned managed identity | User-assigned managed identity | Secret / connection string | Service principal |
3030
|--------------------|----------------------------------|--------------------------------|----------------------------|-------------------|
@@ -36,14 +36,14 @@ The table below shows which combinations of client types and authentication meth
3636
| Go | Yes | Yes | Yes | Yes |
3737
| None | Yes | Yes | Yes | Yes |
3838

39-
This table indicates that all combinations of client types and authentication methods in the table are supported, except for the Java - Spring Boot client type, which only supports the Secret / connection string method. All other client types can use any of the authentication methods to connect to Azure Cosmos DB for MongoDB using Service Connector.
39+
This table indicates that all combinations of client types and authentication methods in the table are supported, except for the Java - Spring Boot client type. This client type only supports the Secret / connection string method. All other client types can use any of the authentication methods to connect to Azure Cosmos DB for MongoDB using Service Connector.
4040

4141
> [!NOTE]
42-
> Cosmos DB does not natively support authentication via managed identity. Therefore, Service Connector uses the managed identity to retrieve the connection string, and the connection is subsequently established using that connection string.
42+
> Cosmos DB doesn't natively support authentication via managed identity. Therefore, Service Connector uses the managed identity to retrieve the connection string, and the connection is then established using that connection string.
4343
4444
## Default environment variable names or application properties and sample code
4545

46-
Use the connection details below to connect compute services to Azure Cosmos DB. This page also shows default environment variable names and values (or Spring Boot configuration) you get when you create the service connection, as well as sample code. For each example below, replace the placeholder texts `<mongo-db-admin-user>`, `<password>`, `<Azure-Cosmos-DB-API-for-MongoDB-account>`, `<subscription-ID>`, `<resource-group-name>`, `<client-secret>`, and `<tenant-id>` with your own information. For more information about naming conventions, check the [Service Connector internals](concept-service-connector-internals.md#configuration-naming-convention) article.
46+
Use the following connection details to connect compute services to Azure Cosmos DB. This page also shows default environment variable names and values (or Spring Boot configuration) you get when you create the service connection, and sample code. For each of these examples, replace the placeholder texts `<mongo-db-admin-user>`, `<password>`, `<Azure-Cosmos-DB-API-for-MongoDB-account>`, `<subscription-ID>`, `<resource-group-name>`, `<client-secret>`, and `<tenant-id>` with your own information. For more information about naming conventions, check the [Service Connector internals](concept-service-connector-internals.md#configuration-naming-convention) article.
4747

4848
### System-assigned managed identity
4949

@@ -55,9 +55,10 @@ Use the connection details below to connect compute services to Azure Cosmos DB.
5555

5656
#### Sample code
5757

58-
Refer to the steps and code below to connect to Azure Cosmos DB for MongoDB using a system-assigned managed identity.
58+
To connect to Azure Cosmos DB for MongoDB using a system-assigned managed identity, refer to the following steps and sample code.
5959

6060
Since Cosmos DB doesn't natively support authentication via managed identity, in the following code sample, we use the managed identity to retrieve the connection string, and the connection is then established using that connection string.
61+
6162
[!INCLUDE [code sample for mongo](./includes/code-cosmosmongo-me-id.md)]
6263

6364
### User-assigned managed identity
@@ -71,15 +72,16 @@ Since Cosmos DB doesn't natively support authentication via managed identity, in
7172

7273
#### Sample code
7374

74-
Refer to the steps and code below to connect to Azure Cosmos DB for MongoDB using a user-assigned managed identity.
75+
To connect to Azure Cosmos DB for MongoDB using a user-assigned managed identity, refer to the following steps and sample code.
7576

7677
Since Cosmos DB doesn't natively support authentication via managed identity, in the following code sample, we use the managed identity to retrieve the connection string, and the connection is then established using that connection string.
78+
7779
[!INCLUDE [code sample for mongo](./includes/code-cosmosmongo-me-id.md)]
7880

7981
### Connection string
8082

8183
> [!WARNING]
82-
> Microsoft recommends that you use the most secure authentication flow available. The authentication flow described in this procedure requires a very high degree of trust in the application, and carries risks that are not present in other flows. You should only use this flow when other more secure flows, such as managed identities, aren't viable.
84+
> Microsoft recommends that you use the most secure authentication flow available. The authentication flow described in this procedure requires a high degree of trust in the application, and carries risks that aren't present in other flows. You should only use this flow when other more secure flows, such as managed identities, aren't viable.
8385
8486
#### Spring Boot client type
8587

@@ -96,7 +98,8 @@ Since Cosmos DB doesn't natively support authentication via managed identity, in
9698

9799
#### Sample code
98100

99-
Refer to the steps and code below to connect to Azure Cosmos DB for MongoDB using a connection string.
101+
To connect to Azure Cosmos DB for MongoDB using a connection string, refer to the following steps and sample code.
102+
100103
[!INCLUDE [code sample for mongo](./includes/code-cosmosmongo-secret.md)]
101104

102105
### Service principal
@@ -112,12 +115,13 @@ Refer to the steps and code below to connect to Azure Cosmos DB for MongoDB usin
112115

113116
#### Sample code
114117

115-
Refer to the steps and code below to connect to Azure Cosmos DB for MongoDB using a service principal.
118+
To connect to Azure Cosmos DB for MongoDB using a service principal, refer to the following steps and sample code.
119+
116120
[!INCLUDE [code sample for mongo](./includes/code-cosmosmongo-me-id.md)]
117121

118122
## Next steps
119123

120-
Follow the tutorials listed below to learn more about Service Connector.
124+
To learn more about Service Connector, see the following tutorial.
121125

122126
> [!div class="nextstepaction"]
123127
> [Learn about Service Connector concepts](./concept-service-connector-internals.md)

0 commit comments

Comments
 (0)