Official agent skill

Azure Cosmos Rust

by microsoft in microsoft/skills

Azure Cosmos DB library for Rust (NoSQL API). An agent skill from microsoft/skills.

OfficialMITAuto-check passedDatabases

Install Azure Cosmos Rust

skills CLI
$ npx skills add microsoft/skills --skill azure-cosmos-rust -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install microsoft/skills azure-cosmos-rust --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/microsoft/skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.github/plugins/azure-sdk-rust/skills/azure-cosmos-rust .claude/skills/azure-cosmos-rust && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
azure-cosmos-rust
GitHub stars
3.1k
Token cost
~1.6k tokens
SKILL.md length
395 words
Files
1
Skills in repo
150
Repo updated
First seen
Licence
MIT

At a glance

Azure Cosmos DB library for Rust (NoSQL API). An agent skill from microsoft/skills.

  • Works in 9 steps: Use cargo add to manage dependencies,… → Add azure_core only when importing… → Use DeveloperToolsCredential for local… → …
  • Tasks that involve NoSQL databases
  • SKILL.md covers Installation, Environment Variables, Authentication and Client Hierarchy, plus 5 more sections
  • Calls cargo

What it does

Azure Cosmos Rust is an agent skill from microsoft/skills, published by the product's own GitHub organization. Azure Cosmos DB library for Rust (NoSQL API). Document CRUD, containers, and globally distributed data. Triggers: "cosmos db rust", "CosmosClient rust", "document crud rust", "NoSQL rust", "partition key rust".

Its SKILL.md is about 1.6k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Databases, covering NoSQL databases. It works with Azure Cosmos DB, Rust and Microsoft Azure. The repository describes itself as: Skills, MCP servers, Custom Agents, Agents.md for SDKs to ground Coding Agents. The licence is MIT.

When your agent uses it

  • Tasks that involve NoSQL databases

Example prompts

  • “cosmos db rust”
  • “CosmosClient rust”
  • “document crud rust”
  • “/azure-cosmos-rust”

Workflow steps

9 steps, taken from the first numbered list in SKILL.md.

  1. Use cargo add to manage dependencies, never edit Cargo.toml directly. Add and remove Rust SDK dependencies with cargo commands instead of…
  2. Add azure_core only when importing azure_core types directly. If your code imports azure_core::http::Url…
  3. Use DeveloperToolsCredential for local dev, ManagedIdentityCredential for production — Rust does not provide a single…
  4. Never hardcode credentials — use environment variables or managed identity
  5. Reuse CosmosClient — clients are thread-safe; create once, share across tasks
  6. Use RoutingStrategy::ProximityTo — route to the nearest region for lowest latency
  7. Always specify partition key for item operations — Cosmos DB requires it for all CRUD
  8. Run cargo clippy -- -D warnings when the prompt, eval, or CI expects lint-clean output
  9. Future-proof #[non_exhaustive] SDK models — when constructing SDK model/options structs, end the initializer with ..Default::default()…

What it can do on your machine

Read from SKILL.md and the folder at commit 354361d. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • cargo

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • crates.io
    • docs.rs
    • github.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Azure Cosmos Rust loads about 1.6k tokens when it runs. Until then it costs about 57 tokens; SKILL.md has 395 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~57
When it runs · the whole SKILL.md, loaded when a task matches
~1.6k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from microsoft/skills at commit 354361d, republished under its MIT licence (© microsoft). 395 words, ~1,640 tokens.

Download SKILL.mdSave it as .claude/skills/azure-cosmos-rust/SKILL.md (or your agent's skills folder).
name
azure-cosmos-rust
description
Azure Cosmos DB library for Rust (NoSQL API). Document CRUD, containers, and globally distributed data. Triggers: "cosmos db rust", "CosmosClient rust", "document crud rust", "NoSQL rust", "partition key rust".
license
MIT
metadata.author
Microsoft
metadata.package
azure_data_cosmos

Azure Cosmos DB library for Rust

Client library for Azure Cosmos DB NoSQL API — document CRUD, containers, and globally distributed data.

Use this skill when:

  • An app needs to store or query documents in Cosmos DB from Rust
  • You need CRUD operations on items with partition keys
  • You need key-based auth as an alternative to Entra ID

IMPORTANT: Only use the official azure_data_cosmos crate published by the azure-sdk crates.io user. Do NOT use the unofficial azure_cosmos or azure_sdk_for_rust community crates. Official crates use underscores in names and none have version 0.21.0.

Installation

sh
cargo add azure_data_cosmos azure_identity serde serde_json tokio

If your code uses azure_core types directly (for example, azure_core::credentials::TokenCredential), add azure_core to Cargo.toml. If you only use azure_data_cosmos re-exports, direct azure_core dependency is optional.

Environment Variables

bash
COSMOS_ENDPOINT=https://<account>.documents.azure.com/ # Required for all operations

Authentication

Rust Azure SDK code must not use DefaultAzureCredential. The Rust identity crate does not provide that type.

rust
use azure_identity::DeveloperToolsCredential;
use azure_data_cosmos::{
    CosmosClient, AccountReference, AccountEndpoint, RoutingStrategy,
};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    // Local dev: DeveloperToolsCredential. Production: use ManagedIdentityCredential.
    let credential = DeveloperToolsCredential::new(None)?;
    let endpoint: AccountEndpoint = "https://<account>.documents.azure.com/"
        .parse()?;
    let account = AccountReference::with_credential(endpoint, credential);
    let client = CosmosClient::builder()
        .build(account, RoutingStrategy::ProximityTo("East US".into()))
        .await?;
    Ok(())
}

Prefer the crate README/examples when checking builder signatures and CRUD method shapes instead of reconstructing APIs from memory or generated internals.

Client Hierarchy

ClientPurposeAccess
CosmosClientAccount-level operationsCosmosClient::builder().build(account).await?
DatabaseClientDatabase operationsclient.database_client("db")
ContainerClientContainer/item operationsdatabase.container_client("c").await

Core Workflow

rust
use serde::{Serialize, Deserialize};
use azure_data_cosmos::CosmosClient;

#[derive(Serialize, Deserialize)]
struct Item {
    pub id: String,
    pub partition_key: String,
    pub value: String,
}

async fn crud(client: CosmosClient) -> Result<(), Box<dyn std::error::Error>> {
    let container = client
        .database_client("myDatabase")
        .container_client("myContainer")
        .await;

    let item = Item {
        id: "1".into(),
        partition_key: "pk1".into(),
        value: "hello".into(),
    };

    // Create
    container.create_item("pk1", "1", item, None).await?;

    // Read
    let resp = container.read_item("pk1", "1", None).await?;
    let mut item: Item = resp.into_model()?;

    // Update
    item.value = "updated".into();
    container.replace_item("pk1", "1", item, None).await?;

    // Delete
    container.delete_item("pk1", "1", None).await?;
    Ok(())
}
Patch Item
rust
use azure_data_cosmos::{PatchInstructions, PatchOperation};

let patch = PatchInstructions::from(vec![
    PatchOperation::set("/value", serde_json::json!("patched")),
]);
let patched: Item = container
    .patch_item("pk1", "1", patch, None)
    .await?
    .into_model()?;
println!("Patched value: {}", patched.value);

Key Auth (Optional)

Enable account key authentication with the feature flag:

sh
cargo add azure_data_cosmos --features key_auth

RBAC Roles

For Entra ID auth, assign one of these built-in Cosmos DB roles:

RoleAccess
Cosmos DB Built-in Data ReaderRead-only
Cosmos DB Built-in Data ContributorRead/write
Show full SKILL.md (177 more words)Show less

Best Practices

  1. Use cargo add to manage dependencies, never edit Cargo.toml directly. Add and remove Rust SDK dependencies with cargo commands instead of manual manifest edits.
  2. Add azure_core only when importing azure_core types directly. If your code imports azure_core::http::Url, azure_core::http::RequestContent, or azure_core::error::ErrorKind, include azure_core; otherwise a direct dependency is optional.
  3. Use DeveloperToolsCredential for local dev, ManagedIdentityCredential for production — Rust does not provide a single DefaultAzureCredential type
  4. Never hardcode credentials — use environment variables or managed identity
  5. Reuse CosmosClient — clients are thread-safe; create once, share across tasks
  6. Use RoutingStrategy::ProximityTo — route to the nearest region for lowest latency
  7. Always specify partition key for item operations — Cosmos DB requires it for all CRUD
  8. Run cargo clippy -- -D warnings when the prompt, eval, or CI expects lint-clean output
  9. Future-proof #[non_exhaustive] SDK models — when constructing SDK model/options structs, end the initializer with ..Default::default() (add #[allow(clippy::needless_update)]) and use a _ wildcard arm when matching SDK enums, so new service-added fields/variants don't break your build

© microsoft, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .github/plugins/azure-sdk-rust/skills/azure-cosmos-rust of microsoft/skills.

Open the folder on GitHubat commit 354361d

Compare with similar skills

Azure Cosmos Rust next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Azure Cosmos Rust compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Azure Cosmos Rust this skillmicrosoft/skills3.1k—~1.6kAutomated safety check: PassMIT
Azure Cosmosdbalinaqi/maggy7071 repos~4.5kAutomated safety check: PassMIT
Azure Storagemicrosoft/GitHub-Copilot-for-Azure2552 repos~1.3kAutomated safety check: PassMIT
Cosmosdb Best Practicesmicrosoft/vscode-cosmosdb200—~4.3kAutomated safety check: PassMIT
Azure Cosmos Rustaiskillstore/marketplace4305 repos~899Automated safety check: PassNone
Azure Data Tables Pyaiskillstore/marketplace4305 repos~1.5kAutomated safety check: PassNone

Similar skills

  • Azure Cosmosdb

    alinaqi/maggy

    Azure Cosmos DB partition keys, consistency levels, change feed, SDK patterns

    707 GitHub starsUsed in 1 repo~4.5k tokens
    DatabasesAuto-check passed
  • Azure Storage

    microsoft/GitHub-Copilot-for-Azure

    Official

    Azure Storage Services including Blob Storage, File Shares, Queue Storage, Table Storage, and Data Lake.

    255 GitHub starsUsed in 2 repos~1.3k tokens
    DatabasesAuto-check passed
  • Cosmosdb Best Practices

    microsoft/vscode-cosmosdb

    Official

    Azure Cosmos DB performance optimization and best practices guidelines for NoSQL, partitioning, queries, and SDK usage.

    200 GitHub stars~4.3k tokensUpdated yesterday
    DatabasesAuto-check passed
  • Azure Cosmos Rust

    aiskillstore/marketplace

    Azure Cosmos DB SDK for Rust (NoSQL API). An agent skill from aiskillstore/marketplace.

    430 GitHub starsUsed in 5 repos~899 tokens
    DatabasesAuto-check passed
  • Azure Data Tables Py

    aiskillstore/marketplace

    Azure Tables SDK for Python (Storage and Cosmos DB). An agent skill from aiskillstore/marketplace.

    430 GitHub starsUsed in 5 repos~1.5k tokens
    DatabasesAuto-check passed
  • Telemetry Best Practices

    microsoft/vscode-cosmosdb

    Official

    Reviews and authors telemetry code in this extension. An agent skill from microsoft/vscode-cosmosdb.

    200 GitHub stars~3.6k tokensUpdated yesterday
    DatabasesAuto-check passed

More from microsoft/skills

All 150 skills in this repo
  • Official

    Reference for building on Microsoft Foundry with the azure-ai-projects Python SDK: project clients, versioned agents, evaluations, connections, datasets and indexes.

    3.1k GitHub starsUsed in 6 repos~2.8k tokens
    Auto-check passed
  • Official

    Python guidance for the Azure AI Search SDK covering vector, hybrid and semantic search, index management and indexers, with Entra ID authentication preferred over keys.

    3.1k GitHub starsUsed in 6 repos~4.4k tokens
    Auto-check passed
  • Official

    Covers producer, consumer, and checkpoint-store setup for Azure Event Hubs streaming in Python, with Entra ID auth and partition targeting.

    3.1k GitHub starsUsed in 1 repo~2.3k tokens
    Auto-check passed
  • Pydantic Models Py

    microsoft/skills

    Official

    Create Pydantic models following the multi-model pattern with Base, Create, Update, Response, and InDB variants.

    3.1k GitHub starsUsed in 6 repos~496 tokens
    Auto-check passed
  • DebugView CLI

    microsoft/skills

    Official

    Captures and filters Windows user-mode and kernel debug output from the command line with the Sysinternals DebugView CLI, including bounded runs suited to agents.

    3.1k GitHub starsUsed in 1 repo~2.7k tokens
    Auto-check passed
  • Frontend UI Dark TS

    microsoft/skills

    Official

    Build dark-themed React applications using Tailwind CSS with custom theming, glassmorphism effects, and Framer Motion animations.

    3.1k GitHub starsUsed in 5 repos~3.6k tokens
    Auto-check passed

Categories

Questions about Azure Cosmos Rust

What does Azure Cosmos Rust do?

Azure Cosmos DB library for Rust (NoSQL API). An agent skill from microsoft/skills. Azure Cosmos Rust is an agent skill from microsoft/skills, published by the product's own GitHub organization. Azure Cosmos DB library for Rust (NoSQL API).

When should I use Azure Cosmos Rust?

Azure Cosmos Rust fits situations like: tasks that involve NoSQL databases.

How do I install Azure Cosmos Rust in Claude Code?

Run `npx skills add microsoft/skills --skill azure-cosmos-rust -a claude-code`. Or copy the skill folder (.github/plugins/azure-sdk-rust/skills/azure-cosmos-rust in microsoft/skills) into .claude/skills/azure-cosmos-rust in your project. Claude Code loads it when a task matches its description.

How do I install Azure Cosmos Rust in Codex?

Run `npx skills add microsoft/skills --skill azure-cosmos-rust -a codex`. Or copy the skill folder (.github/plugins/azure-sdk-rust/skills/azure-cosmos-rust in microsoft/skills) into .agents/skills/azure-cosmos-rust in your project. Codex loads it when a task matches its description.

Can I use Azure Cosmos Rust in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add microsoft/skills --skill azure-cosmos-rust -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/azure-cosmos-rust, .gemini/skills/azure-cosmos-rust, .github/skills/azure-cosmos-rust and .opencode/skills/azure-cosmos-rust in your project.

What does Azure Cosmos Rust need to run?

Going by SKILL.md and its folder, Azure Cosmos Rust needs the command-line tools its instructions call (cargo).

Does Azure Cosmos Rust access the network?

SKILL.md names 3 domains. As links in the text: crates.io, docs.rs and github.com. This is read from the text; nothing was executed.

Is Azure Cosmos Rust safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Azure Cosmos Rust use?

Azure Cosmos Rust is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Azure Cosmos Rust use?

About 1.6k tokens (SKILL.md is roughly 6.6k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Azure Cosmos Rust?

Skills that share tags, products or a category with Azure Cosmos Rust: Azure Cosmosdb (alinaqi/maggy, 707 stars), Azure Storage (microsoft/GitHub-Copilot-for-Azure, 255 stars), Cosmosdb Best Practices (microsoft/vscode-cosmosdb, 200 stars) and Azure Cosmos Rust (aiskillstore/marketplace, 430 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Azure Cosmos Rust?

microsoft (a GitHub organization, an official publisher) maintains it in microsoft/skills, which has 3,091 GitHub stars. The repository holds 150 skills in this directory. The repository was last updated on October 6, 2026.

Source: microsoft/skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.