Cosmos DB - az cosmosdb

Manage Azure Cosmos DB database accounts.

Commands

az cosmosdb check-name-exists Checks that the Azure Cosmos DB account name already 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 Create 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 existing Azure Cosmos DB database account.
az cosmosdb failover-priority-change Changes the failover priority for the Azure Cosmos DB database account.
az cosmosdb list Lists all Azure Cosmos DB database accounts within a given resource group or subscription.
az cosmosdb list-connection-strings Lists the connection strings for the specified Azure Cosmos DB database account.
az cosmosdb list-keys Lists the access keys for the specified Azure Cosmos DB database account.
az cosmosdb list-read-only-keys Lists the read-only access keys for the specified Azure Cosmos DB database account.
az cosmosdb regenerate-key Regenerates an access key for the specified Azure Cosmos DB database account.
az cosmosdb show Retrieves the properties of an existing Azure Cosmos DB database account.
az cosmosdb update Update an existing Azure Cosmos DB database account.

az cosmosdb check-name-exists

Checks that the Azure Cosmos DB account name already exists.

az cosmosdb check-name-exists --name

Required Parameters

--name -n

Name of the Cosmos DB database account.

az cosmosdb create

Create a new Azure Cosmos DB database account.

az cosmosdb create --name
--resource-group
[--default-consistency-level {BoundedStaleness, ConsistentPrefix, Eventual, Session, Strong}]
[--enable-automatic-failover]
[--ip-range-filter]
[--kind {GlobalDocumentDB, MongoDB, Parse}]
[--locations]
[--max-interval]
[--max-staleness-prefix]

Required Parameters

--name -n

Name of the Cosmos DB database account.

--resource-group -g

Name of the resource group.

Optional Parameters

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

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

Space separated locations in 'regionName=failoverPriority' format. E.g "East US"=0 "West US"=1. Failover priority values are 0 for write regions and greater than 0 for read regions. A failover priority value must be unique and less than the total number of regions. Default: single region account in the location of the specified resource group.

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

az cosmosdb delete

Deletes an existing Azure Cosmos DB database account.

az cosmosdb delete --name
--resource-group

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

az cosmosdb failover-priority-change

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

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

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

Optional Parameters

--failover-policies

Space separated failover policies in 'regionName=failoverPriority' format. E.g "East US"=0 "West US"=1.

az cosmosdb list

Lists all Azure Cosmos DB database accounts within a given resource group or subscription.

az cosmosdb list [--resource-group]

Optional Parameters

--resource-group -g

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

az cosmosdb list-connection-strings

Lists the connection strings for the specified Azure Cosmos DB database account.

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

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

az cosmosdb list-keys

Lists the access keys for the specified Azure Cosmos DB database account.

az cosmosdb list-keys --name
--resource-group

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

az cosmosdb list-read-only-keys

Lists the read-only access keys for the specified Azure Cosmos DB database account.

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

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

az cosmosdb regenerate-key

Regenerates an access key for the specified Azure Cosmos DB database account.

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

Required Parameters

--key-kind

The access key to regenerate.

accepted values: primary, primaryReadonly, secondary, secondaryReadonly
--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=.

az cosmosdb show

Retrieves the properties of an existing Azure Cosmos DB database account.

az cosmosdb show --name
--resource-group

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

az cosmosdb update

Update an existing Azure Cosmos DB database account.

az cosmosdb update --name
--resource-group
[--default-consistency-level {BoundedStaleness, ConsistentPrefix, Eventual, Session, Strong}]
[--enable-automatic-failover]
[--ip-range-filter]
[--locations]
[--max-interval]
[--max-staleness-prefix]

Required Parameters

--name -n

Name of the Cosmos DB database account.

--resource-group -g

Name of the resource group.

Optional Parameters

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

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

Space separated locations in 'regionName=failoverPriority' format. E.g "East US"=0. Failover priority values are 0 for write regions and greater than 0 for read regions. A failover priority value must be unique and less than the total number of regions.

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