Dev & Engineering ✓ Microsoft · Official

Azure Cosmos DB Python Service Builder

Build secure, testable Azure Cosmos DB NoSQL services for Python and FastAPI applications.

47/ 100
Use with care

Useful, but reliability, evidence or controls still have material gaps.

See how it was scored ↓
Works as-is in
Codex · Claude Code
Stars
★ 2.7k
Last updated
3mo ago
License
MIT
azure-cosmos-dbpythonfastapipydantic
+3partition-keyparameterized-queriestdd

What does this skill do, and when should you use it?

This skill is for developers implementing Azure Cosmos DB NoSQL services with Python and FastAPI. It covers client setup, DefaultAzureCredential and emulator authentication, service-layer CRUD, partition keys, parameterized queries, and test-driven development. It also defines Pydantic model tiers, graceful degradation, singleton container initialization, and client or credential lifecycle management. It fits Azure application teams seeking production-oriented implementation patterns, but it does not provision Cosmos DB infrastructure.

It guides coding agents through installing azure-cosmos and azure-identity, reading Cosmos endpoint, database, container, and credential settings, creating clients with DefaultAzureCredential or emulator keys, structuring FastAPI routers and Cosmos service classes, implementing CRUD and document-model conversion, validating partition-key access, writing parameterized queries, and creating pytest tests with mocked containers.

Good fit
  • A Python backend developer adding Cosmos DB persistence to a FastAPI project or workspace.
  • A team that needs emulator authentication locally and managed identity or another Entra credential in Azure production.
  • An application developer designing partition-key isolation, authorized data access, and low-scan query patterns.
  • A team that wants tests written before implementation and needs a mockable Cosmos container dependency.
  • A backend project separating Cosmos documents, Pydantic API models, and business logic through a service layer.

How do you install this skill?

Before you use it
  • Do not treat the templates as production-ready without reconciling the sync/async client strategy and adding explicit client and credential shutdown.
  • Add authorization, user confirmation, auditing, and failure-recovery controls before deletes, cross-partition moves, or cross-tenant access.
  • Constrain extra_filter callers and review exception logging and configuration loading to reduce query-fragment injection and sensitive-data exposure.
  • The material does not establish Azure service reachability in mainland-China network or regional environments; verify this separately before deployment.
Before you start
Your agent needs
  • Shell / CLI
  • Network access
  • Local filesystem
Install first
  • Python
  • azure-cosmos
  • azure-identity
  • FastAPI
  • Pydantic
  • pytest

Run npx skills add microsoft/skills in the target project and select azure-cosmos-db-py in the installation wizard. The README also documents copying a selected skill into an agent directory. The source file for this skill is .github/plugins/azure-sdk-python/skills/azure-cosmos-db-py/SKILL.md; the installer determines the target agent directory.

Generic route: install into Claude Code manually (macOS / Linux)
tmp="$(mktemp -d)"
git clone --depth 1 https://github.com/microsoft/skills.git "$tmp"
mkdir -p ~/.claude/skills
cp -R "$tmp/.github/plugins/azure-sdk-python/skills/azure-cosmos-db-py" ~/.claude/skills/
rm -rf "$tmp"

Generated from the source repository and skill path; it copies only this skill's folder. If the author's install steps above differ, follow those first. To scope it to one project, replace ~/.claude/skills with that project's .claude/skills.

How do you use this skill?

Try saying

Once installed, send your agent any of these to trigger it:

  • Add Azure Cosmos DB NoSQL persistence to this FastAPI app using DefaultAzureCredential, partition keys, a service-layer CRUD design, and pytest tests.
  • Python Cosmos SDK,
  • database service layer.

In an Agent Skills-compatible coding agent, ask for something such as “Add Azure Cosmos DB NoSQL persistence to this FastAPI app using DefaultAzureCredential, partition keys, a service-layer CRUD design, and pytest tests.” Trigger phrases include “Cosmos DB,” “Python Cosmos SDK,” and “database service layer.” Configure COSMOS_ENDPOINT, COSMOS_DATABASE_NAME, and COSMOS_CONTAINER_ID; add COSMOS_KEY for emulator scenarios.

What are this skill's strengths and limitations?

Pros
  • Covers authentication, lifecycle management, service layers, models, partitioning, queries, and testing in one implementation guide.
  • Clearly prioritizes DefaultAzureCredential and limits keys to emulator or local authentication scenarios.
  • Includes concrete FastAPI, Pydantic, and pytest patterns.
  • Emphasizes parameterized queries, authorization-aware partition validation, and graceful degradation.
  • The repository is MIT-licensed and supports collection installation through npx skills add.
