Courseiva

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

You are developing a microservice that needs to publish events to multiple subscribers. Each subscriber should receive the event independently and at its own pace. The event must be retained for up to 7 days. Which Azure messaging service should you use?

⚠ Common exam trap

Candidates often confuse Event Grid's pub/sub capabilities with the durable messaging requirements of Service Bus Topics. While Event Grid supports multiple subscribers, it is optimized for near real-time event routing and does not provide durable message retention for subscribers to pick up events at their own pace over several days. Its retry mechanism is limited (max 24 hours), and dead-lettering is for failed deliveries, not for holding events for slow subscribers. Service Bus Topics, conversely, offer durable subscriptions where messages are retained for each subscriber until processed, fulfilling the long-term retention 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

Azure Service Bus topic

Azure Service Bus Topic is the correct choice. It provides a publish-subscribe model where each subscriber receives events independently through its own durable subscription. Messages are retained within each subscription until they are processed or their time-to-live expires (up to 14 days by default), which perfectly meets the requirement for events to be retained for up to 7 days for subscribers to consume at their own pace. Event Grid is designed for near real-time event delivery and does not offer durable message retention for subscribers over several days; its retry policy is limited to a maximum of 24 hours.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Azure Service Bus queue

    Why it's wrong here

    Azure Service Bus queues are designed for reliable, asynchronous, one-to-one message delivery, where a single consumer processes each message. They implement a competing consumer pattern, meaning once a message is consumed, it's removed from the queue. This model does not support the fan-out required for a microservice to publish an event to multiple independent subscribers, as each subscriber would need its own copy of the event.

  • Azure Service Bus topic

    Why this is correct

    Azure Service Bus topic subscriptions provide each subscriber with an independent copy of the message, yet messages are removed from the subscription as soon as they are consumed. This means the event is not retained for the full seven-day window if all subscribers have processed it early. Event Hubs retains events in a partitioned log for the entire retention period regardless of consumption, supporting replay. Service Bus topics are tempting because they offer reliable pub/sub messaging and would be correct when you need transactional guarantees or message sessions, not long-term event storage.

  • Azure Event Grid

    Why it's wrong here

    Azure Event Grid is a highly scalable, fully managed event routing service designed for reactive, event-driven architectures. It natively supports the publish/subscribe pattern, allowing a microservice to publish events to an Event Grid topic, which then reliably delivers these events to multiple independent subscribers. While Event Grid itself doesn't retain events for long periods in the topic, its subscriptions offer robust retry mechanisms and dead-lettering, ensuring events are eventually processed even if subscribers are temporarily unavailable, making it ideal for real-time event distribution.

  • Azure Event Hubs

    Why it's wrong here

    Azure Event Hubs is a highly scalable data streaming platform and event ingestion service optimized for processing millions of events per second. It's designed for capturing telemetry and distributed stream processing, where data is typically consumed by stream processors that read from a partitioned, time-ordered log. While it supports multiple consumers, its primary use case is high-throughput data ingestion and stream processing, not the discrete event-driven fan-out to independent subscribers typically associated with microservice event publishing.

Go deeper

Related to this question

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 →

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.