Habilidades Azure Cosmos DB SDK for Rust
📦

Azure Cosmos DB SDK for Rust

Seguro

Build Azure Cosmos DB Applications with Rust

Developers need to work with globally distributed databases efficiently. This skill provides comprehensive Azure Cosmos DB Rust SDK guidance for document operations, queries, and container management.

Soporta: Claude Codex Code(CC)
🥉 72 Bronce
1

Descargar el ZIP de la skill

2

Subir en Claude

Ve a Configuración → Capacidades → Skills → Subir skill

3

Activa y empieza a usar

Pruébalo

Usando "Azure Cosmos DB SDK for Rust". Create a document with id, partition key, and custom fields

Resultado esperado:

Define a struct with Serialize/Deserialize derives, instantiate with required fields, and call container.create_item() with partition key and item. Use into_model() to deserialize responses.

Usando "Azure Cosmos DB SDK for Rust". Update specific fields without replacing entire document

Resultado esperado:

Use PatchDocument to specify add and remove operations on JSON paths. Call container.patch_item() with partition key, item id, and patch document configuration.

Auditoría de seguridad

Seguro
v1 • 2/24/2026

This skill contains only documentation for Azure Cosmos DB Rust SDK usage. Static analysis scanned 0 files with 0 security findings and risk score 0/100. The SKILL.md file provides legitimate instructional content for Microsoft's official azure_data_cosmos crate with no executable code or security concerns.

0
Archivos escaneados
0
Líneas analizadas
0
hallazgos
1
Auditorías totales
No se encontraron problemas de seguridad
Auditado por: claude

Puntuación de calidad

38
Arquitectura
100
Mantenibilidad
87
Contenido
50
Comunidad
100
Seguridad
74
Cumplimiento de la especificación

Lo que puedes crear

Backend Developer Building Cloud-Native Apps

Learn to integrate Azure Cosmos DB into Rust microservices with proper authentication, partitioning, and efficient query patterns for globally distributed data.

Database Engineer Migrating to Rust

Understand Cosmos DB Rust SDK patterns including item serialization, deserialization, and optimal container configuration for production workloads.

Solutions Architect Designing Multi-Region Systems

Explore Cosmos DB global distribution capabilities with Rust SDK for building low-latency, highly available applications across geographic regions.

Prueba estos prompts

Basic Item Operations
Show me how to create, read, update, and delete items in Azure Cosmos DB using Rust SDK with proper error handling and partition key configuration.
Authentication Setup
Explain how to authenticate to Azure Cosmos DB using Entra ID credentials in Rust. Include DeveloperToolsCredential setup and configuration for local development.
Query Optimization
Provide examples of efficient query patterns for Azure Cosmos DB Rust SDK including FILTER, ORDER BY, and cross-partition queries with best practices.
Production Implementation
Create a complete Rust module for Cosmos DB operations including connection pooling, retry policies, custom error types, and structured logging for production use.

Mejores prácticas

  • Always specify partition key for point reads and writes to optimize RU consumption
  • Reuse CosmosClient and DatabaseClient instances - they are thread-safe and designed for sharing
  • Prefer Entra ID authentication over key-based auth for production environments
  • Derive Serialize and Deserialize traits for all document structs
  • Use into_model() to properly deserialize Cosmos DB responses into your types

Evitar

  • Creating new client instances for each operation - causes unnecessary connection overhead
  • Omitting partition key in queries - results in cross-partition scans and higher costs
  • Using key-based authentication in production - less secure than managed identity or service principals
  • Storing large documents without considering 2MB item size limit

Preguntas frecuentes

How do I authenticate to Azure Cosmos DB locally?
Use DeveloperToolsCredential from azure_identity crate. Install Azure CLI first and run 'az login'. The credential automatically uses your Azure CLI identity for authentication.
What is the difference between replace_item and patch_item?
replace_item sends the complete document to Cosmos DB. patch_item uses RFC 6902 JSON Patch operations to modify specific fields, which is more efficient for partial updates.
Do I need to handle retry logic for Cosmos DB operations?
The azure_data_cosmos SDK includes built-in retry logic for transient failures. You can configure retry policies through client options if custom behavior is needed.
Can I use this skill with Cosmos DB MongoDB API?
No, this skill covers the NoSQL API only. MongoDB API requires different drivers and query patterns. Use MongoDB-compatible Rust drivers for MongoDB API accounts.
How do I handle Cosmos DB errors in Rust?
SDK methods return Result types. Match on error variants to handle specific cases like NotFound, Conflict, or RateLimited. Use the error() method on responses for details.
Is the Cosmos DB Rust SDK suitable for production?
Yes, azure_data_cosmos is a production-ready Microsoft-supported SDK. Ensure proper configuration of retry policies, timeouts, and connection pooling for production workloads.

Detalles del desarrollador

Estructura de archivos

📄 SKILL.md