-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature Request: Support for hierarchical partition keys in Azure Cosmos DB containers #21743
Comments
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
We're looking forward to this feature, too. Meanwhile we decided to deploy via Terraform everything we can(CosmosDB account, database, "regular" containers) and utilize ARM template to deploy containers with multiple partition keys using
To get ARM template content you can run "Export template" action for your CosmosDB in Azure Portal and copy the part with container you need. Let's say we have only one 'products' container with multiple partition keys, so This way Terraform takes care about everything as far as possible. The only thing we'll need to do is Terraform Hope this may come in handy. |
It seems we can deploy with azapi
|
This may be possible by setting the partition key version =2, and sending the partition key paths in as a string array to the partionKeyPaths property. |
@liamgib, assuming I'm understanding you correctly, it doesn't work: main.tf terraform plan
terraform apply
Variants like `"["/FilePath","/CompanyId","/id"]",etc either end up executed with jsonencode or the same error from escaping. |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Is there an existing issue for this?
Community Note
Description
As a Terraform user, I'd like to be able to create Azure Cosmos DB containers with hierarchical partition keys. Currently, Terraform only supports creating containers with a single partition key path. Supporting hierarchical partition keys would improve usability and performance when working with complex data models that require partitioning based on multiple attributes.
New or Affected Resource(s)/Data Source(s)
azurerm_cosmosdb_sql_container
Potential Terraform Configuration
References
https://learn.microsoft.com/en-us/azure/cosmos-db/hierarchical-partition-keys
The text was updated successfully, but these errors were encountered: