Azure Event Hubs
Read time: 3 minutes
Last edited: Oct 16, 2024
Overview
This topic explains how to configure and use the Azure Event Hubs Data Export destination. By connecting your LaunchDarkly project to Azure Event Hubs, you can export LaunchDarkly SDK events from flags and environments to an Event Hub of your choosing.
Prerequisites
In order to use the Azure Event Hubs Data Export destination, you must meet the following prerequisites:
- You must create a Shared Access Signature Policy in your Azure Event Hubs account at the Event Hub or the Namespace level
- You must copy the key from this policy. To do this, read Create a policy and key in Azure Event Hub.
Create a policy and key in Azure Event Hub
Before you enable the Event Hubs destination in LaunchDarkly, you must configure a policy in Azure Event Hubs that lets an Event Hub or Namespace receive events.
Depending on your use case, you can configure a shared access signature policy for an Event Hubs Namespace or for any of its enclosed Event Hubs.
Here's how to configure a new policy:
- Log into Azure and click Event Hub.
- Choose the Namespace where you want LaunchDarkly to export events.
- Choose an Event Hub to which you wish to export events.
- Click into Shared Access Policies and click Add. The policy creation panel appears.
- Create a new policy with the Send permission enabled:
- Click Create. The new policy appears in the list.
- Click to open the policy and copy its primary key:
Save the key somewhere accessible to you, because you need it to set up the destination successfully.
Create the Event Hubs destination in LaunchDarkly
After you copy and save the policy key in Event Hub, you can configure the Data Export destination in LaunchDarkly.
To connect the destination to LaunchDarkly:
- In LaunchDarkly, navigate to the Integrations page.
- Find "Azure Event Hubs" and click Add integration. The "Create a destination" panel appears.
- Give your destination a human-readable Name.
- Choose a LaunchDarkly Environment from which you wish to export events to Azure Event Hub.
- Enter the Event Hubs Namespace Name.
- Enter the Event Hub Name.
- Enter the Shared Access Signature Policy Name.
- Enter the Share Access Signature Key.
- Click Save destination.
This connects your Azure Event Hub to your LaunchDarkly environment. To send events from specific flags or environments to Event Hub, you must enable Data Export for each flag or environment individually.
Test an Azure Event Hubs destination
After you save the destination, send a test event to confirm that the destination is configured properly.
To send a test event:
- Navigate to the Integrations page and find "Azure Event Hubs."
- Click into the "Azure Event Hubs" section to display a list of destinations.
- Click the pencil icon next to the destination you want to test. The "Edit destination" panel appears.
- In the "Send a test event" section, click Send event.
- If you have configured the destination correctly, an event appears in the Azure Event Hubs destination.
Enable Data Export for flags and environments
After you create a Data Export destination, you must start sending flag or environment event data to it. You can enable Data Export for individual flags, or for all the flags in an environment.
To learn more, read Export event data for flags and environments.
Delete an Event Hubs destination
You can delete a Data Export destination from the Integrations screen.
To delete a destination:
- Navigate to the Integrations page and find "Azure Event Hubs."
- Click into the "Azure Event Hubs" section to display a list of destinations.
- Click the pencil icon next to the destination you wish to delete. The "Edit destination" panel appears.
- Click Delete destination.