Azure Event Hub with examples – Step by Step

Azure Event Hub with examples

Today in this article we shall see how to create an Azure Event Hub with examples using simple and easy-to-understand steps.

We shall also see how to create and connect this Event Hub and publish some business events to this created Event programmatically and using CLI too.

Today in this article, we will cover below aspects,

To understand how to publish the data to Event Hub using C# .NET example, please visit the below article,

What is Event Hub and why to use it?

Azure Event Hubs is a streaming platform and event ingestion service in the Azure Cloud environment.

Event Hub provides a platform for seamless integration of data and various services within and outside of the Azure Cloud environment.

The Azure Event Hub Producer writes data to Microsoft Azure Event Hub. It also lets you select different destinations as needed.

Example

If using Data Lake Storage, use the Azure Data Lake Storage as a destination.

To write to Microsoft Azure IoT Hub, use the Azure IoT Hub as a Producer destination.

Prerequisites

Before you start, all you need is an account on the Azure portal with an Azure subscription.

Create a resource group

Sign in to the Azure portal.

In the left navigation, click Resource groups. Then click Create.

Event hub using Azure

  • Please Select a region for the resource group.
  • Click on Review + Create.

Create Azure Event Hub namespace

Event hub using Azure

Click on All services in the left menu, and select Event Hubs

Click on Add and create a New Event Hub, on Create Namespace windows please follow the below steps to configure,

blank
  • @1 Select the subscription
  • @2 Select the resource group
  • @3 Enter a name for the namespace.
  • @4 Select a location for the namespace.
  • @5 Choose the pricing tier (Basic or Standard).
  • Finally, Click Review + Create at the bottom of the page.

You shall see the below screen for the deployment in progress!

blank

Event hub using Azure

Finally your namespace will available to view once you click on the “Go to resource

Create an Azure event hub

Now since we already have a namespace, we can create an Event Hub.

On the Event Hubs Namespace page where we created namespace click on + Event Hubs

blank

Once you click on the EventHub – It takes you to Create an event hub page.

Please provide the name of the event.

blank

That’s All, you are all set to use your producer which will help you send the messages to this EventHub.

Let’s send the first message to the EventHub.

Here we shall first retrieve the connection string.

How to get a Connection string for the EventHub

blank

Finally, you shall be able to monitor the messages that are pushed successfully to Hub as below,

blank

To understand how to publish the data to Event Hub using .NET, please visit the below article,

Do you have any comments or ideas or any better suggestions to share?

Please sound off your comments below.

Happy Coding !!



Please bookmark this page and share it with your friends. Please Subscribe to the blog to receive notifications on freshly published(2024) best practices and guidelines for software design and development.



Leave a Reply

Your email address will not be published. Required fields are marked *