Introduction
In this article, I will explain about sending the events to Event Hubs in Azure using .NET framework. The Event Hubs has the capacity of processing and storing the data in data streaming platform and can process millions of processes per second with low latency. It also acts as a ramp for big data.
Prerequisites
- An active Azure subscription
- Visual Studio 2017
Sending the events to Event Hubs
Before proceeding to send the events to the Event Hubs in Azure, we need to create a Event Hub so that we can send the events to it.
Step 1
Log into Azure portal.
Step 2
Click New -> Internet of Things -> Event Hubs.
Step 3
Now, we need to configure some basic settings, provide a name for the namespace, create a resource group with the location of the datacenter, and click "Create".
Step 4
From the namespace blade that we created, click Overview -> Event Hub.
Step 5
Provide a name for the Event Hub and click "Create".
Step 6
Select the created new event hub name from the list of the Event Hubs.
Step 7
Click "Shared access policies" and select "RootManagerSharedAccessKey".
Step 8
Now, we need to backup a copy of the primary key and click Copy button in RootManageSharedAccessKey to clipboard.
Step 9
Now, the event hub is created. For sending the events to the Azure, open Visual Studio 2017.
Step 10
Click New -> Windows Classic Desktop -> Console App (.NET Framework) and click OK.
Step 11
The event hub process needs to be added with NuGet packages and right click Project.
Step 12
Click -> Manage NuGet Packages -> and in the Browse tab, search for MicrosoftAzureServiceBus. Click "Install".



viv vermaPosted Feb 25, 2019, 1:21 AM
Faces these issues on send messages in to event hub. { The remote server returned an error: (403) Forbidden. TrackingId:165a16f6-0fe5-46b6-8df5-900fe2c25810, SystemTracker:pcloggingeventhub.servicebus.windows.net:EventHubLogQueue, Timestamp:2/25/2019 6:12:21 AM }
Shyam VPosted May 14, 2018, 2:30 AM
Hi Vidyadharran, I followed the exact steps as you have mentioned and I get the following error. "An error occurred during communication with 'N/A'. Check the connection information, then retry." What am I doing wrong? Or does it require any port opening or connections?Any ports need to be opened or taken care of?
Shekhar MishraPosted Nov 23, 2017, 12:58 AM
How we will check the events in Azure?