Courseiva

AZ-204 Practice Question: Connect to and consume Azure services and third-party services

You are developing a solution that processes events from Azure Event Hubs and stores them in Azure Blob Storage. The processing must be idempotent and exactly-once. Which approach should you use?

⚠ Common exam trap

Watch out — candidates often confuse 'at-least-once' delivery (which is the default for Event Hubs and Azure Functions) with 'exactly-once' processing, and they overlook the critical role of checkpointing and lease management in achieving idempotent, exactly-once semantics.

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 EventProcessorHost with checkpointing and blob leases to track processed events

The EventProcessorHost (EPH) pattern with checkpointing and blob leases provides the foundation for exactly-once processing in Event Hubs. Checkpointing records the offset of the last successfully processed event in Azure Blob Storage, while blob leases ensure partition ownership and prevent duplicate processing by competing consumers. This combination allows the processor to resume from the last checkpoint after a failure, guaranteeing that each event is processed exactly once.

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 EventProcessorHost with checkpointing and blob leases to track processed events

    Why this is correct

    EventProcessorHost (or the modern EventProcessorClient) is the recommended pattern for robustly consuming events from Azure Event Hubs. It automatically manages partition ownership across multiple instances using blob leases in Azure Storage, ensuring that each partition is processed by only one consumer instance at a time. Checkpointing involves periodically recording the last successfully processed event's offset and sequence number to blob storage, allowing the consumer to resume processing from the correct point after failures or rebalancing, thereby achieving at-least-once delivery and enabling idempotent processing for effective exactly-once semantics.

  • Use Azure Functions with Event Hubs trigger and store events in batches

    Why it's wrong here

    Using Azure Functions with an Event Hubs trigger processes events in batches, but this alone does not guarantee exactly-once processing. If a function app fails mid-batch or during downstream processing, Azure Functions' retry mechanisms will re-deliver the entire batch, potentially leading to duplicate processing of events that were already handled before the failure. The Event Hubs trigger inherently provides at-least-once delivery, requiring the consumer logic to be idempotent to handle potential duplicates.

  • Use a simple consumer group and delete events after reading from Event Hubs

    Why it's wrong here

    Event Hubs operates as a distributed commit log, not a traditional message queue where messages are deleted after consumption. Consumers within a consumer group track their own progress by maintaining an offset, but they do not have the capability to delete events from the Event Hub itself. Events are retained for a configurable duration based on the Event Hub's retention policy, after which they automatically expire and are purged.

  • Implement a transactional outbox pattern with Azure SQL Database

    Why it's wrong here

    The transactional outbox pattern is designed to reliably publish messages from within a transactional boundary, typically from a database, ensuring atomicity between database changes and message publication. This pattern is not applicable here because the problem involves *consuming* events from Event Hubs and processing them, not *producing* events from an application's transactional context. It addresses a different reliability concern entirely, focused on event production rather than consumption.

Quick reference

Azure Blob Storage Tier Comparison

TierStorage CostRetrieval CostLatencyUse Case
HotHighestLowestImmediateActive data, frequent reads
CoolLowerHigherImmediateData accessed < once / month
ColdLower stillHigherImmediateData accessed < once / quarter
ArchiveLowestHighest + rehydration delayHoursLong-term compliance retention

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 →

How Courseiva writes practice questions · Editorial policy

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.