Dev & Engineering ✓ Microsoft · Official javaazure-cosmos-dbnosqlcrud-operationsreactive-programmingpartition-keysglobal-distribution

Azure Cosmos DB Java Skill

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

FollowSkills review · FSRS-2.0
Not recommended
45/ 100 5-point scale 2.3 / 5
Trust13 / 25 · 2.6/5

The material uses environment variables for the Cosmos key and demonstrates database, container, and item deletion, but lacks least-privilege guidance, user confirmation, data-flow disclosure, redaction, rollback, and deletion-recovery instructions. No malicious or covert exfiltration behavior is shown, so a moderate score is retained while deducting for incomplete security governance.

Reliability6 / 20 · 1.5/5

SKILL.md and examples.md cover sync, async, CRUD, queries, and error handling, but show several questionable paths: the synchronous createDatabaseIfNotExists result is chained with map, variables are redeclared in the same scope, an async delete chain depends on an item from a delete response, and no skill-specific executable tests are provided. Static evidence is insufficient for a score above 10.

Adaptability8 / 15 · 2.7/5

The name, Java SDK target, Cosmos DB scenarios, and trigger phrases are clear, covering sync, async, partitioning, queries, and consistency. However, non-fit ranges, input/output boundaries, compatibility versions, semantic false-trigger controls, Chinese-language support, and mainland-China network reachability are not documented, so points are deducted.

Convention9 / 15 · 3.0/5

The skill has front matter, MIT licensing, version 1.0.0, installation notes, layered reference examples, best practices, error handling, and official reference links. It nevertheless uses LATEST, placeholder versions, and placeholder credentials, with no changelog, explicit maintenance owner, update path, or known-limitations section, so it does not receive full marks.

Effectiveness5 / 15 · 1.7/5

The material can accelerate generation of Cosmos Java client, CRUD, and query code and mentions RU cost and retry behavior. However, examples contain possible compile/runtime correctness issues, and destructive operations lack confirmation and rollback guidance; substantial review and correction may still be required, so the static score is kept below 7.

Verifiability4 / 10 · 2.0/5

Maven, API, product, sample, performance, and troubleshooting links provide some traceability. They are reference links rather than skill-specific validation records, and no committed tests or third-party execution evidence covering this skill's key paths is shown, so the static score remains within the capped range.

Evidence confidence:Low Reviewed Jul 20, 2026 Reviewed revision 9ccaf7c3704a
Before you use it
  • Do not use LATEST directly; pin a verified azure-cosmos version or Azure SDK BOM version.
  • Prefer or supplement key authentication with a least-privilege DefaultAzureCredential approach, and never expose keys in logs or examples.
  • The database, container, and item deletion examples are destructive; add explicit confirmation, backup, and recovery procedures before production use.
  • Compile and validate the synchronous map chain, duplicate variable declarations, and async delete-response access before adopting the examples.
  • Mainland-China reachability and Chinese-language support are undocumented; evaluate the network environment separately when relying on Azure services and online documentation.
See the full review method →

What it does & when to use it

This skill provides development guidance for the Azure Cosmos DB NoSQL API through the Java SDK. It covers Maven setup, key-based authentication, synchronous and asynchronous clients, database and container management, CRUD, queries, partition keys, consistency levels, and request units. It also includes connection configuration, error handling, and production-oriented practices for Java applications using Cosmos DB.

Shows developers how to add the azure-cosmos Maven dependency, read COSMOS_ENDPOINT and COSMOS_KEY environment variables, create CosmosClient or CosmosAsyncClient, manage databases and containers, perform create/read/update/delete and query operations, and handle CosmosException cases such as conflicts and rate limiting.

  1. A Java backend developer adding the Azure Cosmos DB NoSQL API to a new application can use it for Maven setup and client initialization.
  2. A team building high-throughput or reactive services can follow the CosmosAsyncClient and chained asynchronous examples.
  3. A developer designing a Cosmos DB data model can use the partition-key guidance on cardinality, distribution, and query patterns.
  4. A globally distributed application team can use the preferred-region, consistency-level, and direct-mode configuration examples.
  5. A developer troubleshooting database operations can use the status-code, request-charge, and retry-after handling patterns.

Pros & cons

Pros
  • Covers both synchronous and asynchronous clients, including reactive chaining.
  • Provides an end-to-end baseline from dependency setup through databases, containers, CRUD, and queries.
  • Includes practical guidance on partition keys, consistency, request units, preferred regions, direct mode, and throttling.
  • Offers reusable Java and Maven examples.
