Technical & DevelopmentIntermediate
azure-cosmos-py
Cosmos DB NoSQL client library
Developer Setup
Setup & Installation
bash
npx skills add https://github.com/microsoft/skills --skill azure-cosmos-pynpx skills add https://github.com/microsoft/skills --skill azure-cosmos-pyOr paste this URL into your assistant to install:
Overview
What This Skill Does
Python client library for Azure Cosmos DB's NoSQL API. Handles document CRUD, SQL-like queries, container management, and throughput configuration against a globally distributed database. Supports both sync and async operations.
Application
When to use this Skill
- Configuring integration settings for custom agent workflows.
- Optimizing query execution and response latency in production.
- Developing clean, standard-compliant implementations for enterprise services.
- Troubleshooting connection timeouts and authentication handshakes.
- Monitoring API rate limits and execution pipelines programmatically.
Documentation
Show Skills.md file
Azure Cosmos DB SDK for Python
Client library for Azure Cosmos DB NoSQL API — globally distributed, multi-model database.
Installation
pip install azure-cosmos azure-identity
Environment Variables
COSMOS_ENDPOINT=https://<account>.documents.azure.com:443/ # Required for all auth methods
COSMOS_DATABASE=mydb # Required for all auth methods
COSMOS_CONTAINER=mycontainer # Required for all auth methods
AZURE_TOKEN_CREDENTIALS=prod # Required only if DefaultAzureCredential is used in production
Authentication & Lifecycle
🔑 Two rules apply to every code sample below:
- Prefer
DefaultAzureCredential. It works locally (Azure CLI / VS Code / Developer CLI) and in Azure (managed identity, workload identity) with no code change. Avoid connection strings, account/API keys — they bypass Entra audit and rotation.
- Local dev:
DefaultAzureCredentialworks as-is.
Lines 1 - 25 of 294
Recommendations