AZ-204 Developing Solutions for Microsoft Azure Exam

You can develop, but can you develop for the cloud? Harness your development skills and learn how to create robust solutions for Microsoft Azure, aiming for your Microsoft Certified: Azure Developer Associate certification!

Practice Test

Exam

Implement solutions that use Azure Event Grid

Configure Event Subscriptions and Topics

Azure Event Grid uses event-driven architecture to link event publishers and handlers. A topic is an endpoint where events are published, and an event subscription defines where and how events should be sent. This design creates a loosely coupled system that can handle high volumes of events. You can react to changes in Azure services or your own applications by hooking up event handlers like WebHooks, Azure Functions, or Logic Apps. With Event Grid, your solution becomes scalable and flexible.

Azure Event Grid supports different topic types to fit your scenario. You can choose from:

  • Custom topics for sending events from your own applications.
  • System topics automatically created when Azure services like Storage or Service Bus emit events.
  • Namespace topics used for MQTT protocol routing with a simplified filter model.
  • Partner topics designed for integrating third-party SaaS or ERP systems.
    These options help you create an organized and scalable event system.

To create a custom topic in the Azure portal, follow these steps:

  • Go to Event Grid Topics and click + Create.
  • Choose an Event Schema such as CloudEvents or the Event Grid format.
  • Set the Data residency option for regional or cross-geo replication.
  • Configure tags, then review settings and click Review + Create.
    Once configured, you can start publishing events to this topic via the Azure SDK or REST API. Your topic appears in the portal when it’s ready.

After you have a topic, create an event subscription to route events to an endpoint. Follow these steps:

  • In the topic’s Subscriptions tab, click + Subscription.
  • Choose a delivery mode like push or pull, and select an endpoint type such as a WebHook, Azure Function, or Service Bus.
  • Add filters on event types and subject patterns (e.g., begins with or ends with).
  • Enable dead-lettering, set max delivery count, and configure a managed identity for secure handling.
    These settings let you deliver events efficiently and reliably to your handlers. You can also adjust retry policies and lock durations as needed.

You can manage your subscriptions in the Azure portal or with Azure CLI and PowerShell. By viewing diagnostic logs and metrics, you can analyze delivery patterns and identify failures. Updating filters helps reduce unnecessary event traffic and improves performance. If deliveries fail, use dead-lettering or retry settings to prevent event loss. With managed identities, you can secure event delivery without embedding credentials.

Conclusion

In this section, you learned how to use Event Grid to build event-based solutions with topics and event subscriptions. You saw the different topic types, steps to create custom topics, and how to route events to endpoints with filters and delivery settings. You also learned how to monitor and optimize subscriptions using logs, metrics, and retry policies. Mastering these skills helps you build scalable and reliable event-driven applications in Azure.