↓ Skip to main content
  1. Certifications/
  2. DP-420 Study Hub/

DP-420 Hands-On Labs

DP-420 asks what a request costs, which partition a query reaches, and what the SDK does when two writers collide. Those answers stick once you have seen them in a lab. The official DP-420 courseware from Microsoft Learning includes 20 labs for the new outline. They are all listed here, grouped by exam domain and objective. Most come in both C# and Python, so choose the language you know best.

Lab titles, descriptions, and durations come from the MicrosoftLearning/dp-420-cosmos-db-dev repository, and each lab opens in its official instructions. The labs are published and maintained by Microsoft Learning.

Before you start
#

  1. Create a lab resource group so every lab resource lives in one place and you can delete it all at once.
  2. Set up the lab environment if you prefer your own computer to a hosted lab environment. It lists the tools to install, including the .NET 8 SDK, Git, Visual Studio Code, and the Azure Cosmos DB emulator.

Keep costs down

The labs create real Azure resources. Use a subscription where you can create and delete resource groups, and delete the lab resource group when you finish so it does not keep costing money. Between labs, the free Azure Cosmos DB emulator runs locally, as a Linux-based Docker container or a Windows installation, and is ideal for trying the SDK patterns and queries on this site at no cost. See Develop locally with the emulator.

Domain 1: Design and develop database solutions

8 labs · about 5 hr 15 min in total

Module 1 · Objective 1.1 · 30 min

Create an Azure Cosmos DB for NoSQL account

Provision an Azure Cosmos DB for NoSQL account and create a database, container, and items.

Module 2 · Objective 1.1 · 30 min

Configure throughput and consistency

Configure autoscale throughput, set default and per-request consistency, and configure time to live, observing the effects on cost and behavior.

C#Python

Module 3 · Objective 1.1 · 30 min

Connect an app to Azure Cosmos DB

Import the SDK, create a singleton client, run against the emulator, switch to a cloud account, and add basic logging and error handling.

C#Python

Module 4 · Objective 1.2 · 45 min

Implement Data Operations

Perform point reads, writes, a conditional patch, an ETag-guarded replace, item time to live, a transactional batch, and a bulk load, comparing request-unit costs.

C#Python

Module 5 · Objective 1.2 · 45 min

Author and Page Queries

Load the CosmicWorks catalog, write parameterized and projected queries with built-in functions, add a correlated subquery and a cross-product query, and page results with continuation tokens.

C#Python

Module 6 · Objective 1.3 · 45 min

Design a model and partition strategy

Model the CosmicWorks entities for a set of access patterns, create a container with a hierarchical partition key, and validate that prefix queries route efficiently.

Module 7 · Objective 1.4 · 45 min

Process changes and copy data

Run a change feed consumer against a lease container, react to changes with an Azure Functions trigger, and copy a container onto a new partition key with a copy job.

C#Python

Module 8 · Objective 1.5 · 45 min

Inspect Azure Cosmos DB with Azure MCP Server

Use Azure MCP Server in Visual Studio Code to inspect the CosmicWorks catalog, query items, and verify the tool calls and results.

Domain 2: Secure, optimize, and deploy database solutions

7 labs · about 5 hr 15 min in total

Module 9 · Objective 2.1 · 45 min

Secure an account

Secure an Azure Cosmos DB for NoSQL account with Microsoft Entra authentication, a managed identity, scoped data-plane roles, and network access restrictions.

C#Python

Module 10 · Objective 2.2 · 45 min

Recover from a recovery point

Enable continuous backup on an Azure Cosmos DB for NoSQL account, delete a product and its container, and restore both to a recorded point in time.

C#Python

Module 11 · Objective 2.2 · 45 min

Configure Regions and Failover

Read the region topology of a two-region Azure Cosmos DB account, change its write region, enable multi-region writes, and take a region offline with a forced failover.

C#Python

Module 12 · Objective 2.3 · 45 min

Optimize an indexing strategy

Measure a baseline, trim an indexing policy, add a composite index, and create a global secondary index, comparing the request charge after each change.

C#Python

Module 13 · Objective 2.3 · 45 min

Tune a high-cost query

Baseline three operations against a product catalog, prove a scan with query metrics, rewrite the filter so the index serves it, add a composite index, and compare fan-out with single-partition routing.

C#Python

Module 14 · Objective 2.3 · 45 min

Diagnose throttling and configure an alert

Enable diagnostic logging, drive a container past its provisioned throughput, confirm the rate limiting from client diagnostics, Azure Monitor metrics, and Log Analytics, then create an alert rule.

C#Python

Module 15 · Objective 2.4 · 45 min

Create and Monitor a Fleet

Create a fleet and a pooled fleetspace, enroll two Azure Cosmos DB accounts, read pool and dedicated throughput in Azure Monitor, and send fleet analytics to Data Lake Storage Gen2.

Domain 3: Implement AI and analytics capabilities in database solutions

5 labs · about 3 hr 45 min in total

Module 16 · Objective 3.1 · 45 min

Build Native Search Over a Product Catalog

Load the CosmicWorks catalog with searchable text and embeddings, run BM25 and VectorDistance queries against one container, and refresh a stale embedding from the change feed.

C#Python

Module 17 · Objective 3.1 · 45 min

Build and Tune Hybrid Search

Load a catalog with searchable text and embeddings, measure keyword and semantic retrieval separately, fuse them with RRF, weight the fusion, and optimize the query against measured request charges.

C#Python

Module 18 · Objective 3.1 · 45 min

Build a grounded RAG assistant

Load the CosmicWorks catalog with embeddings, compare an ungrounded answer with a grounded one, test the refusal path, and observe what a prompt does with an instruction planted in retrieved data.

C#Python

Module 19 · Objective 3.2 · 45 min

Build a durable agent memory store

Write conversation turns that expire on their own, distill durable facts and embed them, recall one by meaning in a new session, measure what memory costs in a prompt, then supersede a contradiction and erase the user.

C#Python

Module 20 · Objective 3.3 · 45 min

Mirror an Azure Cosmos DB database and query it in Microsoft Fabric

Grant the custom role mirroring needs, mirror a database into Microsoft Fabric, read the replication status, query the mirrored tables with T-SQL including nested JSON, watch a change replicate, and read the same tables from Spark.

Go further
#

The Azure Cosmos DB Workshop from the Azure Cosmos DB team adds more .NET practice on querying, indexing, multi-document transactions, the change feed, performance troubleshooting, and optimistic concurrency. It predates the current product names, so read “SQL API” as Azure Cosmos DB for NoSQL, and expect older SDK and tool versions than the official labs use.