Developing a Python app using Azure Cosmos DB

Azure Cosmos DB is Microsoft’s globally distributed multi-model database service. One of the supported APIs is the SQL API, which provides a JSON document model with SQL querying and JavaScript procedural logic. This sample shows you how to use the Azure Cosmos DB with the SQL API to store and access data from a Python application.

Running this sample

  • Before you can run this sample, you must have the following prerequisites:

  • Then, clone this repository using: git clone

  • Next, substitute the endpoint and primary key in with your Cosmos DB account's values.

  • In Visual Studio Code, select View > Integrated terminal to open the visual Studio Code integrated terminal.

  • In the terminal, run python

About the code

The code included in this sample is intended to get you quickly started with a Python application that connects to Azure Cosmos DB with the SQL API.

More information