0
0
Azurecloud~30 mins

Event Grid vs Service Bus decision in Azure - Hands-On Comparison

Choose your learning style9 modes available
Event Grid vs Service Bus Decision
📖 Scenario: You are working for a company that needs to build a cloud system to handle notifications and messages between different parts of their application. They want to choose the right Azure service to send and receive these messages efficiently.Two popular options are Azure Event Grid and Azure Service Bus. Your task is to create a simple setup to understand when to use each service.
🎯 Goal: Build a basic configuration that shows how to set up Azure Event Grid and Azure Service Bus for sending and receiving messages. This will help you decide which service fits different scenarios.
📋 What You'll Learn
Create a dictionary with example events for Event Grid
Add a configuration variable to set the message queue name for Service Bus
Write a loop to process Event Grid events
Add the final connection string for Service Bus to complete the setup
💡 Why This Matters
🌍 Real World
This project simulates setting up messaging services in Azure to handle events and messages between different parts of a cloud application.
💼 Career
Understanding when to use Event Grid or Service Bus is important for cloud architects and developers designing scalable and reliable cloud systems.
Progress0 / 4 steps
1
Create Event Grid events dictionary
Create a dictionary called event_grid_events with these exact entries: 'orderCreated': 'Order #123 created', 'orderShipped': 'Order #123 shipped', and 'orderDelivered': 'Order #123 delivered'.
Azure
Need a hint?

Think of event_grid_events as a list of event names and their messages.

2
Add Service Bus queue configuration
Add a variable called service_bus_queue_name and set it to the string 'orders-queue'.
Azure
Need a hint?

This variable holds the name of the Service Bus queue where messages will be sent.

3
Process Event Grid events
Write a for loop using variables event_name and event_message to iterate over event_grid_events.items(). Inside the loop, add a comment # Process event here.
Azure
Need a hint?

This loop goes through each event and its message to handle them one by one.

4
Add Service Bus connection string
Add a variable called service_bus_connection_string and set it to the string 'Endpoint=sb://example.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=abc123'.
Azure
Need a hint?

This connection string is needed to connect to the Azure Service Bus namespace securely.