Aspirerelease/17.0
Watch Aspire live streamsDocsTry Aspire

AddCosmosDatabase

Method
📦 Aspire.Hosting.Azure.CosmosDB v17.0.0
func (AzureCosmosDBResource) AddCosmosDatabase(
name string,
options ...*AddCosmosDatabaseOptions,
) AzureCosmosDBDatabaseResource

Signature

methodAddCosmosDatabasebuilder
Adds a database to the associated Cosmos DB account resource.
AddCosmosDatabase(
name string,
options ...*AddCosmosDatabaseOptions,
) AzureCosmosDBDatabaseResource
namestringThe name of the database resource.
options...*AddCosmosDatabaseOptionsOptional settings, described under Options.

Optional parameters are passed in a trailing options ...*AddCosmosDatabaseOptions argument.

DatabaseName*stringThe name of the database. If not provided, this defaults to the same value as name.
AzureCosmosDBDatabaseResource

The resource builder.

Returns a handle; failures surface later via Err().

Applies to

This method applies to the following types: