brokenchapt3r/astralnexus/azure-cosmos-rust
Claude Code and agent skill by brokenchapt3r/astralnexus
- community
Checking that the SKILL.md file is still in the repository.
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".
Install
npx vskill@latest install brokenchapt3r/astralnexus/azure-cosmos-rustSKILL.md
The same SKILL.md was published earlier as microsoft/skills/azure-cosmos-rust.
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 officialazure_data_cosmoscrate published by the azure-sdk crates.io user. Do NOT use the unofficialazure_cosmosorazure_sdk_for_rustcommunity crates. Official crates use underscores in names and none have version 0.21.0.
Installation
If your code usesazure_coretypes directly (for example,azure_core::credentials::TokenCredential), addazure_coretoCargo.toml. If you only useazure_data_cosmosre-exports, directazure_coredependency is optional.
Environment Variables
Authentication
Rust Azure SDK code must not use DefaultAzureCredential. The Rust identity crate does not provide that type.
Prefer the crate README/examples when checking builder signatures and CRUD method shapes instead of reconstructing APIs from memory or generated internals.
Client Hierarchy
| Client | Purpose | Access | |
|---|---|---|---|
CosmosClient | Account-level operations | CosmosClient::builder().build(account).await? | |
DatabaseClient | Database operations | client.database_client("db") | |
ContainerClient | Container/item operations | database.container_client("c").await |
Core Workflow
Patch Item
Key Auth (Optional)
Enable account key authentication with the feature flag:
RBAC Roles
For Entra ID auth, assign one of these built-in Cosmos DB roles:
| Role | Access | |
|---|---|---|
Cosmos DB Built-in Data Reader | Read-only | |
Cosmos DB Built-in Data Contributor | Read/write |
Best Practices
- 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.
- Add `azure_core` only when importing `azure_core` types directly. If your code imports
azure_core::http::Url,azure_core::http::RequestContent, orazure_core::error::ErrorKind, includeazure_core; otherwise a direct dependency is optional. - Use `DeveloperToolsCredential` for local dev, `ManagedIdentityCredential` for production — Rust does not provide a single
DefaultAzureCredentialtype - Never hardcode credentials — use environment variables or managed identity
- Reuse `CosmosClient` — clients are thread-safe; create once, share across tasks
- Use `RoutingStrategy::ProximityTo` — route to the nearest region for lowest latency
- Always specify partition key for item operations — Cosmos DB requires it for all CRUD
- Run `cargo clippy -- -D warnings` when the prompt, eval, or CI expects lint-clean output
- 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
Reference Links
| Resource | Link | |
|---|---|---|
| API Reference | https://docs.rs/azure_data_cosmos/latest/azure_data_cosmos | |
| crates.io | https://crates.io/crates/azure_data_cosmos | |
| Source Code | https://github.com/Azure/azure-sdk-for-rust/tree/main/sdk/cosmos/azure_data_cosmos |
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingsrc/AstralNexus/skills/vendor/microsoft/azure-cosmos-rust/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/brokenchapt3r/astralnexus/azure-cosmos-rust)