# AzureCosmosDBContainerResource

- Kind: `class`
- Package: [Aspire.Hosting.Azure.CosmosDB](/reference/api/csharp/aspire.hosting.azure.cosmosdb.md)
- Version: `13.4.0`
- Namespace: `Aspire.Hosting.Azure`
- Target framework: `net8.0`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/cbc352350f1a9bafbaff10d14a2c8de4ac186a48/src/Aspire.Hosting.Azure.CosmosDB/AzureCosmosDBContainerResource.cs)
- Inherits: `Resource`
- Implements: `IExpressionValue`, `IManifestExpressionProvider`, `IResource`, `IResourceWithConnectionString`, `IResourceWithParent`, `IResourceWithParent<AzureCosmosDBDatabaseResource>`, `IValueProvider`, `IValueWithReferences`, `IResourceWithAzureFunctionsConfig`

Represents an Azure Cosmos DB Database Container.

## Definition

```csharp
namespace Aspire.Hosting.Azure;

public class AzureCosmosDBContainerResource
    : Aspire.Hosting.ApplicationModel.Resource,
      Aspire.Hosting.ApplicationModel.IExpressionValue,
      Aspire.Hosting.ApplicationModel.IManifestExpressionProvider,
      Aspire.Hosting.ApplicationModel.IResource,
      Aspire.Hosting.ApplicationModel.IResourceWithConnectionString,
      Aspire.Hosting.ApplicationModel.IResourceWithParent,
      Aspire.Hosting.ApplicationModel.IResourceWithParent<Aspire.Hosting.Azure.AzureCosmosDBDatabaseResource>,
      Aspire.Hosting.ApplicationModel.IValueProvider,
      Aspire.Hosting.ApplicationModel.IValueWithReferences,
      Aspire.Hosting.Azure.IResourceWithAzureFunctionsConfig
{
    // ...
}
```

## Remarks

Use `AzureProvisioningResourceExtensions.ConfigureInfrastructure` to configure specific `Azure.Provisioning` properties.

## Constructors

- [AzureCosmosDBContainerResource(string, string, IEnumerable<string>, AzureCosmosDBDatabaseResource)](/reference/api/csharp/aspire.hosting.azure.cosmosdb/azurecosmosdbcontainerresource/constructors.md#constructor-string-string-ienumerable-string-azurecosmosdbdatabaseresource) -- Initializes a new instance of the [AzureCosmosDBContainerResource](/reference/api/csharp/aspire.hosting.azure.cosmosdb/azurecosmosdbcontainerresource.md) class.
- [AzureCosmosDBContainerResource(string, string, string, AzureCosmosDBDatabaseResource)](/reference/api/csharp/aspire.hosting.azure.cosmosdb/azurecosmosdbcontainerresource/constructors.md#constructor-string-string-string-azurecosmosdbdatabaseresource) -- Initializes a new instance of the [AzureCosmosDBContainerResource](/reference/api/csharp/aspire.hosting.azure.cosmosdb/azurecosmosdbcontainerresource.md) class.

## Properties

- [ConnectionStringExpression](/reference/api/csharp/aspire.hosting.azure.cosmosdb/azurecosmosdbcontainerresource/properties.md#connectionstringexpression) : `ReferenceExpression` `get` -- Gets the connection string expression for the Azure Cosmos DB Database Container.
- [ContainerName](/reference/api/csharp/aspire.hosting.azure.cosmosdb/azurecosmosdbcontainerresource/properties.md#containername) : `string` `get; set` -- Gets or sets the container name.
- [ContainerProperties](/reference/api/csharp/aspire.hosting.azure.cosmosdb/azurecosmosdbcontainerresource/properties.md#containerproperties) : `ContainerProperties` `get` -- Gets the container properties for this azure cosmos db container resource.
- [Parent](/reference/api/csharp/aspire.hosting.azure.cosmosdb/azurecosmosdbcontainerresource/properties.md#parent) : [AzureCosmosDBDatabaseResource](/reference/api/csharp/aspire.hosting.azure.cosmosdb/azurecosmosdbdatabaseresource.md) `get` -- Gets the parent Azure Cosmos DB database resource.
- [PartitionKeyPath](/reference/api/csharp/aspire.hosting.azure.cosmosdb/azurecosmosdbcontainerresource/properties.md#partitionkeypath) : `string` `get; set` -- Gets or sets the partition key path.
- [PartitionKeyPaths](/reference/api/csharp/aspire.hosting.azure.cosmosdb/azurecosmosdbcontainerresource/properties.md#partitionkeypaths) : `IReadOnlyList<string>` `get; set` -- Gets or sets the hierarchical partition keys.
