Skip to content
.NET SDK for Azure Cosmos DB for the core SQL API
C# Other
  1. C# 99.3%
  2. Other 0.7%
Branch: master
Clone or download
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github/ISSUE_TEMPLATE Merged PR 187055: Use LFS for test json files and remove owners from … Feb 13, 2019
Microsoft.Azure.Cosmos.Samples Samples for Batch API (#941) Nov 8, 2019
Microsoft.Azure.Cosmos Fixed project so that $(DefineConstants)are propogated when $(DelaySi… Nov 19, 2019
templates Convert QueryException to CosmosException (#1003) Nov 16, 2019
.gitignore Initial commit Nov 5, 2018
35MSSharedLib1024.snk Remove Microsoft.Azure.Direct.MyGet dependency (#760) Sep 10, 2019
CODEOWNERS Removing extra / at the end Sep 10, 2019
CredScanSuppressions.json Azure dev-ops YML pipelines (#634) Aug 5, 2019
LICENSE Initial commit Nov 5, 2018
Microsoft.Azure.Cosmos.sln Running Item benchmark in Gates (#998) Nov 15, 2019
NuGet.config add source Dec 1, 2018 Updating samples to 3.1.0 nuget. (#609) Jul 30, 2019 Including Microsoft Open Source Code of Conduct Aug 14, 2019
azure-pipelines-cron.yml Cron job (MacOS, Linux, Winows) every 6Hrs (#660) Aug 12, 2019
azure-pipelines-functional.yml Nightly build refinements (#649) Aug 6, 2019
azure-pipelines-nightly.yml Adding a new corn job which runs every 6Hrs Aug 8, 2019
azure-pipelines-official.yml Update azure-pipelines-official.yml (#970) Nov 6, 2019
azure-pipelines.yml Nightly build refinements (#649) Aug 6, 2019 CosmosQueryExecutionContextFactory Refactory (#988) Nov 18, 2019
repo.config Merged PR 178986: Config files required to onboard OneBranch Ownershi… Jan 15, 2019
testkey.snk Remove Microsoft.Azure.Direct.MyGet dependency (#760) Sep 10, 2019

Build Status

Microsoft Azure Cosmos DB .NET SDK Version 3

This client library enables client applications to connect to Azure Cosmos via the SQL API. Azure Cosmos is a globally distributed, multi-model database service. For more information, refer to

CosmosClient client = new CosmosClient("", "mysupersecretkey");
Database database = await client.CreateDatabaseIfNotExistsAsync("MyDatabaseName");
Container container = await database.CreateContainerIfNotExistsAsync(

dynamic testItem = new { id = "MyTestItemId", partitionKeyPath = "MyTestPkValue", details = "it's working" };
ItemResponse<dynamic> response = await container.CreateItemAsync(testItem);

Install via

Install-Package Microsoft.Azure.Cosmos

Useful links

Microsoft Open Source Code of Conduct

This project has adopted the Microsoft Open Source Code of Conduct.



This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact with any additional questions or comments.

You can’t perform that action at this time.