Skip to content
Docs Try Aspire

AspireMicrosoftAzureCosmosExtensions

Class static net10.0
📦 Aspire.Microsoft.Azure.Cosmos v13.1.2
Azure Cosmos DB extension
namespace Microsoft.Extensions.Hosting;
public static class AspireMicrosoftAzureCosmosExtensions
{
// ...
}
AddAzureCosmosClient(IHostApplicationBuilder, string, Action<MicrosoftAzureCosmosSettings>, Action<CosmosClientOptions>)extension
Registers Cosmos.CosmosClient as a singleton in the services provided by the builder. Configures logging and telemetry for the Cosmos.CosmosClient.
AddAzureCosmosContainer(IHostApplicationBuilder, string, Action<MicrosoftAzureCosmosSettings>, Action<CosmosClientOptions>)extension
Registers the Cosmos.Container as a singleton in the services provided by the builder.
AddAzureCosmosDatabase(IHostApplicationBuilder, string, Action<MicrosoftAzureCosmosSettings>, Action<CosmosClientOptions>)extension
Registers the Cosmos.Database as a singleton the services provided by the builder and returns a CosmosDatabaseBuilder to support chaining multiple container registrations against the same database.
AddKeyedAzureCosmosClient(IHostApplicationBuilder, string, Action<MicrosoftAzureCosmosSettings>, Action<CosmosClientOptions>)extension
Registers the Cosmos.CosmosClient as a singleton for given name in the services provided by the builder. Configures logging and telemetry for the Cosmos.CosmosClient.
AddKeyedAzureCosmosContainer(IHostApplicationBuilder, string, Action<MicrosoftAzureCosmosSettings>, Action<CosmosClientOptions>)extension
Registers the Cosmos.Container as a singleton for given name in the services provided by the builder.
AddKeyedAzureCosmosDatabase(IHostApplicationBuilder, string, Action<MicrosoftAzureCosmosSettings>, Action<CosmosClientOptions>)extension
Registers the Cosmos.Database as a singleton for given name in the services provided by the builder and returns a CosmosDatabaseBuilder to support chaining multiple container registrations against the same database.
View all methods