Search code examples
azureazure-cosmosdbazure-cliazure-cosmosdb-sqlapi

Azure cosmos database for SQL - Is there a way to create container having hierarchical partition keys from azure cli


I need to create a container in existing azure cosmos database (for NoSQL) with hierarchical partition keys from azure cli. As per documentation, its possible to create a container from azure cli as following.

az cosmosdb sql container create -g MyResourceGroup -a MyAccount -d MyDatabase -n MyContainer --partition-key-path "/my/path"

The container i want create uses a recently added feature called hierarchical partition keys. Wanted to know if there is a way to mention the hierarchical partition keys from cli command. Documentation does not mention anything regarding this.


Solution

  • currently creation of containers with Hierarchical partition keys are supported only with SDKs that too with .Net and Java. Javascript beta version supports it as of now. You can read more about the supported versions from here