migrating-documentdb-to-cosmos

Automate migration from DocumentDB SDK V2 to Cosmos SDK V3 in .NET applications.

19|2|Updated May 13, 2026
One-click install
npx skills add https://github.com/microsoft/upgrade-agent-plugins --skill migrating-documentdb-to-cosmos
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: migrating-documentdb-to-cosmos
Source: https://github.com/microsoft/upgrade-agent-plugins/tree/main/plugins/upgrade-agent/extenders/upgrade-dotnet/upgrade/skills/lazy/libraries/migrating-documentdb-to-cosmos
Command: npx skills add https://github.com/microsoft/upgrade-agent-plugins --skill migrating-documentdb-to-cosmos

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill simplifies the migration process from the deprecated Microsoft.Azure.DocumentDB SDK (V2) to the modern Microsoft.Azure.Cosmos SDK (V3) for Azure Cosmos DB, ensuring compatibility and performance upgrades.

Core Features & Use Cases

  • Automatic SDK Version Detection: Identifies usage of the DocumentDB SDK V2 in the project.
  • Package Reference Update: Recommends replacing the old package reference with the latest stable version of the Cosmos SDK.
  • Client and Resource Model Replacement: Provides instructions for updating the client and resource model to use the V3 SDK.
  • CRUD Operation Conversion: Offers guidance on converting CRUD operations from V2 to V3.
  • Query Update: Shows how to update queries to work with the V3 SDK.
  • Error Handling Migrations: Explains how to adapt error handling from V2 to V3.
  • Build and Verification Steps: Ensures the migration is successful through build and verification steps.
  • API Differences: Details the differences between the DocumentDB V2 and Cosmos V3 SDKs.
  • Troubleshooting: Offers solutions for common migration issues.
  • Use Case: Suitable for developers looking to upgrade their applications to leverage the benefits of the newer Cosmos SDK.

Quick Start

Run the 'migrating-documentdb-to-cosmos' skill to begin the migration process from DocumentDB SDK V2 to Cosmos SDK V3.

Frequently Asked Questions about migrating-documentdb-to-cosmos

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I migrate a .NET application from DocumentDB SDK V2 to Azure Cosmos SDK V3?

Migrating from DocumentDB SDK V2 to Azure Cosmos SDK V3 involves updating package references, replacing client and resource models, and converting CRUD operations. This migration ensures compatibility and performance improvements for .NET applications using Azure Cosmos DB.

What is the difference between DocumentDB SDK V2 and Cosmos SDK V3?

The difference between DocumentDB SDK V2 and Cosmos SDK V3 includes changes in client and resource models, CRUD operation syntax, query execution, and error handling. Cosmos SDK V3 is the modern replacement for the deprecated V2 SDK.

How do I update CRUD operations when upgrading to Cosmos SDK V3?

Updating CRUD operations for Cosmos SDK V3 requires adapting to the new V3 client and resource model syntax. The migration process provides specific guidance on converting create, read, update, and delete operations from V2 to V3.

How do I handle error handling migration from DocumentDB V2 to Cosmos V3?

Error handling migration from DocumentDB V2 to Cosmos V3 requires adapting to the new exception handling mechanisms in the V3 SDK. The migration process explains how to update error handling logic to ensure compatibility with V3.

Can I use this migration process for any .NET application using Azure Cosmos DB?

This migration process applies specifically to .NET applications using Azure Cosmos DB with the deprecated DocumentDB SDK V2. It automatically detects V2 usage and recommends replacing it with the latest stable Cosmos SDK V3 package.

Why does my DocumentDB SDK V2 to Cosmos SDK V3 migration fail during build verification?

Migration build verification can fail due to incomplete package reference updates, unconverted CRUD operations, or incompatible client models. The troubleshooting guidance offers solutions for common migration issues to ensure a successful build.