AZ-204 Practice Question: Connect to and consume Azure services and third-party services
A company uses Azure Functions to process orders. The function needs to read messages from an Azure Service Bus queue. Which binding should the developer configure in the function.json?
⚠ Common exam trap
Watch out — candidates often confuse Azure Storage queues (`queueTrigger`) with Azure Service Bus queues (`serviceBusTrigger`), as both are messaging services but use different trigger bindings and have distinct features like sessions and topics in Service Bus.
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
✓
serviceBusTrigger
The correct binding for reading messages from an Azure Service Bus queue in an Azure Functions app is `serviceBusTrigger`. This trigger binding listens to a Service Bus queue or topic subscription and invokes the function when a message arrives. Option D is correct because it specifically names the Service Bus trigger, which is designed for this purpose.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
serviceBus
Why it's wrong here
The binding type "serviceBus" is used for output bindings to send messages to an Azure Service Bus queue or topic, or for input bindings to read messages without triggering the function. However, it is not a valid trigger binding name on its own. Azure Functions require a specific trigger binding, such as "serviceBusTrigger", to explicitly define the event that initiates the function's execution from a Service Bus entity, ensuring proper integration and message handling.
- ✗
eventHubTrigger
Why it's wrong here
The "eventHubTrigger" binding is specifically designed to integrate Azure Functions with Azure Event Hubs, a highly scalable data streaming platform optimized for ingesting millions of events per second. It enables functions to process events from an Event Hub, typically used for telemetry, distributed logging, or stream processing scenarios. This trigger is distinct from Service Bus, which focuses on reliable message delivery and transactional messaging patterns, making "eventHubTrigger" unsuitable for Service Bus queues.
- ✗
queueTrigger
Why it's wrong here
The "queueTrigger" binding is exclusively used for integrating Azure Functions with Azure Storage Queues, a simple and cost-effective messaging solution primarily for decoupling application components and asynchronous task processing. It allows a function to be invoked whenever a new message is added to a specified Azure Storage Queue. This trigger is fundamentally different from "serviceBusTrigger", which is designed for the more advanced features and enterprise messaging capabilities offered by Azure Service Bus, including message sessions and dead-lettering.
- ✓
serviceBusTrigger
Why this is correct
The "serviceBusTrigger" binding is the correct and designated mechanism for an Azure Function to be invoked in response to messages arriving on an Azure Service Bus queue or topic. This trigger automatically handles message reception, deserialization, and completion, allowing the function to process messages reliably. It supports various Service Bus features, including peek-lock processing, message sessions, and dead-lettering, making it ideal for robust enterprise messaging scenarios like order processing.
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
Azure Relay
Azure Relay is a cloud service that securely exposes on-premises web services to the public internet or other cloud applications without opening firewall ports.
Key term
Azure Service Bus
Azure Service Bus is a cloud-based message broker that allows applications, services, and devices to send and receive messages reliably, even when they are not all running at the same time.
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.