Connect to and consume Azure services and third-party services →mediumMultiple ChoiceObjective-mapped
AZ-204 Practice Question: Connect to and consume Azure services and third-party services
You are building an Azure Logic App that must consume messages from an Azure Service Bus queue. The queue messages are JSON payloads containing order information. The Logic App must process each message exactly once and in the order they are received. You need to configure the trigger in the Logic App. Which trigger type and property should you choose?
⚠ Common exam trap
Candidates often assume PeekLock mode alone guarantees ordering, but without sessions, multiple concurrent trigger instances can pick up messages from the same queue out of order, breaking the FIFO requirement.
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
✓
Use a Service Bus trigger with the 'PeekLock' mode and set the 'IsSessionsEnabled' property to true
Service Bus sessions provide first-in-first-out (FIFO) ordering and exactly-once processing. By enabling sessions (IsSessionsEnabled = true) and using PeekLock mode, the Logic App can lock a message while processing, ensuring it is not delivered to other consumers, and sessions guarantee that messages with the same session ID are processed in order. This meets the requirement of processing each message exactly once and in the order received.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Use a Service Bus trigger with the 'PeekLock' mode and set the 'IsSessionsEnabled' property to false
Why it's wrong here
The 'PeekLock' mode allows the Logic App to process a message and then explicitly complete or abandon it, providing at-least-once delivery. However, setting 'IsSessionsEnabled' to false means the Service Bus queue or topic does not guarantee the order in which messages are delivered or processed. This configuration fails to meet the requirement for ordered message consumption, as messages could be processed out of sequence despite the individual message reliability.
- ✗
Use a Service Bus trigger with the 'ReceiveAndDelete' mode
Why it's wrong here
The 'ReceiveAndDelete' mode immediately removes a message from the Service Bus queue or topic as soon as it is retrieved by the Logic App. If any subsequent processing steps within the Logic App fail, the message is permanently lost and cannot be reprocessed. This 'at-most-once' delivery guarantee directly violates the requirement for robust, exactly-once processing, as it introduces a significant risk of data loss and incomplete operations.
- ✓
Use a Service Bus trigger with the 'PeekLock' mode and set the 'IsSessionsEnabled' property to true
Why this is correct
The 'PeekLock' mode ensures 'at-least-once' delivery by requiring the Logic App to explicitly complete or abandon a message, allowing for reprocessing on failure. Crucially, enabling 'IsSessionsEnabled' on the Service Bus queue or topic guarantees First-In, First-Out (FIFO) ordering for messages within a specific session. Combining these features provides both reliable message processing with retry capabilities and strict message order, fulfilling the requirements for exactly-once processing and ordered consumption.
- ✗
Use an Event Grid trigger for Service Bus
Why it's wrong here
An Event Grid trigger for Service Bus reacts to specific events, such as a message being dead-lettered or a session being created, rather than directly consuming messages from the queue. While useful for reactive scenarios, Event Grid does not inherently enforce message ordering or provide the mechanisms for managing message state like PeekLock. Therefore, it cannot guarantee exactly-once processing or ordered message consumption, making it unsuitable for this specific requirement.
Go deeper
Related to this question
Learn chapter
Azure Functions Development
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.
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.
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.