Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Module2-Migrating MongoDB Apps to Azure Cosmos DB(Mongo API).MD #20

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,17 @@ mongoimport --host <HOST>:<PORT> -u <USERNAME> -p <PASSWORD> --ssl --sslAllowInv

### Update Application to use Cosmos DB

1. Go back to Visual Studio Code IDE in Jump VM and and paste the **URI** value against **DOCUMENT_DB_ENDPOINT**, **PRIMARY KEY** against **DOCUMENT_DB_PRIMARYKEY**,type **contosoairdb3** against **DOCUMENT_DB_DATABASE** and **Primary Connection String** Against **MONGO_DB_COONECTION_STRING**(add database name contosoairdb3 before question mark in primary connection string) as in the config.js.<br/>

1. Go back to Visual Studio Code IDE in Jump VM. In the file explorer under ContosoAir.Services find config.js and click on it.
Now paste the following values from the Connecting String information in the Azure Portal into your config.js file:<br/>
* **DOCUMENT_DB_ENDPOINT** = **URI**<br/>
* **DOCUMENT_DB_PRIMARYKEY** = **PRIMARY KEY**<br/>
* **DOCUMENT_DB_DATABASE** = **contosoairdb3**<br/>
* **MONGO_DB_COONECTION_STRING** = **Primary Connection String**<br/>
(add database name contosoairdb3 before question mark in primary connection string)<br/>

<strong>Sample:</strong>
```bash
mongodb://cosmosdb12345:vMTETikja355VZjnJQGC3gwdLaR8xjNlpUq65loZVd4pLvmlG9PB25eqOb7V0EWFnvkqzd9GMp4vjiiDYGLahw==@cosmosdb12345.documents.azure.com:10255/**contosoairdb3**?ssl=true&replicaSet=globaldb
mongodb://cosmosdb12345:vMTETikja355VZjnJQGC3gwdLaR8xjNlpUq65loZVd4pLvmlG9PB25eqOb7V0EWFnvkqzd9GMp4vjiiDYGLahw==@cosmosdb12345.documents.azure.com:10255/contosoairdb3?ssl=true&replicaSet=globaldb
```

2. Navigate back to the **Azure Portal** Resource groups option present in the favourites menu on the left side panel and select the resource group "" and click on **Azure Cosmos DB Account** then, click on **Replicate data globally** option present under **SETTINGS** section in Cosmos DB Account blade.<br/>
Expand Down