AZ-204 Develop Azure compute solutions Practice Question
You are designing a serverless application using Azure Functions. The solution must process messages from an Azure Service Bus queue and update a Cosmos DB database. Which binding configuration should you use on the function?
⚠ Common exam trap
Many exam-takers confuse output bindings with input bindings or choose a trigger that does not match the event source, such as selecting a Blob or HTTP trigger when the requirement explicitly states a Service Bus queue as the message source.
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
✓
Service Bus trigger with Cosmos DB output binding
The requirement specifies processing messages from an Azure Service Bus queue and updating a Cosmos DB database. A Service Bus trigger binds the function to the queue, and a Cosmos DB output binding writes the processed data directly to Cosmos DB, enabling a seamless serverless workflow without additional code for database operations.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Service Bus trigger with Table storage output binding
Why it's wrong here
While a Service Bus trigger is appropriate for processing queue messages, using a Table storage output binding would direct the processed data to Azure Table Storage. Azure Table Storage is a NoSQL key-value store that differs significantly from Azure Cosmos DB in terms of features, APIs, and performance characteristics. If the application specifically requires the advanced capabilities, consistency models, or multi-model support of Cosmos DB, then Table storage is an incorrect choice for data persistence.
- ✗
Blob trigger with Cosmos DB output binding
Why it's wrong here
A Blob trigger is specifically engineered to react to events occurring in Azure Blob Storage, such as the creation or modification of a blob. It is used for scenarios like image processing or file ingestion, not for message-driven architectures. Consequently, a Blob trigger cannot listen for or process messages arriving in an Azure Service Bus queue, making it an inappropriate choice for an application that needs to respond to queue messages.
- ✗
HTTP trigger with Cosmos DB input binding
Why it's wrong here
An HTTP trigger is designed to respond to direct HTTP requests, such as from a web browser or an API call, rather than passively listening for messages in a queue. Therefore, it is unsuitable for initiating a function execution based on messages arriving in an Azure Service Bus queue. Furthermore, while Cosmos DB input bindings can retrieve data, an output binding is typically preferred for updating or inserting new records based on processed queue messages.
- ✓
Service Bus trigger with Cosmos DB output binding
Why this is correct
This combination correctly leverages Azure Functions for a queue-driven database update. A Service Bus trigger is specifically designed to activate an Azure Function whenever a new message is posted to an Azure Service Bus queue or topic. The Cosmos DB output binding then provides a straightforward and efficient way for the function to persist or update documents within an Azure Cosmos DB container, directly fulfilling the requirement for a queue-triggered database interaction.
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
Learn chapter
Azure Functions Development
Key term
Durable Functions
Durable Functions is an extension of Azure Functions that lets you write stateful workflows in code, managing complex sequences of tasks, retries, and delays automatically.
Key term
Azure Functions Bindings
Azure Functions Bindings are declarative connections that link your serverless function code to Azure services or external resources, handling input and output data automatically without writing extra networking or authentication code.
About these practice questions
Courseiva writes every AZ-204 question from scratch — 881 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.