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]
                              [--subscription]
                              [--throughput]
                              [--url-connection]

Required Parameters

--collection-name -c

Collection Name.

--db-name -d

Database Name.

Optional Parameters

--default-ttl

Default TTL. Provide 0 to disable.

--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": "/*" } ], "excludedPaths": [ { "path": "/\"_etag\"/?" } ] }
--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.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--throughput

Offer Throughput (RU/s).

--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]
                              [--subscription]
                              [--url-connection]
                              [--yes]

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.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--url-connection

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

--yes -y

Do not prompt for confirmation.

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]
                              [--subscription]
                              [--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.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--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]
                            [--query-examples]
                            [--resource-group-name]
                            [--subscription]
                            [--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.

--query-examples

Recommend JMESPath string for you. You can copy one of the query and paste it after --query parameter within double quotation marks to see the results. You can add one or more positional keywords so that we can give suggestions based on these key words.

--resource-group-name -g

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

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--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]
                            [--query-examples]
                            [--resource-group-name]
                            [--subscription]
                            [--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.

--query-examples

Recommend JMESPath string for you. You can copy one of the query and paste it after --query parameter within double quotation marks to see the results. You can add one or more positional keywords so that we can give suggestions based on these key words.

--resource-group-name -g

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

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--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]
                              [--subscription]
                              [--throughput]
                              [--url-connection]

Required Parameters

--collection-name -c

Collection Name.

--db-name -d

Database Name.

Optional Parameters

--default-ttl

Default TTL. Provide 0 to disable.

--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.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--throughput

Offer Throughput (RU/s).

--url-connection

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