AZ-204 Develop for Azure storage Practice Question
A serverless app must react whenever audit documents are inserted or updated in Cosmos DB. Which trigger should the Azure Function use? The design must avoid adding custom operational scripts.
⚠ Common exam trap
Many exam-takers confuse the Cosmos DB trigger with other triggers that require custom polling or external invocation, overlooking that the change feed provides a built-in, event-driven mechanism for reacting to data changes.
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
✓
Cosmos DB trigger
The Azure Cosmos DB trigger is the correct choice because it natively listens to the Cosmos DB change feed, which captures inserts and updates to documents. This allows the Azure Function to react automatically without any custom scripts or polling logic, aligning with the serverless and operational simplicity requirements.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Queue trigger
Why it's wrong here
A queue trigger fires on messages placed in a storage queue, so inserts and updates in Cosmos DB would never invoke it without extra code writing those messages. It is tempting because queues genuinely decouple producers from consumers, and would be right when another component already publishes work items.
- ✗
Timer trigger
Why it's wrong here
A timer trigger fires on a fixed schedule, so document changes are only detected by polling, adding latency and custom change-tracking logic. It is tempting because scheduled polling genuinely suits batch reconciliation, and would be right when the workload is periodic rather than event-driven.
- ✗
HTTP trigger
Why it's wrong here
HTTP triggers only fire on inbound HTTP requests, so they cannot detect Cosmos DB document inserts or updates. They suit REST APIs or webhooks where an external caller initiates execution. Reacting to database changes requires the Cosmos DB change feed trigger, which polls the container's feed automatically.
- ✓
Cosmos DB trigger
Why this is correct
The Cosmos DB trigger uses the change feed to react to inserts and updates across partitions, satisfying the requirement to fire on both operations. It is configured declaratively through function bindings, so no leases container scripting or custom operational scripts are needed, unlike manual change feed polling.
Visual reference
Quick reference
Cloud Service Model Comparison
| Model | You Manage | Provider Manages | Examples |
|---|---|---|---|
| IaaS | OS, runtime, apps, data | Hardware, hypervisor, networking | EC2, Azure VMs, GCP Compute Engine |
| PaaS | Apps and data | OS, runtime, middleware, hardware | Elastic Beanstalk, Azure App Service |
| SaaS | Data and settings only | Everything else | Microsoft 365, Salesforce, Workday |
| FaaS / Serverless | Function code only | Infra, scaling, runtime | Lambda, Azure Functions, Cloud Run |
| CaaS | Containers and apps | Kubernetes, OS, hardware | EKS, AKS, GKE |
Go deeper
Related to this question
About these practice questions
Courseiva writes every AZ-204 question from scratch — 883 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 →
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.