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
1 2 3 4 5 6
1Trust13 / 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.

2Reliability6 / 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.

3Adaptability8 / 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.

4Convention9 / 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.

5Effectiveness5 / 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.

6Verifiability4 / 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 does this skill do, and when should you 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.

What are this skill's strengths and limitations?

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 do you install this skill?

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 do you use this skill?

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 Cosmos DB for Rust

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

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 Cosmos DB TypeScript Skill

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

Dev & Engineering ✓ Microsoft · Official

Azure Tables Java Skill

Build Java applications for Azure Table Storage and the Cosmos DB Table API.

Dev & Engineering ✓ Microsoft · Official

Azure Cosmos DB Python Service Builder

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

Dev & Engineering ✓ Microsoft · Official

Azure AI VoiceLive for Java

Build real-time, bidirectional AI voice conversations in Java over WebSocket.

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 Identity for Java

Configure secure Microsoft Entra ID authentication for Java applications using Azure SDKs.

Dev & Engineering ✓ Microsoft · Official

Azure AI Content Safety for Java

Helps Java applications detect harmful text and images and manage custom blocklists.

Dev & Engineering ✓ Microsoft · Official

Azure SMS for Java

Send Azure Communication Services SMS from Java with per-recipient results and delivery tracking.

Dev & Engineering ✓ Microsoft · Official

Azure AI Persistent Agents for Java

Guides Java developers through building and managing Azure AI agents with persistent threads, messages, runs, and tools.

Dev & Engineering ✓ Microsoft · Official

Azure AI Anomaly Detector for Java

A practical Java skill for building univariate and multivariate time-series anomaly detection with Azure AI Anomaly Detector.

Dev & Engineering ✓ Microsoft · Official

Azure Monitor Telemetry for Java

Guides Java teams in exporting OpenTelemetry data to Azure Monitor.

Dev & Engineering ✓ Microsoft · Official

Azure App Configuration for Java

Guides Java apps in centralizing settings, feature flags, and release snapshots.

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 Data Lake Gen2 for Python

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

Dev & Engineering ✓ Microsoft · Official

Azure Key Vault Keys for Java

Ground Java coding agents in secure Azure Key Vault and Managed HSM key-management workflows.

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 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 CallingServer Java Legacy Maintainer

Maintain legacy CallingServer Java code and migrate it toward Azure Communication Services Call Automation.

Related skills