Microsoft Azure Developer Associate AZ-204 Practice Question
You are building a C# Azure Functions app that must react to every insert and update in the orders container of an Azure Cosmos DB for NoSQL database named sales. The solution must scale out to multiple Functions host instances, avoid hot partitions, and guarantee that no change is missed while each change is handled by only one host instance at any time. Which approach should you use?
Enable Cosmos DB diagnostic logging and have the Function poll the DataPlaneRequests table for inserts and updates.
Subscribe the Function to Azure Event Grid events emitted by the Cosmos DB account and filter on item write operations.
Use the Azure Cosmos DB Change Feed Processor library with a dedicated lease container and bind the orders container as the monitored source.
Create a stored procedure in the orders container that queries documents by their _ts metadata every minute and invoke it from the Function.
The Change Feed Processor library is built for reliably consuming the Azure Cosmos DB change feed. By registering the processor in the Azure Functions app and pointing it to a separate lease container, each host instance acquires leases on logical partitions so the workload is evenly divided. This coordination ensures that a given change is processed by only one host instance at a time and that no changes are skipped; the delivery guarantee is at-least-once, so the delegate code should be idempotent. Diagnostic logs require polling and do not prevent duplicate or missed processing. Azure Event Grid currently emits only control-plane events for Cosmos DB, not item-level mutations. A stored procedure that queries the _ts property would need custom scheduling, lacks automatic scaling, and risks missing or duplicating documents.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is the Azure Cosmos DB Change Feed Processor library?
Open an interactive chat with Bash
What is a lease container in Cosmos DB Change Feed architecture?
Open an interactive chat with Bash
Why does Azure Event Grid not work for item-level mutations in Cosmos DB?
Open an interactive chat with Bash
Microsoft Azure Developer Associate AZ-204
Develop for Azure storage
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
Pass with Confidence.
IT & Cybersecurity Package
You have hit the limits of our free tier, become a Premium Member today for unlimited access.
Military, Healthcare worker, Gov. employee or Teacher? See if you qualify for a Community Discount.
Monthly
$19.99 $11.99
$11.99/mo
Billed monthly, Cancel any time.
$19.99 after promotion ends
3 Month Pass
$44.99 $26.99
$8.99/mo
One time purchase of $26.99, Does not auto-renew.
$44.99 after promotion ends
Save $18!
MOST POPULAR
Annual Pass
$119.99 $71.99
$5.99/mo
One time purchase of $71.99, Does not auto-renew.
$119.99 after promotion ends
Save $48!
BEST DEAL
Lifetime Pass
$189.99 $113.99
One time purchase, Good for life.
Save $76!
What You Get
All IT & Cybersecurity Package plans include the following perks and exams .