az cosmosdb

Manage Azure Cosmos DB database accounts.

Commands

az cosmosdb cassandra Manage Cassandra resources of Azure Cosmos DB account.
az cosmosdb cassandra keyspace Manage Azure Cosmos DB Cassandra keyspaces.
az cosmosdb cassandra keyspace create Create an Cassandra keyspace under an Azure Cosmos DB account.
az cosmosdb cassandra keyspace delete Delete the Cassandra keyspace under an Azure Cosmos DB account.
az cosmosdb cassandra keyspace list List the Cassandra keyspaces under an Azure Cosmos DB account.
az cosmosdb cassandra keyspace show Show the details of a Cassandra keyspace under an Azure Cosmos DB account.
az cosmosdb cassandra keyspace throughput Manage throughput of Cassandra keyspace under an Azure Cosmos DB account.
az cosmosdb cassandra keyspace throughput show Get the throughput of the Cassandra keyspace under an Azure Cosmos DB account.
az cosmosdb cassandra keyspace throughput update Update the throughput of the Cassandra keyspace under an Azure Cosmos DB account.
az cosmosdb cassandra table Manage Azure Cosmos DB Cassandra tables.
az cosmosdb cassandra table create Create an Cassandra table under an Azure Cosmos DB Cassandra keyspace.
az cosmosdb cassandra table delete Delete the Cassandra table under an Azure Cosmos DB Cassandra keyspace.
az cosmosdb cassandra table list List the Cassandra tables under an Azure Cosmos DB Cassandra keyspace.
az cosmosdb cassandra table show Show the details of a Cassandra table under an Azure Cosmos DB Cassandra keyspace.
az cosmosdb cassandra table throughput Manage throughput of Cassandra table under an Azure Cosmos DB account.
az cosmosdb cassandra table throughput show Get the throughput of the Cassandra table under an Azure Cosmos DB Cassandra keyspace.
az cosmosdb cassandra table throughput update Update the throughput of the Cassandra table under an Azure Cosmos DB Cassandra keyspace.
az cosmosdb cassandra table update Update an Cassandra table under an Azure Cosmos DB Cassandra keyspace.
az cosmosdb check-name-exists Checks if an Azure Cosmos DB account name exists.
az cosmosdb collection Manage Azure Cosmos DB collections.
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 create Creates a new Azure Cosmos DB database account.
az cosmosdb database Manage Azure Cosmos DB databases.
az cosmosdb database create Creates an Azure Cosmos DB database.
az cosmosdb database delete Deletes an Azure Cosmos DB database.
az cosmosdb database exists Returns a boolean indicating whether the database exists.
az cosmosdb database list Lists all Azure Cosmos DB databases.
az cosmosdb database show Shows an Azure Cosmos DB database.
az cosmosdb delete Deletes an Azure Cosmos DB database account.
az cosmosdb failover-priority-change Changes the failover priority for the Azure Cosmos DB database account.
az cosmosdb gremlin Manage Gremlin resources of Azure Cosmos DB account.
az cosmosdb gremlin database Manage Azure Cosmos DB Gremlin databases.
az cosmosdb gremlin database create Create an Gremlin database under an Azure Cosmos DB account.
az cosmosdb gremlin database delete Delete the Gremlin database under an Azure Cosmos DB account.
az cosmosdb gremlin database list List the Gremlin databases under an Azure Cosmos DB account.
az cosmosdb gremlin database show Show the details of a Gremlin database under an Azure Cosmos DB account.
az cosmosdb gremlin database throughput Manage throughput of Gremlin database under an Azure Cosmos DB account.
az cosmosdb gremlin database throughput show Get the throughput of the Gremlin database under an Azure Cosmos DB account.
az cosmosdb gremlin database throughput update Update the throughput of the Gremlin database under an Azure Cosmos DB account.
az cosmosdb gremlin graph Manage Azure Cosmos DB Gremlin graphs.
az cosmosdb gremlin graph create Create an Gremlin graph under an Azure Cosmos DB Gremlin database.
az cosmosdb gremlin graph delete Delete the Gremlin graph under an Azure Cosmos DB Gremlin database.
az cosmosdb gremlin graph list List the Gremlin graphs under an Azure Cosmos DB Gremlin database.
az cosmosdb gremlin graph show Show the details of a Gremlin graph under an Azure Cosmos DB Gremlin database.
az cosmosdb gremlin graph throughput Manage throughput of Gremlin graph under an Azure Cosmos DB account.
az cosmosdb gremlin graph throughput show Get the throughput of the Gremlin graph under an Azure Cosmos DB Gremlin database.
az cosmosdb gremlin graph throughput update Update the throughput of the Gremlin graph under an Azure Cosmos DB Gremlin database.
az cosmosdb gremlin graph update Update an Gremlin graph under an Azure Cosmos DB Gremlin database.
az cosmosdb keys Manage Azure Comsos DB keys.
az cosmosdb keys list List the access keys or connection strings for a Azure Cosmos DB database account.
az cosmosdb keys regenerate Regenerates an access key for the specified Azure Cosmos DB database account.
az cosmosdb list List Azure Cosmos DB database accounts.
az cosmosdb list-connection-strings List the connection strings for a Azure Cosmos DB database account.
az cosmosdb list-keys List the access keys for a Azure Cosmos DB database account.
az cosmosdb list-read-only-keys List the read-only access keys for a Azure Cosmos DB database account.
az cosmosdb mongodb Manage MongoDB resources of Azure Cosmos DB account.
az cosmosdb mongodb collection Manage Azure Cosmos DB MongoDB collections.
az cosmosdb mongodb collection create Create an MongoDB collection under an Azure Cosmos DB MongoDB database.
az cosmosdb mongodb collection delete Delete the MongoDB collection under an Azure Cosmos DB MongoDB database.
az cosmosdb mongodb collection list List the MongoDB collections under an Azure Cosmos DB MongoDB database.
az cosmosdb mongodb collection show Show the details of a MongoDB collection under an Azure Cosmos DB MongoDB database.
az cosmosdb mongodb collection throughput Manage throughput of MongoDB collection under an Azure Cosmos DB account.
az cosmosdb mongodb collection throughput show Get the throughput of the MongoDB collection under an Azure Cosmos DB MongoDB database.
az cosmosdb mongodb collection throughput update Update the throughput of the MongoDB collection under an Azure Cosmos DB MongoDB database.
az cosmosdb mongodb collection update Update an MongoDB collection under an Azure Cosmos DB MongoDB database.
az cosmosdb mongodb database Manage Azure Cosmos DB MongoDB databases.
az cosmosdb mongodb database create Create an MongoDB database under an Azure Cosmos DB account.
az cosmosdb mongodb database delete Delete the MongoDB database under an Azure Cosmos DB account.
az cosmosdb mongodb database list List the MongoDB databases under an Azure Cosmos DB account.
az cosmosdb mongodb database show Show the details of a MongoDB database under an Azure Cosmos DB account.
az cosmosdb mongodb database throughput Manage throughput of MongoDB database under an Azure Cosmos DB account.
az cosmosdb mongodb database throughput show Get the throughput of the MongoDB database under an Azure Cosmos DB account.
az cosmosdb mongodb database throughput update Update the throughput of the MongoDB database under an Azure Cosmos DB account.
az cosmosdb network-rule Manage Azure Comsos DB network rules.
az cosmosdb network-rule add Adds a virtual network rule to an existing Cosmos DB database account.
az cosmosdb network-rule list Lists the virtual network accounts associated with a Cosmos DB account.
az cosmosdb network-rule remove Adds a virtual network rule to an existing Cosmos DB database account.
az cosmosdb regenerate-key Regenerate an access key for a Azure Cosmos DB database account.
az cosmosdb show Get the details of an Azure Cosmos DB database account.
az cosmosdb sql Manage SQL resources of Azure Cosmos DB account.
az cosmosdb sql container Manage Azure Cosmos DB SQL containers.
az cosmosdb sql container create Create an SQL container under an Azure Cosmos DB SQL database.
az cosmosdb sql container delete Delete the SQL container under an Azure Cosmos DB SQL database.
az cosmosdb sql container list List the SQL containers under an Azure Cosmos DB SQL database.
az cosmosdb sql container show Show the details of a SQL container under an Azure Cosmos DB SQL database.
az cosmosdb sql container throughput Manage throughput of SQL container under an Azure Cosmos DB account.
az cosmosdb sql container throughput show Get the throughput of the SQL container under an Azure Cosmos DB SQL database.
az cosmosdb sql container throughput update Update the throughput of the SQL container under an Azure Cosmos DB SQL database.
az cosmosdb sql container update Update an SQL container under an Azure Cosmos DB SQL database.
az cosmosdb sql database Manage Azure Cosmos DB SQL databases.
az cosmosdb sql database create Create an SQL database under an Azure Cosmos DB account.
az cosmosdb sql database delete Delete the SQL database under an Azure Cosmos DB account.
az cosmosdb sql database list List the SQL databases under an Azure Cosmos DB account.
az cosmosdb sql database show Show the details of a SQL database under an Azure Cosmos DB account.
az cosmosdb sql database throughput Manage throughput of SQL database under an Azure Cosmos DB account.
az cosmosdb sql database throughput show Get the throughput of the SQL database under an Azure Cosmos DB account.
az cosmosdb sql database throughput update Update the throughput of the SQL database under an Azure Cosmos DB account.
az cosmosdb table Manage Table resources of Azure Cosmos DB account.
az cosmosdb table create Create an Table under an Azure Cosmos DB account.
az cosmosdb table delete Delete the Table under an Azure Cosmos DB account.
az cosmosdb table list List the Tables under an Azure Cosmos DB account.
az cosmosdb table show Show the details of a Table under an Azure Cosmos DB account.
az cosmosdb table throughput Manage throughput of Table under an Azure Cosmos DB account.
az cosmosdb table throughput show Get the throughput of the Table under an Azure Cosmos DB account.
az cosmosdb table throughput update Update the throughput of the Table under an Azure Cosmos DB account.
az cosmosdb update Update an Azure Cosmos DB database account.

az cosmosdb check-name-exists

Checks if an Azure Cosmos DB account name exists.

az cosmosdb check-name-exists [--ids]
[--name]
[--subscription]

Examples

Checks if an Azure Cosmos DB account name exists. (autogenerated)

az cosmosdb check-name-exists --name MyCosmosDBDatabaseAccount

Optional Parameters

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. If provided, no other 'Resource Id' arguments should be specified.

--name -n

Name of the Cosmos DB database account.

--subscription

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

az cosmosdb create

Creates a new Azure Cosmos DB database account.

az cosmosdb create --name
--resource-group
[--capabilities]
[--default-consistency-level {BoundedStaleness, ConsistentPrefix, Eventual, Session, Strong}]
[--enable-automatic-failover {false, true}]
[--enable-multiple-write-locations {false, true}]
[--enable-virtual-network {false, true}]
[--ip-range-filter]
[--kind {GlobalDocumentDB, MongoDB, Parse}]
[--locations]
[--max-interval]
[--max-staleness-prefix]
[--subscription]
[--tags]
[--virtual-network-rules]

Examples

Creates a new Azure Cosmos DB database account. (autogenerated)

az cosmosdb create --name MyCosmosDBDatabaseAccount --resource-group MyResourceGroup --subscription MySubscription

Creates a new Azure Cosmos DB database account with two regions. UK South is zone redundant.

az cosmosdb create -n myaccount -g mygroup --locations regionName=eastus failoverPriority=0 isZoneRedundant=False --locations regionName=uksouth failoverPriority=1 isZoneRedundant=True --enable-multiple-write-locations

Required Parameters

--name -n

Name of the Cosmos DB database account.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Optional Parameters

--capabilities

Set custom capabilities on the Cosmos DB database account.

--default-consistency-level

Default consistency level of the Cosmos DB database account.

accepted values: BoundedStaleness, ConsistentPrefix, Eventual, Session, Strong
--enable-automatic-failover

Enables automatic failover of the write region in the rare event that the region is unavailable due to an outage. Automatic failover will result in a new write region for the account and is chosen based on the failover priorities configured for the account.

accepted values: false, true
--enable-multiple-write-locations

Enable Multiple Write Locations.

accepted values: false, true
--enable-virtual-network

Enables virtual network on the Cosmos DB database account.

accepted values: false, true
--ip-range-filter

Firewall support. Specifies the set of IP addresses or IP address ranges in CIDR form to be included as the allowed list of client IPs for a given database account. IP addresses/ranges must be comma-separated and must not contain any spaces.

--kind

The type of Cosmos DB database account to create.

accepted values: GlobalDocumentDB, MongoDB, Parse
default value: GlobalDocumentDB
--locations

Add a location to the Cosmos DB database account.

--max-interval

When used with Bounded Staleness consistency, this value represents the time amount of staleness (in seconds) tolerated. Accepted range for this value is 1 - 100.

default value: 5
--max-staleness-prefix

When used with Bounded Staleness consistency, this value represents the number of stale requests tolerated. Accepted range for this value is 1 - 2,147,483,647.

default value: 100
--subscription

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

--tags

Space-separated tags in 'key[=value]' format. Use "" to clear existing tags.

--virtual-network-rules

ACL's for virtual network.

az cosmosdb delete

Deletes an Azure Cosmos DB database account.

az cosmosdb delete [--ids]
[--name]
[--resource-group]
[--subscription]

Examples

Deletes an Azure Cosmos DB database account. (autogenerated)

az cosmosdb delete --name MyCosmosDBDatabaseAccount --resource-group MyResourceGroup

Optional Parameters

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. If provided, no other 'Resource Id' arguments should be specified.

--name -n

Name of the Cosmos DB database account.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--subscription

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

az cosmosdb failover-priority-change

Changes the failover priority for the Azure Cosmos DB database account.

az cosmosdb failover-priority-change --failover-policies
[--ids]
[--name]
[--resource-group]
[--subscription]

Examples

Changes the failover priority for the Azure Cosmos DB database account. (autogenerated)

az cosmosdb failover-priority-change --failover-policies regionName=failoverPriority --name MyCosmosDBDatabaseAccount --resource-group MyResourceGroup

Required Parameters

--failover-policies

Space-separated failover policies in 'regionName=failoverPriority' format. E.g eastus=0 westus=1.

Optional Parameters

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. If provided, no other 'Resource Id' arguments should be specified.

--name -n

Name of the Cosmos DB database account.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--subscription

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

az cosmosdb list

List Azure Cosmos DB database accounts.

az cosmosdb list [--resource-group]
[--subscription]

Optional Parameters

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--subscription

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

az cosmosdb list-connection-strings

List the connection strings for a Azure Cosmos DB database account.

az cosmosdb list-connection-strings [--ids]
[--name]
[--resource-group]
[--subscription]

Examples

List the connection strings for a Azure Cosmos DB database account. (autogenerated)

az cosmosdb list-connection-strings --name MyCosmosDBDatabaseAccount --resource-group MyResourceGroup

Optional Parameters

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. If provided, no other 'Resource Id' arguments should be specified.

--name -n

Name of the Cosmos DB database account.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--subscription

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

az cosmosdb list-keys

List the access keys for a Azure Cosmos DB database account.

az cosmosdb list-keys [--ids]
[--name]
[--resource-group]
[--subscription]

Examples

List the access keys for a Azure Cosmos DB database account. (autogenerated)

az cosmosdb list-keys --name MyCosmosDBDatabaseAccount --resource-group MyResourceGroup --subscription MySubscription

Optional Parameters

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. If provided, no other 'Resource Id' arguments should be specified.

--name -n

Name of the Cosmos DB database account.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--subscription

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

az cosmosdb list-read-only-keys

List the read-only access keys for a Azure Cosmos DB database account.

az cosmosdb list-read-only-keys [--ids]
[--name]
[--resource-group]
[--subscription]

Examples

List the read-only access keys for a Azure Cosmos DB database account. (autogenerated)

az cosmosdb list-read-only-keys --name MyCosmosDBDatabaseAccount --resource-group MyResourceGroup

Optional Parameters

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. If provided, no other 'Resource Id' arguments should be specified.

--name -n

Name of the Cosmos DB database account.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--subscription

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

az cosmosdb regenerate-key

Regenerate an access key for a Azure Cosmos DB database account.

az cosmosdb regenerate-key --key-kind {primary, primaryReadonly, secondary, secondaryReadonly}
[--ids]
[--name]
[--resource-group]
[--subscription]

Examples

Regenerate an access key for a Azure Cosmos DB database account. (autogenerated)

az cosmosdb regenerate-key --key-kind primary --name MyCosmosDBDatabaseAccount --resource-group MyResourceGroup

Required Parameters

--key-kind

The access key to regenerate.

accepted values: primary, primaryReadonly, secondary, secondaryReadonly

Optional Parameters

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. If provided, no other 'Resource Id' arguments should be specified.

--name -n

Name of the Cosmos DB database account.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--subscription

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

az cosmosdb show

Get the details of an Azure Cosmos DB database account.

az cosmosdb show [--ids]
[--name]
[--resource-group]
[--subscription]

Examples

Get the details of an Azure Cosmos DB database account. (autogenerated)

az cosmosdb show --name MyCosmosDBDatabaseAccount --resource-group MyResourceGroup

Optional Parameters

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. If provided, no other 'Resource Id' arguments should be specified.

--name -n

Name of the Cosmos DB database account.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--subscription

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

az cosmosdb update

Update an Azure Cosmos DB database account.

az cosmosdb update [--capabilities]
[--default-consistency-level {BoundedStaleness, ConsistentPrefix, Eventual, Session, Strong}]
[--enable-automatic-failover {false, true}]
[--enable-multiple-write-locations {false, true}]
[--enable-virtual-network {false, true}]
[--ids]
[--ip-range-filter]
[--locations]
[--max-interval]
[--max-staleness-prefix]
[--name]
[--resource-group]
[--subscription]
[--tags]
[--virtual-network-rules]

Examples

Update an Azure Cosmos DB database account. (autogenerated)

az cosmosdb update --capabilities EnableGremlin --name MyCosmosDBDatabaseAccount --resource-group MyResourceGroup

Creates a new Azure Cosmos DB database account with two regions. UK South is zone redundant.

az cosmosdb update -n myaccount -g mygroup --locations regionName=eastus failoverPriority=0 isZoneRedundant=False --locations regionName=uksouth failoverPriority=1 isZoneRedundant=True --enable-multiple-write-locations

Optional Parameters

--capabilities

Set custom capabilities on the Cosmos DB database account.

--default-consistency-level

Default consistency level of the Cosmos DB database account.

accepted values: BoundedStaleness, ConsistentPrefix, Eventual, Session, Strong
--enable-automatic-failover

Enables automatic failover of the write region in the rare event that the region is unavailable due to an outage. Automatic failover will result in a new write region for the account and is chosen based on the failover priorities configured for the account.

accepted values: false, true
--enable-multiple-write-locations

Enable Multiple Write Locations.

accepted values: false, true
--enable-virtual-network

Enables virtual network on the Cosmos DB database account.

accepted values: false, true
--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. If provided, no other 'Resource Id' arguments should be specified.

--ip-range-filter

Firewall support. Specifies the set of IP addresses or IP address ranges in CIDR form to be included as the allowed list of client IPs for a given database account. IP addresses/ranges must be comma-separated and must not contain any spaces.

--locations

Add a location to the Cosmos DB database account.

--max-interval

When used with Bounded Staleness consistency, this value represents the time amount of staleness (in seconds) tolerated. Accepted range for this value is 1 - 100.

--max-staleness-prefix

When used with Bounded Staleness consistency, this value represents the number of stale requests tolerated. Accepted range for this value is 1 - 2,147,483,647.

--name -n

Name of the Cosmos DB database account.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--subscription

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

--tags

Space-separated tags in 'key[=value]' format. Use "" to clear existing tags.

--virtual-network-rules

ACL's for virtual network.