az cosmosdb database

Manage Azure Cosmos DB databases.

Commands

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

Creates an Azure Cosmos DB database.

az cosmosdb database create --db-name
[--key]
[--name]
[--resource-group-name]
[--subscription]
[--throughput]
[--url-connection]

Examples

Creates an Azure Cosmos DB database.

az cosmosdb database create --name MyCosmosDBDatabaseAccount --resource-group MyResourceGroup --db-name MyDatabase

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.

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

Deletes an Azure Cosmos DB database.

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

Examples

Deletes an Azure Cosmos DB database (autogenerated)

az cosmosdb database delete --db-name MyDatabase --name MyCosmosDBDatabaseAccount --resource-group-name MyResourceGroup

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.

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

Returns a boolean indicating whether the database exists.

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

Examples

Returns a boolean indicating whether the database exists (autogenerated)

az cosmosdb database exists --db-name MyDatabase --name MyCosmosDBDatabaseAccount --resource-group-name MyResourceGroup

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.

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

Lists all Azure Cosmos DB databases.

az cosmosdb database list [--key]
[--name]
[--resource-group-name]
[--subscription]
[--url-connection]

Examples

Lists all Azure Cosmos DB databases (autogenerated)

az cosmosdb database list --name MyCosmosDBDatabaseAccount --resource-group-name MyResourceGroup

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

Shows an Azure Cosmos DB database.

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

Examples

Shows an Azure Cosmos DB database (autogenerated)

az cosmosdb database show --db-name MyDatabase --name MyCosmosDBDatabaseAccount --resource-group-name MyResourceGroup

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.

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