var eventHubNamespace = "my-namespace"; var eventHubName = "my-event-hub"; var sharedAccessKey = "my-shared-access-key"; var connectionString = TestUtility.BuildEventHubsConnectionString(eventHubNamespace, eventHubName, sharedAccessKey);
var settings = new EventHubSettings { Namespace = "my-namespace", EventHubName = "my-event-hub", SharedAccessKey = "my-shared-access-key" }; var connectionString = TestUtility.BuildEventHubsConnectionString(settings);In this example, the method is used to build a connection string for an event hub using an EventHubSettings object. The settings object contains the same information as in the previous example. The resulting connection string is stored in the variable "connectionString". Package library: Microsoft.Azure.EventHubs.