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 exists

Checks if an Azure Cosmos DB Cassandra keyspace exists.

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 migrate

Migrate the throughput of the Cassandra keyspace between autoscale and manually provisioned.

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 exists

Checks if an Azure Cosmos DB Cassandra table exists.

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 migrate

Migrate the throughput of the Cassandra table between autoscale and manually provisioned.

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 exists

Checks if an Azure Cosmos DB Gremlin database exists.

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 migrate

Migrate the throughput of the Gremlin database between autoscale and manually provisioned.

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 exists

Checks if an Azure Cosmos DB Gremlin graph exists.

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 migrate

Migrate the throughput of the Gremlin Graph between autoscale and manually provisioned.

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 exists

Checks if an Azure Cosmos DB MongoDB collection exists.

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 migrate

Migrate the throughput of the MongoDB collection between autoscale and manually provisioned.

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 exists

Checks if an Azure Cosmos DB MongoDB database exists.

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 migrate

Migrate the throughput of the MongoDB database between autoscale and manually provisioned.

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 private-endpoint-connection

Manage Azure Comsos DB private endpoint connections.

az cosmosdb private-endpoint-connection approve

Approve the specified private endpoint connection associated with Azure Comsos DB.

az cosmosdb private-endpoint-connection delete

Delete the specified private endpoint connection associated with Azure Comsos DB.

az cosmosdb private-endpoint-connection reject

Reject the specified private endpoint connection associated with Azure Comsos DB.

az cosmosdb private-endpoint-connection show

Show details of a private endpoint connection associated with Azure Comsos DB.

az cosmosdb private-link-resource

Manage Azure Comsos DB private link resources.

az cosmosdb private-link-resource list

List the private link resources supported for Azure Comsos DB.

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 exists

Checks if an Azure Cosmos DB SQL container exists.

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 migrate

Migrate the throughput of the SQL container between autoscale and manually provisioned.

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 exists

Checks if an Azure Cosmos DB SQL database exists.

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 migrate

Migrate the throughput of the SQL database between autoscale and manually provisioned.

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 sql stored-procedure

Manage Azure Cosmos DB SQL stored procedures.

az cosmosdb sql stored-procedure create

Create an SQL stored procedure under an Azure Cosmos DB SQL container.

az cosmosdb sql stored-procedure delete

Delete the SQL stored procedure under an Azure Cosmos DB SQL container.

az cosmosdb sql stored-procedure list

List the SQL stored procedures under an Azure Cosmos DB SQL container.

az cosmosdb sql stored-procedure show

Show the details of a SQL stored procedure under an Azure Cosmos DB SQL container.

az cosmosdb sql stored-procedure update

Creates or Updates an Azure Cosmos DB SQL stored procedure.

az cosmosdb sql trigger

Manage Azure Cosmos DB SQL triggers.

az cosmosdb sql trigger create

Create an SQL trigger under an Azure Cosmos DB SQL container.

az cosmosdb sql trigger delete

Delete the SQL trigger under an Azure Cosmos DB SQL container.

az cosmosdb sql trigger list

List the SQL triggers under an Azure Cosmos DB SQL container.

az cosmosdb sql trigger show

Show the details of a SQL trigger under an Azure Cosmos DB SQL container.

az cosmosdb sql trigger update

Updates an Azure Cosmos DB SQL trigger.

az cosmosdb sql user-defined-function

Manage Azure Cosmos DB SQL user defined functions.

az cosmosdb sql user-defined-function create

Create an SQL user defined function under an Azure Cosmos DB SQL container.

az cosmosdb sql user-defined-function delete

Delete the SQL user defined function under an Azure Cosmos DB SQL container.

az cosmosdb sql user-defined-function list

List the SQL user defined functions under an Azure Cosmos DB SQL container.

az cosmosdb sql user-defined-function show

Show the details of a SQL user defined function under an Azure Cosmos DB SQL container.

az cosmosdb sql user-defined-function update

Creates or Updates an Azure Cosmos DB SQL user defined function.

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 exists

Checks if an Azure Cosmos DB table exists.

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 migrate

Migrate the throughput of the Table between autoscale and manually provisioned.

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. You should provide either --ids or other 'Resource Id' arguments.

--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}]
                   [--disable-key-based-metadata-write-access {false, true}]
                   [--enable-analytical-storage {false, true}]
                   [--enable-automatic-failover {false, true}]
                   [--enable-free-tier {false, true}]
                   [--enable-multiple-write-locations {false, true}]
                   [--enable-public-network {false, true}]
                   [--enable-virtual-network {false, true}]
                   [--ip-range-filter]
                   [--key-uri]
                   [--kind {GlobalDocumentDB, MongoDB, Parse}]
                   [--locations]
                   [--max-interval]
                   [--max-staleness-prefix]
                   [--server-version {3.2, 3.6}]
                   [--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
--disable-key-based-metadata-write-access

Disable write operations on metadata resources (databases, containers, throughput) via account keys.

accepted values: false, true
--enable-analytical-storage

Flag to enable log storage on the account.

accepted values: false, true
--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-free-tier

If enabled the account is free-tier.

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

Enable Multiple Write Locations.

accepted values: false, true
--enable-public-network -e

Enable or disable public network access to server.

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.

--key-uri

The URI of the key vault.

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

Valid only for MongoDB accounts.

accepted values: 3.2, 3.6
--subscription

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

--tags

Space-separated tags: key[=value] [key[=value] ...]. 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]
                   [--yes]

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. You should provide either --ids or other 'Resource Id' arguments.

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

--yes -y

Do not prompt for confirmation.

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. You should provide either --ids or other 'Resource Id' arguments.

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

Optional Parameters

--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 -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. You should provide either --ids or other 'Resource Id' arguments.

--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. You should provide either --ids or other 'Resource Id' arguments.

--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. You should provide either --ids or other 'Resource Id' arguments.

--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. You should provide either --ids or other 'Resource Id' arguments.

--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]
                 [--query-examples]
                 [--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. You should provide either --ids or other 'Resource Id' arguments.

--name -n

Name of the Cosmos DB database account.

--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 -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}]
                   [--disable-key-based-metadata-write-access {false, true}]
                   [--enable-analytical-storage {false, true}]
                   [--enable-automatic-failover {false, true}]
                   [--enable-multiple-write-locations {false, true}]
                   [--enable-public-network {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
--disable-key-based-metadata-write-access

Disable write operations on metadata resources (databases, containers, throughput) via account keys.

accepted values: false, true
--enable-analytical-storage

Flag to enable log storage on the account.

accepted values: false, true
--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-public-network -e

Enable or disable public network access to server.

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. You should provide either --ids or other 'Resource Id' arguments.

--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: key[=value] [key[=value] ...]. Use "" to clear existing tags.

--virtual-network-rules

ACL's for virtual network.