共用方式為


AzureCosmosExtensions.AddAzureCosmosDB Method

Definition

Overloads

AddAzureCosmosDB(IDistributedApplicationBuilder, String)

Adds an Azure Cosmos DB connection to the application model.

AddAzureCosmosDB(IDistributedApplicationBuilder, String, Action<IResourceBuilder<AzureCosmosDBResource>, ResourceModuleConstruct,CosmosDBAccount,IEnumerable<CosmosDBSqlDatabase>>)

Adds an Azure Cosmos DB connection to the application model.

AddAzureCosmosDB(IDistributedApplicationBuilder, String)

Source:
AzureCosmosDBExtensions.cs
Source:
AzureCosmosDBExtensions.cs

Adds an Azure Cosmos DB connection to the application model.

public static Aspire.Hosting.ApplicationModel.IResourceBuilder<Aspire.Hosting.AzureCosmosDBResource> AddAzureCosmosDB (this Aspire.Hosting.IDistributedApplicationBuilder builder, string name);
static member AddAzureCosmosDB : Aspire.Hosting.IDistributedApplicationBuilder * string -> Aspire.Hosting.ApplicationModel.IResourceBuilder<Aspire.Hosting.AzureCosmosDBResource>
<Extension()>
Public Function AddAzureCosmosDB (builder As IDistributedApplicationBuilder, name As String) As IResourceBuilder(Of AzureCosmosDBResource)

Parameters

name
String

The name of the resource. This name will be used as the connection string name when referenced in a dependency.

Returns

A reference to the IResourceBuilder<T>.

Applies to

AddAzureCosmosDB(IDistributedApplicationBuilder, String, Action<IResourceBuilder<AzureCosmosDBResource>, ResourceModuleConstruct,CosmosDBAccount,IEnumerable<CosmosDBSqlDatabase>>)

Source:
AzureCosmosDBExtensions.cs

Adds an Azure Cosmos DB connection to the application model.

public static Aspire.Hosting.ApplicationModel.IResourceBuilder<Aspire.Hosting.AzureCosmosDBResource> AddAzureCosmosDB (this Aspire.Hosting.IDistributedApplicationBuilder builder, string name, Action<Aspire.Hosting.ApplicationModel.IResourceBuilder<Aspire.Hosting.AzureCosmosDBResource>,Aspire.Hosting.ResourceModuleConstruct,Azure.Provisioning.CosmosDB.CosmosDBAccount,System.Collections.Generic.IEnumerable<Azure.Provisioning.CosmosDB.CosmosDBSqlDatabase>>? configureResource);
static member AddAzureCosmosDB : Aspire.Hosting.IDistributedApplicationBuilder * string * Action<Aspire.Hosting.ApplicationModel.IResourceBuilder<Aspire.Hosting.AzureCosmosDBResource>, Aspire.Hosting.ResourceModuleConstruct, Azure.Provisioning.CosmosDB.CosmosDBAccount, seq<Azure.Provisioning.CosmosDB.CosmosDBSqlDatabase>> -> Aspire.Hosting.ApplicationModel.IResourceBuilder<Aspire.Hosting.AzureCosmosDBResource>
<Extension()>
Public Function AddAzureCosmosDB (builder As IDistributedApplicationBuilder, name As String, configureResource As Action(Of IResourceBuilder(Of AzureCosmosDBResource), ResourceModuleConstruct, CosmosDBAccount, IEnumerable(Of CosmosDBSqlDatabase))) As IResourceBuilder(Of AzureCosmosDBResource)

Parameters

name
String

The name of the resource. This name will be used as the connection string name when referenced in a dependency.

Returns

A reference to the IResourceBuilder<T>.

Applies to