.NET SDK for Azure Cosmos DB for the core SQL API
Перейти к файлу
Kiran Kumar Kolli 5793eec20d
[INTERNAL] CI: Fixes reverts to public emulator from internal emulator (#4895)
[INTERNAL] CI: Fixes reverts to public emulator from internal emulator
2024-11-19 10:28:39 -08:00
.github [Internal] Pipelines: Adds permissions to workflow (#4270) 2024-01-22 22:37:58 +00:00
Microsoft.Azure.Cosmos [Client encryption]: Fixes missing files errors at time of nuget publishing. (#4896) 2024-11-19 15:56:07 +00:00
Microsoft.Azure.Cosmos.Encryption [Client encryption]: Fixes missing files errors at time of nuget publishing. (#4896) 2024-11-19 15:56:07 +00:00
Microsoft.Azure.Cosmos.Encryption.Custom [Client encryption]: Fixes missing files errors at time of nuget publishing. (#4896) 2024-11-19 15:56:07 +00:00
Microsoft.Azure.Cosmos.Samples [Internal] Samples: Fixes OpenTelemetry sample package references (#4786) 2024-10-09 22:23:04 -07:00
docs Open Telemetry: Adds open telemetry based versioning (#4854) 2024-11-14 08:01:57 -08:00
templates [INTERNAL] CI: Fixes reverts to public emulator from internal emulator (#4895) 2024-11-19 10:28:39 -08:00
tools Revert "[INTERNAL] CI: Fixes emulator set-up to leverage central SDK teams scripts (#4813)" (#4877) 2024-11-08 20:34:16 -08:00
.editorconfig editorcofig: Adds editorcofig rules for all the VS defaults (#1827) 2020-09-18 11:53:35 -07:00
.gitattribute [INTERNAL] Line endings: Adds gitattribute to normalize line endings (#3062) 2022-03-03 20:09:51 +00:00
.gitignore Initial commit 2018-11-05 10:03:17 -08:00
.sscignore [Internal] sccignore: Adds a .sccignore file to apply an exception for artifacts configuration issues (#3589) 2022-11-29 06:38:22 -08:00
35MSSharedLib1024.snk Remove Microsoft.Azure.Direct.MyGet dependency (#760) 2019-09-10 19:57:58 +05:30
CODEOWNERS Adding Kevin and removing Kirill from code owners (#4689) 2024-09-16 09:47:06 -07:00
CONTRIBUTING.md [Internal] Emulator unit tests: Adds IdEncoding unit tests for ComputeGateway (#3556) 2022-11-10 22:29:39 +00:00
CredScanSuppressions.json Azure dev-ops YML pipelines (#634) 2019-08-06 00:22:57 +05:30
Directory.Build.props 3.46.0: Adds new SDK versions and contract files (#4893) 2024-11-19 00:40:38 +00:00
Exceptions.md Documentation: Adds retry statements to exception document (#2076) 2020-12-21 10:20:28 -08:00
Icon.png [Client encryption]: Fixes missing files errors at time of nuget publishing. (#4896) 2024-11-19 15:56:07 +00:00
LICENSE Initial commit 2018-11-05 10:03:20 -08:00
Microsoft.Azure.Cosmos.sln [Internal] Fault Injection: Adds Gateway mode support (#4667) 2024-11-18 19:39:46 +00:00
PULL_REQUEST_TEMPLATE.md [Internal] PR Lint: Fixes to use new title regex (#1699) 2020-07-14 13:51:25 -07:00
README.md [Internal] Versioning: Adds guidance for versioning SDK releases (#4192) 2023-11-21 22:00:40 +00:00
SECURITY.md Microsoft mandatory file (#3203) 2022-05-19 10:45:45 -07:00
SdkDesignGuidelines.md Documentation: Adds SDK guidelines (#1803) 2020-08-26 21:11:27 +05:30
ThirdPartyNotice.txt [Internal] Parser: Adds Antlr Dependancy (#1691) 2020-09-23 09:33:21 -07:00
UpdateContracts.ps1 [Internal] Client Telemetry: Adds telemetry contract (#4161) 2023-10-31 09:37:48 -07:00
UpdateDotNetVersion.ps1 .NET 6: Refactors test and samples to use .NET 6 (#2986) 2022-01-19 11:29:59 -08:00
azure-pipelines-cron.yml Cron job (MacOS, Linux, Winows) every 6Hrs (#660) 2019-08-13 03:47:28 +05:30
azure-pipelines-ctl-publishing.yml [Internal] Pipelines: Adds demands to ctl (#4562) 2024-06-28 08:22:56 -07:00
azure-pipelines-encryption-custom.yml [INTERNAL] CI: Adds .NET8 SDK support (#4776) 2024-10-09 13:30:21 -07:00
azure-pipelines-encryption.yml [INTERNAL] CI: Adds .NET8 SDK support (#4776) 2024-10-09 13:30:21 -07:00
azure-pipelines-functional.yml [Internal] Pipelines: Fixes pipeline to not run on documentation (#3425) 2022-08-29 21:14:49 +00:00
azure-pipelines-nightly.yml [Internal] Build: Adds CodeQL support in nightly builds (#4113) 2023-10-06 16:36:44 -07:00
azure-pipelines-official.yml [INTERNAL] CI: Adds .NET8 SDK support (#4776) 2024-10-09 13:30:21 -07:00
azure-pipelines-rolling.yml [INTERNAL] CI: Fixes gates reliability issues (#4754) 2024-10-06 11:01:48 -07:00
azure-pipelines.yml [INTERNAL] CI: Fixes Moving flaky tests into separate groups (#4752) 2024-10-05 18:09:01 -07:00
changelog.md 3.46.0: Adds new SDK versions and contract files (#4893) 2024-11-19 00:40:38 +00:00
repo.config Merged PR 178986: Config files required to onboard OneBranch Ownership Enforcer: repo.config and root directory owner. 2019-01-15 21:01:08 +00:00
testkey.snk Remove Microsoft.Azure.Direct.MyGet dependency (#760) 2019-09-10 19:57:58 +05:30

README.md

NuGet NuGet Prerelease

Microsoft Azure Cosmos DB .NET SDK Version 3

This client library enables client applications to connect to Azure Cosmos DB for NoSQL. Azure Cosmos DB is a globally distributed, multi-model database service. For more information, refer to https://azure.microsoft.com/services/cosmos-db/.

CosmosClient client = new CosmosClient("https://mycosmosaccount.documents.azure.com:443/", "mysupersecretkey");
Database database = await client.CreateDatabaseIfNotExistsAsync("MyDatabaseName");
Container container = await database.CreateContainerIfNotExistsAsync(
    "MyContainerName",
    "/partitionKeyPath",
    400);

// Create an item
dynamic testItem = new { id = "MyTestItemId", partitionKeyPath = "MyTestPkValue", details = "it's working", status = "done" };
ItemResponse<dynamic> createResponse = await container.CreateItemAsync(testItem);

// Query for an item
using (FeedIterator<dynamic> feedIterator = container.GetItemQueryIterator<dynamic>(
    "select * from T where T.status = 'done'"))
{
    while (feedIterator.HasMoreResults)
    {
        FeedResponse<dynamic> response = await feedIterator.ReadNextAsync();
        foreach (var item in response)
        {
            Console.WriteLine(item);
        }
    }
}

Install via Nuget.org

Install-Package Microsoft.Azure.Cosmos

For available versions, see SDK versioning.

Microsoft Open Source Code of Conduct

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

Resources:

Contributing

For details on contributing to this repository, see the contributing guide.

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 https://cla.microsoft.com.

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 opencode@microsoft.com with any additional questions or comments.