|
1 | 1 | ---
|
2 | 2 | title: Connect a MongoDB application to Azure Cosmos DB
|
3 | 3 | description: Learn how to connect a MongoDB app to Azure Cosmos DB by getting the connection string from Azure portal
|
4 |
| -author: markjbrown |
5 |
| -ms.author: mjbrown |
| 4 | +author: timsander1 |
| 5 | +ms.author: tisande |
6 | 6 | ms.service: cosmos-db
|
7 | 7 | ms.subservice: cosmosdb-mongo
|
8 | 8 | ms.topic: conceptual
|
9 |
| -ms.date: 12/02/2019 |
| 9 | +ms.date: 03/19/2020 |
10 | 10 | ms.reviewer: sngun
|
11 |
| - |
12 | 11 | ---
|
13 |
| - |
14 | 12 | # Connect a MongoDB application to Azure Cosmos DB
|
15 |
| -Learn how to connect your MongoDB app to an Azure Cosmos DB by using a MongoDB connection string. You can then use an Azure Cosmos database as the data store for your MongoDB app. |
| 13 | + |
| 14 | +Learn how to connect your MongoDB app to an Azure Cosmos DB by using a MongoDB connection string. You can then use an Azure Cosmos database as the data store for your MongoDB app. |
16 | 15 |
|
17 | 16 | This tutorial provides two ways to retrieve connection string information:
|
18 | 17 |
|
19 |
| -- [The quickstart method](#QuickstartConnection), for use with .NET, Node.js, MongoDB Shell, Java, and Python drivers |
20 |
| -- [The custom connection string method](#GetCustomConnection), for use with other drivers |
| 18 | +- [The quickstart method](#get-the-mongodb-connection-string-by-using-the-quick-start), for use with .NET, Node.js, MongoDB Shell, Java, and Python drivers |
| 19 | +- [The custom connection string method](#get-the-mongodb-connection-string-to-customize), for use with other drivers |
21 | 20 |
|
22 | 21 | ## Prerequisites
|
23 | 22 |
|
24 |
| -- An Azure account. If you don't have an Azure account, create a [free Azure account](https://azure.microsoft.com/free/) now. |
| 23 | +- An Azure account. If you don't have an Azure account, create a [free Azure account](https://azure.microsoft.com/free/) now. |
25 | 24 | - A Cosmos account. For instructions, see [Build a web app using Azure Cosmos DB's API for MongoDB and .NET SDK](create-mongodb-dotnet.md).
|
26 | 25 |
|
27 |
| -## <a id="QuickstartConnection"></a>Get the MongoDB connection string by using the quick start |
| 26 | +## Get the MongoDB connection string by using the quick start |
| 27 | + |
28 | 28 | 1. In an Internet browser, sign in to the [Azure portal](https://portal.azure.com).
|
29 |
| -2. In the **Azure Cosmos DB** blade, select the API. |
30 |
| -3. In the left pane of the account blade, click **Quick start**. |
31 |
| -4. Choose your platform (**.NET**, **Node.js**, **MongoDB Shell**, **Java**, **Python**). If you don't see your driver or tool listed, don't worry--we continuously document more connection code snippets. Please comment below on what you'd like to see. To learn how to craft your own connection, read [Get the account's connection string information](#GetCustomConnection). |
| 29 | +2. In the **Azure Cosmos DB** blade, select the API. |
| 30 | +3. In the left pane of the account blade, click **Quick start**. |
| 31 | +4. Choose your platform (**.NET**, **Node.js**, **MongoDB Shell**, **Java**, **Python**). If you don't see your driver or tool listed, don't worry--we continuously document more connection code snippets. Please comment below on what you'd like to see. To learn how to craft your own connection, read [Get the account's connection string information](#get-the-mongodb-connection-string-to-customize). |
32 | 32 | 5. Copy and paste the code snippet into your MongoDB app.
|
33 | 33 |
|
34 | 34 | 
|
35 | 35 |
|
36 |
| -## <a id="GetCustomConnection"></a> Get the MongoDB connection string to customize |
| 36 | +## Get the MongoDB connection string to customize |
| 37 | + |
37 | 38 | 1. In an Internet browser, sign in to the [Azure portal](https://portal.azure.com).
|
38 |
| -2. In the **Azure Cosmos DB** blade, select the API. |
39 |
| -3. In the left pane of the account blade, click **Connection String**. |
| 39 | +2. In the **Azure Cosmos DB** blade, select the API. |
| 40 | +3. In the left pane of the account blade, click **Connection String**. |
40 | 41 | 4. The **Connection String** blade opens. It has all the information necessary to connect to the account by using a driver for MongoDB, including a preconstructed connection string.
|
41 | 42 |
|
42 |
| -  |
| 43 | + [  ](./media/connect-mongodb-account/ConnectionStringBlade.png#lightbox) |
43 | 44 |
|
44 | 45 | ## Connection string requirements
|
| 46 | + |
45 | 47 | > [!Important]
|
46 | 48 | > Azure Cosmos DB has strict security requirements and standards. Azure Cosmos DB accounts require authentication and secure communication via *SSL*.
|
47 | 49 | >
|
|
0 commit comments