Limitations
  • Focuses on Cosmos DB NoSQL service implementation and does not cover resource provisioning or full infrastructure setup.
  • It depends on Python, Azure SDK packages, FastAPI, Pydantic, and pytest, but the source does not specify supported versions.
  • The source provides no independent test coverage or execution results for this specific skill.
  • Developers must integrate asynchronous execution, singleton lifetime, and context-manager handling into their own application structure.

How does this skill compare with similar options?

Side by side with related skills; every score comes from the same FSRS standard.

Skill FS score Stars Last updated License
Azure Cosmos DB Python Service Builder this page ✓ Microsoft · Official 47 · Use with care ★ 2.7k 3mo ago MIT
Pydantic Multi-Model Architecture ✓ Microsoft · Official 52 · Use with care ★ 2.7k 3mo ago MIT
FastAPI Router Builder ✓ Microsoft · Official 51 · Use with care ★ 2.7k 3mo ago MIT
Azure Cosmos DB for Python ✓ Microsoft · Official 54 · Use with care ★ 2.7k 3mo ago MIT
Azure Cosmos DB TypeScript Skill ✓ Microsoft · Official 52 · Use with care ★ 2.7k 3mo ago MIT

How did FollowSkills review this skill?

FollowSkills review · FSRS-2.0
Use with care
47/ 100 5-point scale 2.4 / 5
1Trust13 / 25 · 2.6/5

The evidence favors DefaultAzureCredential, avoids production keys, limits emulator keys to local use, and requires parameterized queries. However, delete operations lack user confirmation, rollback, or recovery guidance; partition-key authorization is stated as a principle but not implemented; client-lifecycle examples are inconsistent; and error logging may expose endpoint and internal details, so points are deducted.

2Reliability7 / 20 · 1.8/5

The material supplies client, service-layer, error-handling, retry, and testing templates with an understandable happy path. Static evidence also shows inconsistencies between synchronous Cosmos clients, threadpool wrapping, and async context-manager guidance, many TODO placeholders, unpinned dependencies, and silent None/empty-list/False failure conventions. No execution results are provided, so the static ceiling and deductions apply.

3Adaptability8 / 15 · 2.7/5

The intended audience, Cosmos DB Python/FastAPI scenarios, and major triggers are fairly clear, covering authentication, CRUD, partitioning, and tests. However, triggers such as NoSQL database and add persistence are broad, the templates assume a specific FastAPI project structure and models, and non-fit boundaries, Chinese support, and mainland-China network reachability are not documented, so points are deducted.

4Convention9 / 15 · 3.0/5

The evidence includes installation, environment variables, layered references, templates, MIT licensing, author metadata, and version 1.0.0, providing a reasonably usable information architecture. It lacks a compatibility matrix, dependency pinning, changelog, explicit maintenance owner, and update path; the repository README also describes the project as work in progress, so points are deducted.

5Effectiveness6 / 15 · 2.0/5

The templates theoretically cover client setup, CRUD, queries, partitioning, error handling, and tests, so they can support the core implementation task. However, substantial renaming, model work, and project configuration are required; production-grade quality and representative outputs are not statically verified; and some examples require correction. The static effectiveness ceiling therefore limits the score.

6Verifiability4 / 10 · 2.0/5

The evidence is versioned and auditable and includes test templates, integration-test patterns, and repository CI indicators. It does not provide executed results, a complete key-path test suite, or independent corroboration for this skill. Repository badges alone do not verify coverage of this skill, so only limited credit is warranted.

1 2 3 4 5 6

Open a dimension to read why it scored that way

Reviewed Jul 20, 2026 Reviewed revision 9ccaf7c3704a Review evidence[1][2][3][4][5][6][7][8][9][10][11]

Evidence confidence:Low — Mostly static review, author material or a limited demo; useful for discovery, not high-risk decisions.

See the full review method →

FAQ

Should production applications use Cosmos DB keys?
The skill recommends DefaultAzureCredential and constraining the production credential chain with `AZURE_TOKEN_CREDENTIALS=prod` or a specific credential. Keys are primarily shown for the emulator or key-based local authentication.
Can development proceed without an Azure Cosmos DB resource?
Yes. The skill includes a local emulator example using `https://localhost:8081`, an emulator key, and `connection_verify=False`.
Does the skill document Azure service pricing?
No. The source identifies the repository as MIT-licensed but does not provide Cosmos DB pricing or cost guidance.
What happens when Cosmos DB is unavailable?
The recommended service-layer pattern returns `None` or an empty list when Cosmos is unavailable, with exponential-backoff retry logic for transient failures.

More skills from this repository

All from microsoft/agent-skills

