Perform the following steps:
- Create a new console application that will send events to the Event Hub. I have named it EventHubApp.
- Run the following commands in the NuGet package manager to install the required libraries and interact with Azure Event Hubs:
Install-Package Microsoft.Azure.EventHubs Install-Package Newtonsoft.Json
- Add the following namespaces and a reference to System.Configuration.dll:
using Microsoft.Azure.EventHubs; using System.Configuration;
- Add the connection string to App.config, which is used to connect the event hub. The following is the code for App.config. You can get the connection string by clicking on the ConnectionStrings link in the Overview ...