How to INSERT SELECT UPDATE DELETE data in Azure Cosmos DB using Python?

How to INSERT SELECT UPDATE DELETE data in Azure Cosmos DB using Python?

How to INSERT SELECT UPDATE DELETE data in Azure Cosmos DB using Python?

Hello Everyone

Welcome to CloudAffaire and this is Debjeet.

In today’s blog post, we will discuss how to insert, select, update and delete data in Azure Cosmos DB using Python SDK for Cosmos core SQL.

How to INSERT SELECT UPDATE DELETE data in Azure Cosmos DB using Python?

Prerequisites:

Azure CLI installed and configured

Step 1: Install Azure Python SDK for Cosmos DB.

Step 2: Declare some environment variables.

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

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

Step 5: Get and store Azure Cosmos DB connection string details into variables.

Step 6: Create a Python script to create an Azure Cosmos DB database.

Step 6: Create an Azure Cosmos DB database using Python.

Step 7: Create a Python script to create an Azure Cosmos DB container.

Step 8: Create an Azure Cosmos DB container using Python.

Step 9: Create a Python script to insert data into Azure Cosmos DB.

Step 10: Insert data into Azure Cosmos DB using Python.

Step 11: Create a Python script to select data from Azure Cosmos DB.

Step 12: Select data from Azure Cosmos DB using Python.

Step 13: Create a Python script to delete data from Azure Cosmos DB.

Step 14: Delete data from Azure Cosmos DB using Python.

Step 15: Clean up.

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

Leave a Reply

Close Menu