Create an Azure Cosmos DB Account
This guide will walk you through the steps to create a new Azure Cosmos DB account using the Azure portal. Azure Cosmos DB is a globally distributed, multi-model database service. It enables you to work with data models such as document, key-value, graph, and column-family, all of which are supported by the same core API.
Prerequisites
Before you begin, you'll need an active Azure subscription. If you don't have one, you can create a free account.
You can find more information on Azure free services here: Azure Free Account.
Create the Cosmos DB account
Follow these steps to create your Azure Cosmos DB account:
Open your web browser and navigate to https://portal.azure.com/. Sign in with your Azure account credentials.
In the Azure portal search bar at the top, type Azure Cosmos DB and select it from the search results.
On the Azure Cosmos DB page, click the + Create button.
- Subscription: Select your Azure subscription.
- Resource group: Select an existing resource group or click Create new to create a new one. A resource group is a logical container that holds related resources for an Azure solution.
- Account name: Enter a unique name for your Azure Cosmos DB account. The name must contain only lowercase letters, numbers, and hyphens, and must be between 3 and 50 characters in length.
- API: Choose the API for your Cosmos DB account. Common choices include:
- Core (SQL): The default and most common API, providing document database functionality.
- MongoDB: For applications using MongoDB drivers.
- Cassandra: For applications using Cassandra drivers.
- Table: For applications using Azure Table storage.
- Gremlin: For graph database functionality.
- Location: Select the Azure region where you want to deploy your Cosmos DB account. Choose a region that is geographically close to your users for lower latency.
Under the Networking tab, you can configure network access for your account. By default, public access is enabled. You can restrict access to specific virtual networks or IP addresses for enhanced security.
Click on the Review + create button. Azure will validate your configuration. Once validation passes, click Create.
Note: The creation process can take several minutes. You will see a notification in the Azure portal when the deployment is complete.
Verify the account creation
Once the deployment is finished, you can navigate to your newly created Azure Cosmos DB account:
- In the Azure portal, go to Resource groups.
- Select the resource group you specified during creation.
- Click on your newly created Azure Cosmos DB account name.
You should now see the overview page for your Cosmos DB account, including its endpoint, keys, and other settings.
Example using Azure CLI
You can also create an Azure Cosmos DB account using the Azure CLI. Here's an example:
Replace my-cosmos-db-account and my-resource-group with your desired values.
Next Steps
Now that you have an Azure Cosmos DB account, you can start creating databases and containers. Here are some common next steps:
- Create a database and container in Azure Cosmos DB
- Understand Azure Cosmos DB capacity planning
- Learn about partitioning and scaling in Azure Cosmos DB
Tip: For cost optimization, consider using the autoscale provisioned throughput feature available in Azure Cosmos DB.