AZ-204 Practice Question: Connect to and consume Azure services and third-party services
You develop an IoT solution using Azure IoT Hub. Devices send telemetry data that must be processed by a custom Azure Function. You need to ensure that the Function processes messages in order per device and exactly once. Which IoT Hub feature should you use?
⚠ Common exam trap
A common mix-up: candidates confuse IoT Hub's message routing (which can send to multiple endpoints) with the built-in Event Hub-compatible endpoint, not realizing that only the latter provides the partition-based ordering and checkpointing needed for per-device exactly-once processing.
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 IoT Hub's built-in Event Hub-compatible endpoint with a consumer group that has one partition per device.
IoT Hub's built-in Event Hub-compatible endpoint supports partitioning, and by using a consumer group with one partition per device, you can guarantee per-device ordering and exactly-once processing. The Event Hub model ensures that messages from the same device (same partition key) are delivered in order and can be checkpointed to avoid duplicates.
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 IoT Hub message routing to send messages to a Service Bus queue, and process from the queue.
Why it's wrong here
Service Bus queues, while a valid routing endpoint for IoT Hub, are not optimized for high-volume, ordered telemetry streams. They do not inherently guarantee message ordering across all messages or partitions, which is often critical for IoT data. Achieving exactly-once delivery with Service Bus queues typically requires implementing complex deduplication logic on the consumer side, making them less suitable for the streaming nature of IoT telemetry compared to Event Hubs.
- ✗
Use IoT Hub direct methods to invoke the Function per device.
Why it's wrong here
IoT Hub direct methods are designed for synchronous command-and-control scenarios, enabling a backend application to invoke a method on a specific device. They are not intended for high-volume, asynchronous telemetry ingestion from devices. Using direct methods for telemetry would introduce significant overhead, be highly inefficient, and quickly lead to throttling limits, as their purpose is device management and interaction, not data streaming.
- ✗
Use IoT Hub device twins to store telemetry and trigger the Function on twin changes.
Why it's wrong here
Device twins are primarily used for storing device metadata and managing desired/reported state, not for high-frequency telemetry data streams. They have inherent size limits and throttling policies that make them unsuitable for continuous, high-throughput telemetry ingestion. Attempting to store telemetry in device twins would rapidly exceed these limits and cause performance issues, as their core function is state synchronization, not data streaming.
- ✓
Use IoT Hub's built-in Event Hub-compatible endpoint with a consumer group that has one partition per device.
Why this is correct
IoT Hub's built-in endpoint is fully compatible with Azure Event Hubs, making it the ideal choice for high-throughput telemetry ingestion. By configuring devices to use their Device ID as the partition key, all messages from a specific device are guaranteed to be routed to the same Event Hub partition. This ensures message ordering *per device* within that partition, and processing with a dedicated consumer group per partition allows for scalable, ordered, and at-least-once delivery, with idempotent processing achieving exactly-once semantics.
Go deeper
Related to this question
About these practice questions
This AZ-204 question is part of Courseiva's 881-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam 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.