Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
In this tutorial, you learn how to stream real-time events from Logic Apps or Power Automate to Real-Time Intelligence using a custom endpoint source in Microsoft Fabric Eventstream. While the flows for Logic Apps and Power Automate are configured differently, they serve the same purpose: to periodically send the simulated flight data containing columns such as ScanUtcTime
and FlightInfo
. The difference in flow is because Logic Apps supports executing JavaScript, but Power Automate doesn't.
The flow in Logic App (with stateful workflow) and Power Automate are:
Although the flows in Logic Apps and Power Automate are different, they achieve the same result—sending flight data to Real-Time Intelligence. Choose the approach that best suits your requirements.
In this tutorial, you learn how to:
- Create an eventstream and add a custom endpoint source.
- Getting the Event Hubs endpoint details.
- Connecting Logic Apps to the eventstream via the custom endpoint.
- Connecting Power Automate to the eventstream via the custom endpoint.
- Preview data in eventstream.
Prerequisites
Before you start, you must complete the following prerequisites:
- Access to a workspace with Contributor or higher permissions where your eventstream is located.
- For Logic Apps, an Azure account with a valid subscription to create logic apps. If you don't have one, sign up for a free Azure account.
- For Power Automate, an active Power Automate account.
Create an eventstream
Navigate to the Fabric portal.
Select My workspace on the left navigation bar.
On the My workspace page, select + New item on the command bar.
On the New item page, search for Eventstream, and then select Eventstream.
In the New Eventstream window, enter a name for the eventstream, and then select Create.
Creation of the new eventstream in your workspace can take a few seconds. After the eventstream is created, you're directed to the main editor where you can start with adding sources to the eventstream.
Add a Custom endpoint source
To add a custom endpoint source, on the get-started page, select Use custom endpoint.
In the Custom endpoint dialog, enter a name for the custom source under Source name, and then select Add.
After you create the custom endpoint source, it's added to your eventstream on the canvas in edit mode. To implement the newly added data from the custom app source, select Publish.
Stream events from Logic Apps to your eventstream using the custom endpoint
In this section, you'll learn how to design a workflow that periodically generates simulated flight data on a recurring schedule. The workflow will use JavaScript code in the 'Execute JavaScript' action to construct a flight information message with randomized values for each field. Once the message is constructed, it will be sent to the eventstream's endpoint using the Event Hub protocol.
Create a Logic App using the Standard plan instead of the Consumption plan to simplify configuration, as the 'Execute JavaScript' action in the Consumption plan requires an additional integration account.
Create a workflow. When creating the workflow, select the Stateful state type as the 'Recurrence' trigger (needed for this tutorial) is not available in the stateless trigger list.
Open the newly created workflow, select Add a trigger, and then select Recurrence.
Configure Recurrence for periodical running. This will peroridically trigger this whole flow based on the interval you set.
Select the + Add an action and then select the Excute JavaScript.
Copy this script content into code field.
Select the + Add an action to add the Event Hubs action step, and then select Send event.
Create new connection, enter the Connection name.
Enter the Connection string which can copy from Eventstream Custom endpoint, and select Create new to get the connection created.
After the new connection created and returned to event hub Parameters configuration, select Enter custom value from the dropdown menu of the Event Hub Name and enter the event hub name which can copy from Eventstream Custom endpoint.
Select Content for the Advanced parameters and configure the Content as the Output .
Select Save to save the workflow.
On the designer toolbar, from the Run menu, select Run.
After you complete these steps, you can preview the data in your eventstream that is from your Logic App workflow.
Stream events from Power Automate to your eventstream using the custom endpoint
In this section, you'll learn how to create a flow in Power Automate to generate simulated flight data and send it to your eventstream. Since Power Automate doesn't support the 'Execute JavaScript Code' action, a few variables need to be defined to produce the simulated data. To simplify this process, a preconfigured flow with the necessary variables is provided for downloading and importing. Follow the steps below to create your flow using the preconfigured package and complete the remaining configuration to send the simulated data to your eventstream.
Download this zip file from this git repo which contains preconfigured flows for scheduling the sending of mock flight data.
Login in Power Automate with your Power BI account.
Navigate to My Flows in the left navigating pane.
Select the Import Package (Legacy) after clicking the Import button.
Select the zip file you downloaded from step 1, and upload it.
Select update to change the Import setup as Create as new, and then select Save.
And then select Import to import this package to your own flow.
Navigate back to My Flows, and you can see the newly added Power Automate flow.
Open your Power Automate flow, select Edit and add the Event Hubs action step, and then select Send event. Refer to the steps in stream events from Logic Apps to configure the event hub and set Recurrence for long-running.
Navigate back to My Flows, and select the flow to Turn on it
After you complete these steps, you can preview the data in your eventstream that is from your Power Automate workflow.
Related content
In this tutorial, you learned how to stream real-time events from Power Automate or Logic Apps to your eventstream using the custom endpoint.
If you want to discover more advanced functionalities for working with Fabric event streams, you might find the following resources helpful: