AzureCosmosExtensions.AddContainer Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Adds a container to the associated Cosmos DB database resource.
public static Aspire.Hosting.ApplicationModel.IResourceBuilder<Aspire.Hosting.Azure.AzureCosmosDBContainerResource> AddContainer(this Aspire.Hosting.ApplicationModel.IResourceBuilder<Aspire.Hosting.Azure.AzureCosmosDBDatabaseResource> builder, string name, string partitionKeyPath, string? containerName = default);
static member AddContainer : Aspire.Hosting.ApplicationModel.IResourceBuilder<Aspire.Hosting.Azure.AzureCosmosDBDatabaseResource> * string * string * string -> Aspire.Hosting.ApplicationModel.IResourceBuilder<Aspire.Hosting.Azure.AzureCosmosDBContainerResource>
<Extension()>
Public Function AddContainer (builder As IResourceBuilder(Of AzureCosmosDBDatabaseResource), name As String, partitionKeyPath As String, Optional containerName As String = Nothing) As IResourceBuilder(Of AzureCosmosDBContainerResource)
Parameters
CosmosDBDatabase resource builder.
- name
- String
Name of container resource.
- partitionKeyPath
- String
Partition key path for the container.
- containerName
- String
The name of the container. If not provided, this defaults to the same value as name
.
Returns
A reference to the IResourceBuilder<T>.