azure-cosmos-py

Manage Azure Cosmos DB documents and containers from Python applications.

Updated Apr 12, 2026
One-click install
npx skills add https://github.com/davidrrowley/CortexYouV3 --skill azure-cosmos-py-davidrrowley
Or copy as Structured Prompt for Agentโ–ผ
Please help me install this Agent Skill.
Skill: azure-cosmos-py
Source: https://github.com/davidrrowley/CortexYouV3/tree/main/.agents/skills/azure-cosmos-py
Command: npx skills add https://github.com/davidrrowley/CortexYouV3 --skill azure-cosmos-py-davidrrowley

SYSTEM DOCUMENTATION & REQUIREMENTS

๐Ÿ’ก This Skill requires azure-cosmos, azure-identity, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill removes friction for Python developers who need to manage Azure Cosmos DB NoSQL resources by providing clear patterns for client creation, container and partition key design, document CRUD, queries, throughput configuration, and basic error handling.

Core Features & Use Cases

  • Client auth & patterns: Examples for DefaultAzureCredential and connection-string based clients for both sync and async usage.
  • Container & partition management: Guidance and tooling to create databases and containers with single or hierarchical partition keys, indexing policy, TTL, and throughput settings.
  • Document CRUD & queries: Safe create/read/replace/upsert/delete flows, parameterized queries, pagination, cross-partition queries, transactional batches and change feed processing.
  • Operational tooling: A CLI script to create containers, configure indexing, inspect container metadata, and show throughput and item counts.

Quick Start

Use the setup script to create a database "mydb" and a container "orders" with partition key /customer_id so you can run CRUD and query operations from your Python app.

Frequently Asked Questions about azure-cosmos-py

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

FAQPage Schema
How do I perform CRUD operations on Azure Cosmos DB documents in Python?โ–ผ

To perform CRUD operations on Azure Cosmos DB documents in Python, use the azure-cosmos SDK to create, read, replace, upsert, and delete items within containers, utilizing safe flows for both sync and async clients.

What's the best way to configure Azure Cosmos DB partition keys and indexing policy in Python?โ–ผ

The best way to configure Azure Cosmos DB partition keys and indexing policy in Python is by using setup scripts to create containers with single or hierarchical partition keys, custom indexing policies, TTL, and throughput settings.

Does the azure-cosmos Python SDK support async cross-partition queries?โ–ผ

Yes, the azure-cosmos Python SDK supports async cross-partition queries, allowing Python applications to execute parameterized queries and pagination across multiple partitions using both sync and async clients.

How do I handle Azure Cosmos DB throttling and not-found errors in Python?โ–ผ

To handle Azure Cosmos DB throttling and not-found errors in Python, apply the provided error handling guidance and retry logic for common error codes, ensuring reliable operations when requests are throttled or items are missing.

Can I use DefaultAzureCredential for Azure Cosmos DB Python clients?โ–ผ

Yes, you can use DefaultAzureCredential for Azure Cosmos DB Python clients, as the Skill provides client authentication patterns for both connection-string and DefaultAzureCredential approaches in sync and async implementations.

Why should I use parameterized queries in Azure Cosmos DB with Python?โ–ผ

You should use parameterized queries in Azure Cosmos DB with Python to safely retrieve documents and prevent injection attacks, executing cross-partition queries and processing change feeds efficiently.