Create a Database in Azure Cosmos DB

Note: This tutorial guides you through creating a database using the Azure portal. Similar steps can be followed using SDKs or the Azure CLI.

Introduction

Azure Cosmos DB is a globally distributed, multi-model database service. Creating a database is the first step in organizing your data within an Azure Cosmos DB account. Databases in Azure Cosmos DB are logical constructs that group containers.

Prerequisites

Steps to Create a Database

Step 1: Navigate to your Azure Cosmos DB Account

  1. Sign in to the Azure portal.
  2. In the search bar at the top, type "Azure Cosmos DB" and select it from the search results.
  3. Select your existing Azure Cosmos DB account from the list.

Step 2: Access the Data Explorer

Once you are on the overview page of your Azure Cosmos DB account, navigate to the Data Explorer in the left-hand menu.

Azure Portal Data Explorer

Step 3: Create a New Database

  1. In the Data Explorer, click on the New Database button.
  2. New Database Button
  3. A side panel will appear. Enter a unique Database ID for your new database (e.g., MySampleDatabase). Database IDs can contain lowercase letters, numbers, and hyphens, and must be between 1 and 255 characters.
  4. You can optionally configure throughput for the database. For most scenarios, it's recommended to configure throughput at the container level. Leave this as Manual and set the RU/s to 400 for initial setup or select Autoscale if preferred.
  5. Click OK.
Create Database Panel

Step 4: Verify Database Creation

After a short period, your new database will appear under the Databases section in the Data Explorer's left-hand navigation pane. You can then select this database to start creating containers within it.

Next Steps

Now that you have successfully created a database, you can proceed to: