azure-cosmos-py

Connect Python applications to Azure Cosmos DB and perform CRUD operations.

2.9k|323|Updated Jan 16, 2026
One-click install
npx skills add https://github.com/microsoft/skills --skill azure-cosmos-py-microsoft
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: azure-cosmos-py
Source: https://github.com/microsoft/skills/tree/main/.github/plugins/azure-sdk-python/skills/azure-cosmos-py
Command: npx skills add https://github.com/microsoft/skills --skill azure-cosmos-py-microsoft

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires azure-cosmos, azure-identity, and includes scripts (resource) and references (resource) components.

What problem does it solve?

Azure Cosmos DB is a globally distributed NoSQL database. The Python SDK enables developers to manage databases, containers, and items programmatically from Python.

Core Features & Use Cases

  • Create and manage databases and containers
  • Perform CRUD operations on items and run queries
  • Use both synchronous and asynchronous clients in Python-based apps (web apps, data pipelines, and services)
  • Real-world use: build scalable data stores for user profiles, telemetry, and shopping catalogs with global distribution

Quick Start

Install the azure-cosmos package and initialize a CosmosClient with your account endpoint and credentials.

Frequently Asked Questions about azure-cosmos-py

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I connect my Python application to Azure Cosmos DB?

To connect a Python application to Azure Cosmos DB, initialize a CosmosClient using your account endpoint and credentials. This setup requires installing the azure-cosmos package and supports authenticating with azure-identity.

How do I perform CRUD operations on items in Cosmos DB using Python?

Perform Cosmos DB CRUD operations in Python by creating a database and container, then executing item operations through the synchronous or asynchronous client workflows provided by the azure-cosmos package.

Can I use asynchronous workflows with the Azure Cosmos DB Python SDK?

Yes, the Azure Cosmos DB Python SDK supports asynchronous workflows. You can use both synchronous and asynchronous clients to manage databases, containers, and run queries within Python web apps and data pipelines.

Do I need the azure-identity package to authenticate a Cosmos DB Python client?

Yes, you need the azure-identity package to set up credentials for the CosmosClient. The azure-cosmos package handles the database operations, while azure-identity manages the authentication flow.

What is the best way to manage NoSQL containers in Azure Cosmos DB with Python?

The best way to manage NoSQL containers in Azure Cosmos DB with Python is using the azure-cosmos package to programmatically call create_database and create_container methods for scalable data stores.

What are typical use cases for a Pythonic Azure Cosmos DB client?

Typical use cases for a Pythonic Azure Cosmos DB client include building scalable data stores for user profiles, telemetry, and shopping catalogs, leveraging the NoSQL API for globally distributed applications.