Monitor, receive, and send events with the Event Hubs connector
To set up an event monitor so that your logic app can detect events, receive events, and send events, connect to an Azure Event Hub from your logic app. Learn more about Azure Event Hubs and how pricing works for Logic Apps connectors.
Before you can use the Event Hubs connector, you must have these items:
Connect to Azure Event Hubs
Before your logic app can access any service, you have to create a connection between your logic app and the service, if you haven't already. This connection authorizes your logic app to access data. For your logic app to access your Event Hub, check your permissions and get the connection string for your Event Hubs namespace.
Sign in to the Azure portal.
Go to your Event Hubs namespace, not a specific Event Hub. On the namespace page, under Settings, choose Shared access policies. Under Claims, check that you have Manage permissions for that namespace.
If you want to later manually enter your connection information, get the connection string for your Event Hubs namespace. Choose RootManageSharedAccessKey. Next to your primary key connection string, choose the copy button. Save the connection string for later use.
To confirm whether your connection string is associated with your Event Hubs namespace or with a specific event hub, check the connection string for the
EntityPathparameter. If you find this parameter, the connection string is for a specific Event Hub "entity", and is not the correct string to use with your logic app.
Trigger workflow when your Event Hub gets new events
A trigger is an event that starts a workflow in your logic app. To start a workflow when new events are sent to your Event Hub, follow these steps for adding the trigger that detects this event.
In the Azure portal, go to your existing logic app or create a blank logic app.
In Logic Apps Designer, enter "event hubs" in the search box as your filter. Select this trigger: When events are available in Event Hub
If you don't already have a connection to your Event Hubs namespace, you're prompted to create this connection now. Give your connection a name, and select the Event Hubs namespace that you want to use.
Or, to manually enter the connection string, choose Manually enter connection information. Learn how to find your connection string.
Now select the Event Hubs policy to use, and choose Create.
Select the Event Hub to monitor, and set up the interval and frequency for when to check the Event Hub.
To optionally select a consumer group for reading events, choose Show advanced options.
Save your logic app. On the designer toolbar, choose Save.
Now, when your logic app checks the selected Event Hub and finds a new event, the trigger runs the actions in your logic app for the found event.
Send events to your Event Hub from your logic app
An action is a task performed by your logic app workflow. After you add a trigger to your logic app, you can add an action to perform operations with data generated by that trigger. To send an event to your Event Hub from your logic app, follow these steps.
In Logic Apps Designer, under your trigger, choose New step > Add an action.
In the search box, enter "event hubs" as your filter. Select this action: Event Hubs - Send event
Select the Event Hub for where to send the event. Then, enter the event content and any other details.
Save your logic app.
You've now set up an action that sends events from your logic app.
To learn more about triggers and actions defined by the Swagger file and any limits, review the connector details.
- For questions, visit the Azure Logic Apps forum.
- To submit or vote on feature ideas, visit the Logic Apps user feedback site.
- Learn more about other connectors for Azure Logic apps