Soenneker.Cosmos.Container.Setup 11.0.2544

Prefix Reserved
dotnet add package Soenneker.Cosmos.Container.Setup --version 11.0.2544
                    
NuGet\Install-Package Soenneker.Cosmos.Container.Setup -Version 11.0.2544
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Soenneker.Cosmos.Container.Setup" Version="11.0.2544" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Cosmos.Container.Setup" Version="11.0.2544" />
                    
Directory.Packages.props
<PackageReference Include="Soenneker.Cosmos.Container.Setup" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Soenneker.Cosmos.Container.Setup --version 11.0.2544
                    
#r "nuget: Soenneker.Cosmos.Container.Setup, 11.0.2544"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Soenneker.Cosmos.Container.Setup@11.0.2544
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Soenneker.Cosmos.Container.Setup&version=11.0.2544
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Cosmos.Container.Setup&version=11.0.2544
                    
Install as a Cake Tool

alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image

Soenneker.Cosmos.Container.Setup

Ensures an Azure Cosmos DB container exists with the package's standard partition key path.

Install

dotnet add package Soenneker.Cosmos.Container.Setup

Registration

using Soenneker.Cosmos.Container.Setup.Registrars;

services.AddCosmosContainerSetupUtilAsSingleton();

Use AddCosmosContainerSetupUtilAsScoped() when the setup service should follow a dependency-injection scope. Its Cosmos database dependency remains a long-lived singleton.

Usage

Use configured Cosmos credentials and the configured default database:

using Microsoft.Azure.Cosmos;
using Soenneker.Cosmos.Container.Setup.Abstract;

ContainerResponse? response = await setup.Ensure("orders", cancellationToken);

Or target an explicit account and database:

ContainerResponse? response = await setup.Ensure(
    endpoint,
    accountKey,
    databaseName,
    containerName,
    cancellationToken);

An overload also accepts an existing Microsoft.Azure.Cosmos.Database handle.

Provisioning behavior

  • Containers are created with partition key path /partitionKey. The path is case-sensitive and must match the serialized document property exactly.
  • No dedicated container throughput is configured; the service uses the database/account throughput behavior.
  • Existing containers are returned by CreateIfNotExistsAsync; the utility does not reconcile partition keys, indexing policies, throughput, or other settings on an existing container.
  • Transient Cosmos, HTTP, and timeout failures are retried up to five times with exponential delay and jitter. Authentication, authorization, and other non-transient Cosmos errors fail immediately.
  • Cancellation stops the active SDK call and retry delays. After retries are exhausted, the final exception propagates to the caller.

ContainerInfo is a public metadata DTO for a container name, partition-key path, and composite indexes. The current Ensure methods do not consume it and always use /partitionKey with the SDK's default indexing policy.

Account keys are credentials. Store them in a secret provider and keep them out of logs and source control.

Product Compatible and additional computed target framework versions.
.NET net11.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Soenneker.Cosmos.Container.Setup:

Package Downloads
Soenneker.Cosmos.Container

A utility library for storing Azure Cosmos containers

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
11.0.2544 0 11/15/2026
11.0.2543 42 11/14/2026
11.0.2542 254 11/12/2026
11.0.2541 116 11/11/2026
11.0.2540 126 11/11/2026
11.0.2539 83 11/11/2026
11.0.2538 124 11/11/2026
11.0.2537 171 11/11/2026
11.0.2536 65 11/11/2026
11.0.2535 169 11/11/2026
11.0.2534 83 11/11/2026
11.0.2533 662 11/7/2026
11.0.2532 248 11/7/2026
11.0.2531 588 11/3/2026
11.0.2530 98 11/3/2026
11.0.2529 189 11/3/2026
11.0.2528 273 11/3/2026
11.0.2527 878 10/29/2026
11.0.2526 351 10/27/2026
11.0.2525 189 10/27/2026
Loading failed

Update dependency Soenneker.Cosmos.Database to 11.0.2803 (#3268)