skills.vishalvoidskills/vishalvoid
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-py

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

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:

  1. 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: DefaultAzureCredential works as-is.
Lines 1 - 25 of 294

Recommendations

Explore other random skills

All skillsMy patterns