Question

Difficulty: EasyProcess Azure Cosmos DB Change Feed Notifications

You are creating a new lease container in Azure Cosmos DB to support a Change Feed Processor instance. Which partition key path must be defined on the lease container for it to function correctly?

  1. /idAnswer
  2. B
    /partitionKey
  3. C
    /leaseId
  4. D
    /status

Answer

/id
The correct answer is /id because the Azure Cosmos DB Change Feed Processor requires the lease container to use the /id partition key path. This allows the processor to uniquely identify and lease individual partitions.

Step-by-Step Solution

1
Identify the role of the lease container in Azure Cosmos DB Change Feed.
The lease container stores state and coordinates the processing of the change feed across multiple consumers.
This determines the design constraints for the container's partitioning.
2
Check the partitioning requirements for the lease container as defined by the Cosmos DB SDK.
The Cosmos DB SDK Change Feed Processor specifically requires the lease container's partition key path to be /id.
Using any other path prevents the SDK from executing partition-lease operations, causing initialization to fail.

Key Concept

Azure Cosmos DB Change Feed lease container partition key requirement
Rate this question