services | platforms | author |
---|---|---|
cosmos-db |
dotnet |
anhoh |
Azure Cosmos DB is a globally distributed multi-model database. One of the supported APIs is the MongoDB API, which provides a document model and support for client drivers in many platforms. This sample shows you how to use the Azure Cosmos DB with the MongoDB API to store and access data from a .NET application.
-
Before you can run this sample, you must have the following prerequisites:
- An active Azure account. If you don't have one, you can sign up for a free account. Alternatively, you can use the Azure Cosmos DB Emulator for this tutorial.
- Visual Studio 2017 (download and use the free Visual Studio 2017 Community Edition)
-
Then, clone this repository using
git clone [email protected]:azure-samples/azure-cosmosdb-mongodb-dotnet-getting-started.git
. -
Next, substitute the
username
,host
, andpassword
in DAL / Dal.cs with your Cosmos DB account's values. -
Install the MongoDB.Driver library from Visual Studio's Nuget Manager.
-
Click CTRL + F5 to run your application.
The code included in this sample is intended to get you quickly started with a .NET application that connects to Azure Cosmos DB with the MongoDB API.