You are currently viewing How to create Azure Cosmos DB using Azure CLI?

How to create Azure Cosmos DB using Azure CLI?

  • Post author:
  • Post category:Azure

How to create Azure Cosmos DB using Azure CLI?

Hello Everyone

Welcome to CloudAffaire and this is Debjeet.

In today’s blog post, we will discuss how to create an account, database, and container in Azure Cosmos DB using Azure CLI.

Azure Cosmos account entities

How to create Azure Cosmos DB using Azure CLI?

Prerequisites:

Azure CLI installed and configured

Step 1: Create a new resource group for Cosmos DB.

Step 2: Create an Azure Cosmos DB account using Azure CLI.

Step 3: Get details on the Azure Cosmos DB account using Azure CLI.

Step 4: Get Azure Cosmos DB connection string using Azure CLI.

Step 5: Get Azure Cosmos DB keys using Azure CLI

Step 6: Create a database of type SQL API in Azure Cosmos DB using Azure CLI.

Step 7: Get details on the Azure Cosmos DB database using Azure CLI.

Step 8: Create a container in Azure Cosmos DB using Azure CLI.

Step 9: Get details on Azure Cosmos DB containers using Azure CLI.

Clean up.

Unfortunately, there is no Azure CLI available to perform SQL interaction with Azure Cosmos DB. Hence unable to show you how to connect, insert, update, select and delete data in Azure Cosmos DB. Which I will cover in next post using Python SDK.

Hope you have enjoyed this article. To get more details in Azure Cosmos DB, please refer the below documentation.

https://docs.microsoft.com/en-us/azure/cosmos-db/

Azure Cosmos DB CLI reference

https://docs.microsoft.com/en-us/cli/azure/cosmosdb?view=azure-cli-latest