# AzureCosmosDBContainerResource Constructors

- Package: [Aspire.Hosting.Azure.CosmosDB](/reference/api/csharp/aspire.hosting.azure.cosmosdb.md)
- Type: [AzureCosmosDBContainerResource](/reference/api/csharp/aspire.hosting.azure.cosmosdb/azurecosmosdbcontainerresource.md)
- Kind: `Constructors`
- Members: `2`

Represents an Azure Cosmos DB Database Container.

## AzureCosmosDBContainerResource(string, string, IEnumerable<string>, AzureCosmosDBDatabaseResource)

- Name: `Constructor(string, string, IEnumerable<string>, AzureCosmosDBDatabaseResource)`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/cbc352350f1a9bafbaff10d14a2c8de4ac186a48/src/Aspire.Hosting.Azure.CosmosDB/AzureCosmosDBContainerResource.cs#L28-L44)

Initializes a new instance of the [AzureCosmosDBContainerResource](/reference/api/csharp/aspire.hosting.azure.cosmosdb/azurecosmosdbcontainerresource.md) class.

```csharp
public class AzureCosmosDBContainerResource
{
    public AzureCosmosDBContainerResource(
        string name,
        string containerName,
        IEnumerable<string> partitionKeyPaths,
        AzureCosmosDBDatabaseResource parent)
    {
        // ...
    }
}
```

## Parameters

- `name` (`string`)
  The resource name.
- `containerName` (`string`)
  The container name.
- `partitionKeyPaths` (`IEnumerable<string>`)
  The hierarchical partition key paths.
- `parent` ([AzureCosmosDBDatabaseResource](/reference/api/csharp/aspire.hosting.azure.cosmosdb/azurecosmosdbdatabaseresource.md))
  The parent Azure Cosmos DB database resource.

## AzureCosmosDBContainerResource(string, string, string, AzureCosmosDBDatabaseResource)

- Name: `Constructor(string, string, string, AzureCosmosDBDatabaseResource)`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/cbc352350f1a9bafbaff10d14a2c8de4ac186a48/src/Aspire.Hosting.Azure.CosmosDB/AzureCosmosDBContainerResource.cs#L53-L59)

Initializes a new instance of the [AzureCosmosDBContainerResource](/reference/api/csharp/aspire.hosting.azure.cosmosdb/azurecosmosdbcontainerresource.md) class.

```csharp
public class AzureCosmosDBContainerResource
{
    public AzureCosmosDBContainerResource(
        string name,
        string containerName,
        string partitionKeyPath,
        AzureCosmosDBDatabaseResource parent)
    {
        // ...
    }
}
```

## Parameters

- `name` (`string`)
  The resource name.
- `containerName` (`string`)
  The container name.
- `partitionKeyPath` (`string`)
  The partition key path.
- `parent` ([AzureCosmosDBDatabaseResource](/reference/api/csharp/aspire.hosting.azure.cosmosdb/azurecosmosdbdatabaseresource.md))
  The parent Azure Cosmos DB database resource.
