Azure Event Hub
Setup instruction for Azure Event Hub
Getting Started
Azure Event Hub provides a simple, scalable solution to stream millions of events per second. It provides seamless integration with Azure services like Azure function. Below are the steps to configure Azure Event Hub.
Create Event Hubs Namespace
In the Azure Portal - search for
Event Hubs
and select it. It will take you to the Event Hubs blade.Click Create event hub button, you will be displayed the Create
Event Hub Namespace
blade
Depending on your cost structure, you may want to create two different namespaces one for preproduction (qa) and another for production. e.g.
sharethrift-qa-event-hub
sharethrift-prod-event-hub
3. Click: Review + create (wait for the validation to complete), then click "Create", you will be taken to the overview page, click the "Go to resource" button.
Create Event Hubs Instance
An Event Hub Namespace can have multiple Event Hubs. Once Event Hubs Namespace is created, perform the following steps to create an Event Hub specific to your project. Click on Event Hubs under Entities and create Event Hub
specific to your project and provide the below details.
Click "Create" to create the Event Hub specific to your project.
Consumer Groups
An Event Hub can have multiple consumer groups. This is a good practice to decouple the consumer systems. For example, a Sales Events can have two different consumers:
Inventory System
Payment System
To create Consumer Groups under a specific Event Hub,
Select the "Sales" Event Hub.
Under "Entities" section, select "Consumer groups"
By default, there would be "$Default" consumer group.
Click "+ Consumer group"
Enter the name of Consumer, "Inventory" and click Create button
Enter another Consumer, "Payment" and click Create button
Security
By default, "Event Hubs Namespace" will have primary/secondary keys along with its connection strings auto-generated under Shared access policies with Policy "RootManageSharedAccessKey" which is common to all Event Hub Instances. For added security, it is recommended to create a Shared access policy for each Event Hubs Instance manually. Below are the steps...
Select Event Hubs Instance Sales
Under Settings, select Shared access policies
Click +Add
Give Policy name: SalesSharedAccessKey
Select Manage and click Create button
It will generate New Primary/Secondary Keys along with its connection string which can be copied by selecting SalesSharedAccessKey
Use the connection string in your producer / consumer systems
Last updated