You plan to add a new Azure Function with a Cosmos DB trigger to build a fresh analytics index from an existing container. The function must process all historical documents from the container exactly once and then continue with live changes. Other change feed processors already use an existing lease container. What should you configure for the new function?
Choose an answer
Tap an option to check your answer.
Correct answer: Set startFromBeginning = true on the binding and use a dedicated new lease container (or a unique lease prefix) for this function..
Why this is the answer
To process all historical documents from a Cosmos DB container with a new Azure Function, you must set startFromBeginning = true in the Cosmos DB trigger binding. This ensures the function starts reading from the beginning of the change feed. Since other change feed processors are already using an existing lease container, your new function needs its own dedicated lease container or a unique lease prefix. This prevents conflicts and ensures independent progress tracking for each processor. Reusing the existing lease container would cause conflicts and prevent the new function from processing historical data independently. Deleting and recreating the monitored container is not a practical or scalable solution. Increasing MaxItemsPerInvocation and Prefetch only affects the batch size and efficiency of reading, not the starting point of the change feed.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed