Developing a .NET Core console app using Azure Cosmos DB

This sample shows you how to use the Azure Cosmos DB service to store and access data from a .NET Core console application.


Running this sample


    • An active Azure Cosmos DB account - If you don't have an account, refer to the Create a database account article.
    • Visual Studio 2015 (or higher).

  3. From Visual Studio, open the CosmosGettingStartedDotnetCoreTutorial.sln file from the root directory.

  4. In Visual Studio Build menu, select Build Solution (or Press Ctrl+Shift+B).



  1. In the Program.cs file, located in the src directory, find EndPointUri and PrimaryKey and replace the placeholder values with the values obtained for your account.


About the code

The code included in this sample is intended to get you quickly started with a .NET Core console application that connects to Azure Cosmos DB.

More information