AZ-204 Develop for Azure storage Practice Question
You are building a serverless application that needs to react to insertions and updates in an Azure Cosmos DB container. You want to process these changes using an Azure Function. Which trigger should you configure for the function?
⚠ Common exam trap
Test-takers frequently confuse the Cosmos DB trigger with the Event Grid trigger, thinking Event Grid can directly subscribe to Cosmos DB changes, but Event Grid requires a custom event publisher or a separate Azure service like Azure Functions to bridge the change feed.
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
A Cosmos DB trigger is the correct choice because it is specifically designed to react to changes in a Cosmos DB container by leveraging the change feed. The Azure Function runtime polls the change feed for inserts and updates, invoking the function with batches of documents as they occur. This provides a native, serverless integration without needing additional services.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
Cosmos DB trigger
Why this is correct
The Azure Cosmos DB trigger is the native and most efficient mechanism for building serverless applications that react to changes in a Cosmos DB container. It directly leverages the built-in change feed functionality of Cosmos DB, which provides a persistent, ordered log of all document inserts, updates, and optionally deletes. This allows an Azure Function to process data modifications in near real-time without the need for inefficient polling, making it ideal for event-driven architectures.
- ✗
Blob trigger
Why it's wrong here
An Azure Blob trigger is specifically designed to activate an Azure Function when a new or updated blob is detected in an Azure Storage container. Its primary purpose is to process files stored in Azure Blob Storage, such as images, videos, or log files, upon their creation or modification. This trigger has no inherent capability to monitor or respond to data changes occurring within an Azure Cosmos DB database, making it unsuitable for this scenario.
- ✗
Event Grid trigger
Why it's wrong here
While Azure Event Grid can route events from Cosmos DB, it typically requires explicit configuration within Cosmos DB to publish specific events (e.g., document creation) to Event Grid. An Event Grid trigger then reacts to these discrete events. However, for continuous, real-time processing of *all* inserts and updates via the change feed, the native Cosmos DB trigger is the more direct, efficient, and simpler solution, as it directly integrates with the change feed processor for comprehensive data change monitoring.
- ✗
Service Bus trigger
Why it's wrong here
An Azure Service Bus trigger is specifically designed to activate an Azure Function in response to messages arriving in an Azure Service Bus queue or topic. It is primarily used for decoupled messaging scenarios, enabling reliable communication and workflow orchestration between different application components. This trigger is entirely focused on message processing and does not provide any mechanism to directly monitor or react to data modifications within a database like Azure Cosmos DB.
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
One of 881 original AZ-204 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. 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.