Creating a .NET Core 2 application to interact with Cosmos DB

Now we will create a new multiplatform .NET Core 2 console app. We will install the necessary NuGet packages to work with the Cosmos DB SDK and make it easy to use a JSON configuration file for our application.

In Visual Studio, select File | New | Project and select Visual C# | .NET Core | Console App (.NET Core). Enter SampleApp1 for the project name. The code file for the sample is included in the learning_cosmos_db_04_01 folder in the dot_net_core_2_samples/SampleApp1/SampleApp1.sln file.

Install the NuGet packages and versions detailed in the next table. If there are newer versions available, you will have to verify the change log to make sure that there are no breaking changes. ...

Get Guide to NoSQL with Azure Cosmos DB now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.