Skip to content
Back to skills

Cosmosdb Sdk

ASecurity

Azure Cosmos DB SDK best practices for .NET, Java, Python, Spring Boot, and LangChain: singleton client, async APIs, connection modes, retry handling, diagnostics, serialization, emulator configuration, ETags, and framework-specific patterns. USE FOR: CosmosClient singleton, async API, Direct vs Gateway mode, retry 429, preferred regions, excluded regions, availability strategy, circuit breaker, SDK diagnostics, serialization enums, emulator SSL, ETag concurrency, conditional create, patch in...

  • 3 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added September 11, 2026
ai-agentspythongojavaspringazureapi

Works with

  • cli
  • api
  • mcp

Security analysis

A100/100

Pro scans all 20 files and shows the line behind each finding

Scanned September 11, 2026

npx -y skills add atc-net/atc-agentic-toolkit --skill cosmosdb-sdk --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Cosmosdb Sdk?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Cosmosdb Sdk
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/atc-net-cosmosdb-sdk/badge)](https://www.skillsdirectory.com/skills/atc-net-cosmosdb-sdk)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: cosmosdb-sdk
description: >
  Azure Cosmos DB SDK best practices for .NET, Java, Python, Spring Boot, and
  LangChain: singleton client, async APIs, connection modes, retry handling,
  diagnostics, serialization, emulator configuration, ETags,
  and framework-specific patterns.
  USE FOR: CosmosClient singleton, async API, Direct vs Gateway mode, retry 429,
  preferred regions, excluded regions, availability strategy, circuit breaker,
  SDK diagnostics, serialization enums, emulator SSL, ETag concurrency,
  conditional create, patch increment, continuation token, content response,
  Spring Data Cosmos, Spring Boot versions, Newtonsoft dependency, namespace collision,
  Python async deps, local dev config, LangChain Cosmos DB saver, LangGraph checkpointer,
  MCP persistent session, tool content format, tool filtering,
  LangChain JS vectorstore, chat history, semantic cache.
  DO NOT USE FOR: data modeling (use cosmosdb-data-modeling), queries (use cosmosdb-query-optimization),
  partition keys (use cosmosdb-partition-key).
---

# Azure Cosmos DB SDK Best Practices

SDK usage patterns and framework-specific guidance for Azure Cosmos DB across .NET, Java, Python, Spring Boot, and LangChain.

## When to Apply

Reference these guidelines when:
- Configuring CosmosClient instances
- Choosing connection modes (Direct vs Gateway)
- Handling retries and throttling
- Setting up the Cosmos DB Emulator
- Using ETags for optimistic concurrency
- Integrating with Spring Boot or LangChain
- Configuring availability and resilience features

## Rules

- [sdk-singleton-client](references/sdk-singleton-client.md) - Reuse CosmosClient as singleton
- [sdk-async-api](references/sdk-async-api.md) - Use async APIs for throughput
- [sdk-retry-429](references/sdk-retry-429.md) - Handle 429s with retry-after
- [sdk-connection-mode](references/sdk-connection-mode.md) - Use Direct mode for production
- [sdk-preferred-regions](references/sdk-preferred-regions.md) - Configure preferred regions
- [sdk-excluded-regions](references/sdk-excluded-regions.md) - Exclude regions experiencing issues
- [sdk-availability-strategy](references/sdk-availability-strategy.md) - Configure availability strategy
- [sdk-circuit-breaker](references/sdk-circuit-breaker.md) - Use circuit breaker for fault tolerance
- [sdk-diagnostics](references/sdk-diagnostics.md) - Log diagnostics for troubleshooting
- [sdk-serialization-enums](references/sdk-serialization-enums.md) - Serialize enums as strings
- [sdk-emulator-ssl](references/sdk-emulator-ssl.md) - Configure SSL for Cosmos DB Emulator
- [sdk-etag-concurrency](references/sdk-etag-concurrency.md) - Use ETags for optimistic concurrency
- [sdk-conditional-create-etag](references/sdk-conditional-create-etag.md) - Reject duplicates atomically
- [sdk-request-options-per-call](references/sdk-request-options-per-call.md) - Never reuse request options
- [sdk-patch-counter-increment](references/sdk-patch-counter-increment.md) - Use patch incr for atomic counters
- [sdk-continuation-token-null-guard](references/sdk-continuation-token-null-guard.md) - Guard empty continuation tokens
- [sdk-java-content-response](references/sdk-java-content-response.md) - Enable content response on writes (Java)
- [sdk-java-cosmos-config](references/sdk-java-cosmos-config.md) - Configure Cosmos DB in Spring Boot
- [sdk-java-spring-boot-versions](references/sdk-java-spring-boot-versions.md) - Match Java to Spring Boot versions
- [sdk-local-dev-config](references/sdk-local-dev-config.md) - Configure local development
- [sdk-dotnet-cosmos-package-id](references/sdk-dotnet-cosmos-package-id.md) - Use correct NuGet package
- [sdk-newtonsoft-dependency](references/sdk-newtonsoft-dependency.md) - Reference Newtonsoft.Json explicitly
- [sdk-python-async-deps](references/sdk-python-async-deps.md) - Include aiohttp for Python async
- [sdk-go-partition-key-metadata](references/sdk-go-partition-key-metadata.md) - Use current Go SDK with explicit partition-key metadata
- [sdk-spring-data-annotations](references/sdk-spring-data-annotations.md) - Annotate entities for Spring Data
- [sdk-spring-data-repository](references/sdk-spring-data-repository.md) - Use CosmosRepository correctly
- [sdk-dotnet-namespace-collision](references/sdk-dotnet-namespace-collision.md) - Avoid namespace collisions
- [sdk-langchain-cosmosdb-saver](references/sdk-langchain-cosmosdb-saver.md) - CosmosDBSaver for LangGraph
- [sdk-langchain-async-checkpointer](references/sdk-langchain-async-checkpointer.md) - Async container init
- [sdk-langchain-mcp-persistent-session](references/sdk-langchain-mcp-persistent-session.md) - Persistent MCP sessions
- [sdk-langchain-mcp-tool-content-format](references/sdk-langchain-mcp-tool-content-format.md) - MCP tool content format
- [sdk-langgraph-mcp-tool-filtering](references/sdk-langgraph-mcp-tool-filtering.md) - Filter MCP tools by prefix
- [sdk-langchain-js-vectorstore-init](references/sdk-langchain-js-vectorstore-init.md) - LangChain JS vectorstore init
- [sdk-langchain-js-chat-history](references/sdk-langchain-js-chat-history.md) - LangChain JS chat history
- [sdk-langchain-js-embedding-model](references/sdk-langchain-js-embedding-model.md) - LangChain JS embedding model
- [sdk-langchain-js-filter-injection](references/sdk-langchain-js-filter-injection.md) - LangChain JS filter injection
- [sdk-langchain-js-fulltext-prerequisites](references/sdk-langchain-js-fulltext-prerequisites.md) - LangChain JS FTS prerequisites
- [sdk-langchain-js-managed-identity](references/sdk-langchain-js-managed-identity.md) - LangChain JS managed identity
- [sdk-langchain-js-search-types](references/sdk-langchain-js-search-types.md) - LangChain JS search types
- [sdk-langchain-js-semantic-cache](references/sdk-langchain-js-semantic-cache.md) - LangChain JS semantic cache

Files in this skill

  • SKILL.md5.7 KB
  • references/sdk-async-api.md3.2 KB
  • references/sdk-availability-strategy.md5.3 KB
  • references/sdk-circuit-breaker.md8.4 KB
  • references/sdk-conditional-create-etag.md2.8 KB
  • references/sdk-connection-mode.md2.9 KB
  • references/sdk-continuation-token-null-guard.md3.2 KB
  • references/sdk-diagnostics.md6.7 KB
  • references/sdk-dotnet-cosmos-package-id.md1.8 KB
  • references/sdk-dotnet-namespace-collision.md2.8 KB
  • references/sdk-emulator-ssl.md15.1 KB
  • references/sdk-etag-concurrency.md9.5 KB
  • references/sdk-excluded-regions.md4.9 KB
  • references/sdk-go-partition-key-metadata.md3 KB
  • references/sdk-java-content-response.md8.2 KB
  • references/sdk-java-cosmos-config.md10.1 KB
  • references/sdk-java-spring-boot-versions.md4.8 KB
  • references/sdk-langchain-async-checkpointer.md2.8 KB
  • references/sdk-langchain-cosmosdb-saver.md2.6 KB
  • references/sdk-langchain-js-chat-history.md3.4 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…