An Azure Cosmos DB for NoSQL account contains all of your Azure Cosmos DB resources: databases, containers, and items. The account provides a unique endpoint for various tools and SDKs to connect to Azure Cosmos DB and perform everyday operations. For more information about the resources in Azure Cosmos DB, see Azure Cosmos DB resource model.
Create shell variables for accountName, resourceGroupName, and location.
# Variable for resource group name
resourceGroupName="msdocs-cosmos"
# Variable for location
location="westus"
# Variable for account name with a randomnly generated suffix
let suffix=$RANDOM*$RANDOM
accountName="msdocs-$suffix"
If you haven't already, sign in to the Azure CLI using the az login command.
Use the az group create command to create a new resource group in your subscription.
az group create \
--name $resourceGroupName \
--location $location
Use the az cosmosdb create command to create a new Azure Cosmos DB for NoSQL account with default settings.
Create shell variables for ACCOUNT_NAME, RESOURCE_GROUP_NAME, and LOCATION.
# Variable for resource group name
$RESOURCE_GROUP_NAME = "msdocs-cosmos"
# Variable for location
$LOCATION = "West US"
# Variable for account name with a randomnly generated suffix
$SUFFIX = Get-Random
$ACCOUNT_NAME = "msdocs-$SUFFIX"
If you haven't already, sign in to Azure PowerShell using the Connect-AzAccount cmdlet.
Use the New-AzResourceGroup cmdlet to create a new resource group in your subscription.
From the Azure portal menu or the Home page, select Create a resource.
On the New page, search for and select Azure Cosmos DB.
On the Select API option page, select the Create option within the NoSQL - Recommend section. Azure Cosmos DB has five APIs: SQL, MongoDB, Gremlin, Table, and Cassandra. Learn more about the API for NoSQL.
On the Create Azure Cosmos DB Account page, enter the following information:
Setting
Value
Description
Subscription
Subscription name
Select the Azure subscription that you wish to use for this Azure Cosmos DB account.
Resource Group
Resource group name
Select a resource group, or select Create new, then enter a unique name for the new resource group.
Account Name
A unique name
Enter a name to identify your Azure Cosmos DB account. The name will be used as part of a fully qualified domain name (FQDN) with a suffix of documents.azure.com, so the name must be globally unique. The name can only contain lowercase letters, numbers, and the hyphen (-) character. The name must also be between 3-44 characters in length.
Location
The region closest to your users
Select a geographic location to host your Azure Cosmos DB account. Use the location that is closest to your users to give them the fastest access to the data.
Capacity mode
Provisioned throughput or Serverless
Select Provisioned throughput to create an account in provisioned throughput mode. Select Serverless to create an account in serverless mode.
Apply Azure Cosmos DB free tier discount
Apply or Do not apply
With Azure Cosmos DB free tier, you'll get the first 1000 RU/s and 25 GB of storage for free in an account. Learn more about free tier.
Note
You can have up to one free tier Azure Cosmos DB account per Azure subscription and must opt-in when creating the account. If you do not see the option to apply the free tier discount, this means another account in the subscription has already been enabled with free tier.
Select Review + create.
Review the settings you provide, and then select Create. It takes a few minutes to create the account. Wait for the portal page to display Your deployment is complete before moving on.
Select Go to resource to go to the Azure Cosmos DB account page.
Next steps
In this guide, you learned how to create an Azure Cosmos DB for NoSQL account. You can now create an application with your Azure Cosmos DB account.