Courseiva

AZ-204 Practice Question: Connect to and consume Azure services and third-party services

You are building a solution that uses Azure Cosmos DB for NoSQL. You need to implement a change feed processor to handle real-time updates. The application runs on multiple instances to ensure high availability. Which lease container configuration ensures that each instance processes a distinct set of partitions?

⚠ Common exam trap

Test-takers frequently confuse the partition key of the monitored container with the partition key of the lease container, assuming they must match or that throughput settings control distribution, when in fact the lease container's partition key must be /id for proper lease management.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

Use a separate lease container with partition key /id

The change feed processor uses a lease container to track which partitions each instance is processing. By setting the partition key to /id, each lease document is uniquely identified, allowing the processor to distribute partitions across instances. This ensures that each instance processes a distinct set of partitions, enabling horizontal scaling without duplication.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Set the partition key of the monitored container to /city

    Why it's wrong here

    The partition key of the monitored container dictates how data within that container is physically distributed across logical and physical partitions in Azure Cosmos DB. While crucial for data ingestion and query performance, it has no direct bearing on how the Change Feed Processor distributes its workload (leases) across multiple consumer instances. The processor's distribution logic relies solely on the lease container, not the monitored container's partitioning.

  • Configure the change feed to start from the beginning

    Why it's wrong here

    Configuring the change feed to start from the beginning (or a specific point in time) determines the initial set of changes that the Change Feed Processor will consume. This setting is about the *history* of changes processed, not about enabling or optimizing the parallel distribution of processing tasks across multiple instances. The distribution mechanism relies on the lease container and its partitioning, not the starting point.

  • Use a separate lease container with partition key /id

    Why this is correct

    Using a separate lease container with a partition key of /id is the correct approach because the Change Feed Processor leverages this specific partitioning strategy. Each logical partition of the monitored container is assigned a unique "lease" document in the lease container. By partitioning the lease container by /id, the processor ensures that these lease documents are evenly distributed, allowing different consumer instances to acquire and manage leases for distinct logical partitions in parallel, thereby distributing the workload effectively.

  • Set the lease container's throughput to 1000 RU/s

    Why it's wrong here

    Setting the lease container's throughput to 1000 RU/s (or any specific value) directly impacts the performance and cost of the Change Feed Processor operations, such as acquiring, renewing, and releasing leases. While sufficient throughput is necessary for efficient operation, it does not inherently enable or configure the *distribution* mechanism itself. The distribution of leases across instances is determined by the lease container's partition key and the processor's internal logic, not its provisioned throughput.

Visual reference

Client DHCP Server 1 Discover (broadcast) 2 Offer (IP: 192.168.1.10) 3 Request (I accept) 4 Acknowledge (lease confirmed) DORA — the four-step DHCP lease process

About these practice questions

Courseiva writes every AZ-204 question from scratch — 881 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This AZ-204 practice question is part of Courseiva's free Microsoft certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the AZ-204 exam.