Reputation:
I'm trying to figure out how to specify a 10GB fixed size when creating a new Cosmos DB collection using the Azure CLI. The az cosmosdb collection create command does not let you specify that. Must be right in my face but I can't see how can I achieve this.
az cosmosdb collection create --collection-name
--db-name
[--default-ttl]
[--indexing-policy]
[--key]
[--name]
[--partition-key-path]
[--resource-group-name]
[--throughput]
[--url-connection]
Upvotes: 2
Views: 638
Reputation: 71066
When using the CLI, you can create both fixed (10GB) and unlimited collections. The primary difference is whether you specify the partition key (and then specify throughput within the valid range for either fixed or unlimited collection). Partition key is required for unlimited collections.
For example, I just ran these two commands:
az cosmosdb collection create -d stackoverflow -c test1
--name <mycosmosaccountname> --key "<mycosmosaccountkey>"
--throughput 400
az cosmosdb collection create -d stackoverflow -c test2
--name <mycosmosaccountname> --key "<mycosmosaccountkey>"
--partition-key-path "/foo" --throughput 3000
This created both a 10GB collection and an unlimited collection:
Upvotes: 1
Reputation: 11591
By default when you use the Azure CLI, the collection is created with a FIXED storage amout of 10Gb.
I ran this command
az cosmosdb collection create --collection-name "hither" --db-name "Lightning" --name "toannsss"--db-name "Lightning" --resource-group-name "rsgroup" --name "toanns" --key "YourKey" --url-connection "https://toanns.documents.azure.com:443/"
I don't think there is an option to create unlimited size collection yet from Azure CLI as at 22/07/2018
Upvotes: 0