To communicate with an event hub in a namespace, you need a connection string for the event hub.
The connection string for an event hub looks like:
Endpoint=sb://<NamespaceName>.servicebus.windows.net/;SharedAccessKeyName=<KeyName>;SharedAccessKey=<KeyValue>;EntityPath=<EventHubName>
Where:
<NamespaceName>
is the name of the Event Hubs namespace you created, followed by servicebus.windows.net, to create a fully qualified domain name.<KeyName>
is the name of the shared access key.<KeyValue>
is the value of the shared access key.<EventHubName>
is the name of the event hub you created.
To retrieve the connection string for an event hub:
- In Azure Portal, click All services in the side navigation pane.
- Scroll down to Analytics and click Event Hubs.
- Click the event hub you created earlier.
- Click Shared access policies in the side menu pane.
- Click +Add.
- Enter a descriptive name for the policy.
- Tick Listen.
- Click Create.
- Wait for Azure Portal to create the policy.
- Click the new shared access policy.
- Click in Connection string–primary key.
- Paste the connection string to a text editor and save it as a .txt file.
- Send the connection string file to SOC.