Dev & Engineering ✓ Microsoft · Official

Pydantic Multi-Model Architecture

Build consistent, reusable Pydantic data contracts with a structured multi-model pattern.

★ 2.7k FS 52 Use with care 3mo ago
Dev & Engineering ✓ Microsoft · Official

FastAPI Router Builder

Create consistent FastAPI CRUD routes with authentication and typed responses.

★ 2.7k FS 51 Use with care 3mo ago
Dev & Engineering ✓ Microsoft · Official

Azure Cosmos DB for Python

A practical guide for building reliable Python applications on Azure Cosmos DB’s NoSQL API.

★ 2.7k FS 54 Use with care 3mo ago
Dev & Engineering ✓ Microsoft · Official

Azure Cosmos DB TypeScript Skill

Gives TypeScript and JavaScript coding agents practical Cosmos DB data-access patterns.

★ 2.7k FS 52 Use with care 3mo ago
Dev & Engineering ✓ Microsoft · Official

Azure Cosmos DB Java Skill

Guides Java developers in building globally distributed, partitioned, and reactive Azure Cosmos DB applications.

★ 2.7k FS 45 Not recommended 3mo ago
Dev & Engineering ✓ Microsoft · Official

Azure Cosmos DB for Rust

A practical guide to building Rust applications with the official Azure Cosmos DB NoSQL client.

★ 2.7k FS 44 Not recommended 3mo ago
Dev & Engineering ✓ Microsoft · Official

Azure Cosmos DB ARM for .NET

Provision and manage Azure Cosmos DB resources from .NET through ARM.

★ 2.7k FS 54 Use with care 3mo ago
Dev & Engineering ✓ Microsoft · Official

Azure PostgreSQL TypeScript Connector

A practical pg-based guide for secure, pooled Azure PostgreSQL access in Node.js and TypeScript.

★ 2.7k FS 49 Use with care 3mo ago
Automation & Ops ✓ Microsoft · Official

Azure Python App Service Deployer

Deploy Flask, Django, FastAPI, or other Python apps to Azure App Service Linux.

★ 2.7k FS 45 Not recommended 3mo ago
Dev & Engineering ✓ Microsoft · Official

Azure AI Text Analytics for Python

Guides Python developers through Azure-powered text analysis and NLP workflows.

★ 2.7k FS 56 Use with care 3mo ago
Dev & Engineering ✓ Microsoft · Official

Azure Data Lake Gen2 for Python

Guides Python developers through hierarchical file-system and large-file operations on Azure Data Lake Storage Gen2.

★ 2.7k FS 53 Use with care 3mo ago
Dev & Engineering ✓ Microsoft · Official

Azure AI Transcription for Python

Guides Python applications through Azure AI real-time and batch speech-to-text transcription.

★ 2.7k FS 49 Use with care 3mo ago
Dev & Engineering ✓ Microsoft · Official

Azure Monitor OpenTelemetry Exporter

Build a controlled Python OpenTelemetry pipeline that exports traces, metrics, and logs to Application Insights.

★ 2.7k FS 49 Use with care 3mo ago
Dev & Engineering ✓ Microsoft · Official

Azure Short-Audio Speech-to-Text REST

Transcribe audio up to 60 seconds with Python HTTP requests.

★ 2.7k FS 49 Use with care 3mo ago
Dev & Engineering ✓ Microsoft · Official

MCP Server Development Guide

A practical guide to building clear, testable MCP servers that let LLMs work with external APIs.

★ 2.7k FS 49 Use with care 3mo ago
Dev & Engineering ✓ Microsoft · Official

Azure Content Understanding for Python

Extract structured multimodal content from documents, images, audio, and video with Python.

★ 2.7k FS 48 Use with care 3mo ago
Dev & Engineering ✓ Microsoft · Official

Azure Fabric Capacity Manager

Manage Microsoft Fabric capacities and their lifecycle with the Azure Python SDK.

★ 2.7k FS 46 Use with care 3mo ago
Dev & Engineering ✓ Microsoft · Official

Azure Monitor OpenTelemetry for Python

Connect Python applications to Application Insights with one-line OpenTelemetry setup.

★ 2.7k FS 45 Not recommended 3mo ago
Dev & Engineering ✓ Microsoft · Official

Azure Realtime Podcast Studio

Turn text into playable podcast-style audio with Azure OpenAI Realtime API.

★ 2.7k FS 39 Not recommended 3mo ago
Dev & Engineering ✓ Microsoft · Official

Microsoft Entra Agent ID Provisioning

Provision OAuth2-capable identities for AI agents through Microsoft Graph beta.

★ 2.7k FS 50 Use with care 3mo ago

Related skills