Limitations
  • The authentication examples only demonstrate account-key authentication.
  • The dependency example uses `LATEST` rather than a pinned SDK version.
  • No test coverage or compatibility matrix is provided for this individual skill.
  • An Azure Cosmos DB account, endpoint, and primary key are required by the examples.

How to install

Add the com.azure:azure-cosmos dependency to the project Maven configuration, or manage its version through the Azure SDK BOM. Set COSMOS_ENDPOINT and COSMOS_KEY environment variables. The full skill collection can be installed with npx skills add microsoft/skills; the README does not document a separate installation command for this individual skill directory.

How to use

In an Agent Skills-compatible coding agent, provide a request such as “Use CosmosClient Java to create a Cosmos DB database and container” or “Implement Cosmos DB Java CRUD with CosmosAsyncClient.” The agent can follow the skill’s Java, Maven, authentication, partitioning, querying, and error-handling patterns.

FAQ

Is this skill intended for non-Java projects?
No. It specifically targets the Azure Cosmos DB SDK for Java and uses Java and Maven examples.
What Azure credentials do the examples require?
They require COSMOS_ENDPOINT and COSMOS_KEY, then create the client with the account key.
Does it address Cosmos DB throttling?
Yes. It notes that retry policies are built in by default and shows how to inspect a 429 status and retry-after duration.
Does it cover every advanced Cosmos DB feature?
The supplied material focuses on client hierarchy, databases, containers, CRUD, queries, partition keys, consistency, request units, and connection configuration; it does not document broader advanced coverage.

More skills from this repository

All from microsoft/agent-skills

Dev & Engineering ✓ Microsoft · Official

Azure Identity for Python

A practical skill for securing Python Azure applications with Microsoft Entra ID credentials.

Dev & Engineering ✓ Microsoft · Official

Azure Event Hubs Java Skill

Build production-oriented Java event streaming applications on Azure Event Hubs.

Dev & Engineering ✓ Microsoft · Official

Azure Tables for Python

A practical guide to building authenticated Azure Tables applications with Python entity CRUD, queries, and partition-scoped batch operations.

Dev & Engineering ✓ Microsoft · Official

Azure Identity for TypeScript

Configure secure, flexible Microsoft Entra ID authentication for TypeScript Azure applications.

Automation & Ops ✓ Microsoft · Official

Azure Reliability Advisor

Assess and improve reliability for Azure Functions and App Service.

Dev & Engineering ✓ Microsoft · Official

Azure Cloud Architect

Guides coding agents through production-grade Azure architecture design and review using Azure Architecture Center practices.

Dev & Engineering ✓ Microsoft · Official

Azure AI Text Analytics for Python

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

Automation & Ops ✓ Microsoft · Official

Azure Resource Architecture Visualizer

Analyze Azure resource groups and turn their dependencies into detailed Mermaid architecture diagrams.

Dev & Engineering ✓ Microsoft · Official

Azure Maps for .NET

Build .NET location features for search, routing, maps, geolocation, and weather.

Dev & Engineering ✓ Microsoft · Official

Azure AI Vision Image Analysis

Guides Python coding agents in implementing Azure AI Vision image understanding.

Dev & Engineering ✓ Microsoft · Official

Azure Blob Storage for Python

Guides secure, production-minded Blob Storage operations in Python.

Dev & Engineering ✓ Microsoft · Official

Azure Queue Storage for Python

Gives coding agents reliable Python patterns for secure Azure Queue Storage messaging and asynchronous task processing.

Automation & Ops ✓ Microsoft · Official

Azure AI Gateway Governance

Use Azure API Management to govern traffic across AI models, MCP tools, and agents.

Automation & Ops ✓ Microsoft · Official

AKS Automatic Readiness

Assess Kubernetes workloads for AKS Automatic compatibility and identify migration blockers before you switch.

Dev & Engineering ✓ Microsoft · Official

Azure Cosmos DB ARM for .NET

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

Dev & Engineering ✓ Microsoft · Official

Azure Playwright Workspace Manager

Provision and manage Microsoft Playwright Testing workspaces with .NET and Azure Resource Manager.

Dev & Engineering ✓ Microsoft · Official

Azure Cosmos DB for Python

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

Dev & Engineering ✓ Microsoft · Official

Azure Key Vault SDK for Python

Gives Python coding agents practical guidance for securely managing Azure Key Vault secrets, keys, and certificates.

Dev & Engineering ✓ Microsoft · Official

Azure API Management for Python

Gives coding agents practical Python SDK patterns for managing Azure API Management services, APIs, products, subscriptions, and policies.

Dev & Engineering ✓ Microsoft · Official

Azure Monitor Query for Python

Generate Python code for querying Azure Monitor logs and metrics.

Related skills