Skip to content

Latest commit

 

History

History
53 lines (35 loc) · 2.48 KB

File metadata and controls

53 lines (35 loc) · 2.48 KB
title description author ms.author ms.service ms.custom ms.topic ms.date
Find an existing Azure Cosmos DB free-tier account in a subscription
Find an existing Azure Cosmos DB free-tier account in a subscription
markjbrown
mjbrown
azure-cosmos-db
devx-track-azurecli
sample
07/08/2022

Find an existing Azure Cosmos DB free-tier account in a subscription using Azure CLI

[!INCLUDENoSQL, MongoDB, Cassandra, Gremlin, Table]

The script in this article demonstrates how to locate an Azure Cosmos DB free-tier account within a subscription.

Each Azure subscription can have up to one Azure Cosmos DB free-tier account. If you're trying to create a free-tier account, the option may be disabled in the Azure portal, or you get an error when attempting to create a free-tier account. If either of these issues occur, use this script to locate the name of the existing free-tier account, and the resource group it belongs to.

[!INCLUDE quickstarts-free-trial-note]

[!INCLUDE azure-cli-prepare-your-environment.md]

  • This article requires version 2.9.1 or later of the Azure CLI. If using Azure Cloud Shell, the latest version is already installed.

Sample script

[!INCLUDE cli-launch-cloud-shell-sign-in.md]

Run the script

:::code language="azurecli" source="~/azure_cli_scripts/cosmosdb/common/find-free-tier-account.sh" id="FullScript":::

Sample reference

This script uses the following commands. Each command in the table links to command specific documentation.

Command Notes
az group list Lists all resource groups in an Azure subscription.
az cosmosdb list Lists all Azure Cosmos DB account in a resource group.

Next steps

For more information on the Azure Cosmos DB CLI, see Azure Cosmos DB CLI documentation.

For Azure CLI samples for specific APIs, see: