az cosmosdb collection

Manage Azure Cosmos DB collections.

Commands

az cosmosdb collection create Creates an Azure Cosmos DB collection.
az cosmosdb collection delete Deletes an Azure Cosmos DB collection.
az cosmosdb collection exists Returns a boolean indicating whether the collection exists.
az cosmosdb collection list Lists all Azure Cosmos DB collections.
az cosmosdb collection show Shows an Azure Cosmos DB collection and its offer.
az cosmosdb collection update Updates an Azure Cosmos DB collection.

az cosmosdb collection create

Creates an Azure Cosmos DB collection.

az cosmosdb collection create --collection-name
--db-name
[--default-ttl]
[--indexing-policy]
[--key]
[--name]
[--partition-key-path]
[--resource-group-name]
[--throughput]
[--url-connection]

Required Parameters

--collection-name -c

Collection Name.

--db-name -d

Database Name.

Optional Parameters

--default-ttl

Default TTL.

--indexing-policy

Indexing Policy, you can enter it as a string or as a file, e.g., --indexing-policy @policy-file.json).

default value: { "indexingMode": "consistent", "automatic": true, "includedPaths": [ { "path": "/*", "indexes": [ { "kind": "Range", "dataType": "String", "precision": -1 }, { "kind": "Range", "dataType": "Number", "precision": -1 } ] } ] }
--key

Cosmos DB account key. Must be used in conjunction with cosmosdb account name or url-connection.

--name -n

Cosmos DB account name. Must be used in conjunction with either name of the resource group or cosmosdb account key.

--partition-key-path

Partition Key Path, e.g., '/properties/name'.

--resource-group-name -g

Name of the resource group. Must be used in conjunction with cosmosdb account name.

--throughput

Offer Throughput.

--url-connection

Cosmos DB account url connection. Must be used in conjunction with cosmosdb account key.

az cosmosdb collection delete

Deletes an Azure Cosmos DB collection.

az cosmosdb collection delete --collection-name
--db-name
[--key]
[--name]
[--resource-group-name]
[--url-connection]

Required Parameters

--collection-name -c

Collection Name.

--db-name -d

Database Name.

Optional Parameters

--key

Cosmos DB account key. Must be used in conjunction with cosmosdb account name or url-connection.

--name -n

Cosmos DB account name. Must be used in conjunction with either name of the resource group or cosmosdb account key.

--resource-group-name -g

Name of the resource group. Must be used in conjunction with cosmosdb account name.

--url-connection

Cosmos DB account url connection. Must be used in conjunction with cosmosdb account key.

az cosmosdb collection exists

Returns a boolean indicating whether the collection exists.

az cosmosdb collection exists --collection-name
--db-name
[--key]
[--name]
[--resource-group-name]
[--url-connection]

Required Parameters

--collection-name -c

Collection Name.

--db-name -d

Database Name.

Optional Parameters

--key

Cosmos DB account key. Must be used in conjunction with cosmosdb account name or url-connection.

--name -n

Cosmos DB account name. Must be used in conjunction with either name of the resource group or cosmosdb account key.

--resource-group-name -g

Name of the resource group. Must be used in conjunction with cosmosdb account name.

--url-connection

Cosmos DB account url connection. Must be used in conjunction with cosmosdb account key.

az cosmosdb collection list

Lists all Azure Cosmos DB collections.

az cosmosdb collection list --db-name
[--key]
[--name]
[--resource-group-name]
[--url-connection]

Required Parameters

--db-name -d

Database Name.

Optional Parameters

--key

Cosmos DB account key. Must be used in conjunction with cosmosdb account name or url-connection.

--name -n

Cosmos DB account name. Must be used in conjunction with either name of the resource group or cosmosdb account key.

--resource-group-name -g

Name of the resource group. Must be used in conjunction with cosmosdb account name.

--url-connection

Cosmos DB account url connection. Must be used in conjunction with cosmosdb account key.

az cosmosdb collection show

Shows an Azure Cosmos DB collection and its offer.

az cosmosdb collection show --collection-name
--db-name
[--key]
[--name]
[--resource-group-name]
[--url-connection]

Required Parameters

--collection-name -c

Collection Name.

--db-name -d

Database Name.

Optional Parameters

--key

Cosmos DB account key. Must be used in conjunction with cosmosdb account name or url-connection.

--name -n

Cosmos DB account name. Must be used in conjunction with either name of the resource group or cosmosdb account key.

--resource-group-name -g

Name of the resource group. Must be used in conjunction with cosmosdb account name.

--url-connection

Cosmos DB account url connection. Must be used in conjunction with cosmosdb account key.

az cosmosdb collection update

Updates an Azure Cosmos DB collection.

az cosmosdb collection update --collection-name
--db-name
[--default-ttl]
[--indexing-policy]
[--key]
[--name]
[--resource-group-name]
[--throughput]
[--url-connection]

Required Parameters

--collection-name -c

Collection Name.

--db-name -d

Database Name.

Optional Parameters

--default-ttl

Default TTL.

--indexing-policy

Indexing Policy, you can enter it as a string or as a file, e.g., --indexing-policy @policy-file.json).

--key

Cosmos DB account key. Must be used in conjunction with cosmosdb account name or url-connection.

--name -n

Cosmos DB account name. Must be used in conjunction with either name of the resource group or cosmosdb account key.

--resource-group-name -g

Name of the resource group. Must be used in conjunction with cosmosdb account name.

--throughput

Offer Throughput.

--url-connection

Cosmos DB account url connection. Must be used in conjunction with cosmosdb account key.