Add Azure IoT Hub source to an eventstream
This article shows you how to add an Azure IoT Hub source to an eventstream.
Note
Enhanced capabilities are enabled by default when you create eventstreams now. If you have eventstreams that were created using standard capabilities, those eventstreams will continue to work. You can still edit and use them as usual. We recommend that you create a new eventstream to replace standard eventstreams so that you can take advantage of additional capabilities and benefits of enhanced eventstreams.
Prerequisites
Before you start, you must complete the following prerequisites:
- Access to a workspace in the Fabric capacity license mode (or) the Trial license mode with Contributor or higher permissions.
- You need to have appropriate permission to get IoT hub's access keys. The IoT hub must be publicly accessible and not behind a firewall or secured in a virtual network.
- If you don't have an eventstream, create an eventstream.
Launch the Select a data source wizard
If you haven't added any source to your eventstream yet, select Use external source tile.
If you're adding the source to an already published eventstream, switch to Edit mode, select Add source on the ribbon, and then select External sources.
On the Select a data source page, search for and select Connect on the Azure IoT Hub tile.
Configure Azure IoT Hub connector
On the Connect page, select New connection.
If there's an existing connection to your Azure IoT hub, select that existing connection as shown in the following image, and then move on to the step to configure Data format in the following steps.
In the Connection settings section, for IoT Hub, specify the name of your Azure IoT hub.
In the Connection credentials section, do these steps:
If there's an existing connection, select it from the drop-down list. If not, confirm that Create new connection is selected for this option.
For Connection name, enter a name for the connection to the IoT hub.
For Authentication method, confirm that Shared Access Key is selected.
For Shared Access Key Name, enter the name of the shared access key.
For Shared Access Key, enter the value of the shared access key.
Select Connect at the bottom of the page.
To get the access key name and value, follow these steps:
Now, on the Connect page of wizard, for Consumer group, enter the name of the consumer group. By default,
$Default
is selected, which is the default consumer group for the IoT hub.For Data format, select a data format of the incoming real-time events that you want to get from your Azure IoT hub. You can select from JSON, Avro, and CSV data formats, and then select Connect.
In the Stream details section on the right, select Pencil icon under Source name, and enter a name for the source. This step is optional.
Select Next at the bottom of the page.
On the Review and create page, review settings, and select Add.
Note
The maximum number of sources and destinations for one eventstream is 11.
View updated eventstream
You see that the Azure IoT Hub source is added to your eventstream on the canvas in the Edit mode. To implement this newly added Azure IoT hub, select Publish on the ribbon.
After you complete these steps, the Azure IoT hub is available for visualization in the Live view. Select the IoT hub tile in the diagram to see the page similar to the following one.
Related content
For a list of supported sources, see Add an event source in an eventstream
Prerequisites
Before you start, you must complete the following prerequisites:
- Access to a workspace in the Fabric capacity license mode (or) the Trial license mode with Contributor or higher permissions.
- You need to have appropriate permission to get IoT hub's access keys. The IoT hub must be publicly accessible and not behind a firewall or secured in a virtual network.
Note
The maximum number of sources and destinations for one eventstream is 11.
Add an Azure IoT hub as a source
Follow these steps to add an Azure IoT hub as your eventstream source:
In the Eventstream editor, expand the New source drop-down menu within the node and choose Azure IoT Hub.
On the Azure IoT Hub configuration pane, enter the following details:
Source name: Enter a name for your Azure IoT Hub, such as iothub-source.
Cloud connection: Select an existing cloud connection that links your Azure IoT Hub to Microsoft Fabric. If you don't have one, proceed to step 3 to create a new cloud connection.
Data format. Choose a data format (AVRO, JSON, or CSV) for streaming your IoT Hub data into the eventstream.
Consumer group. Choose a consumer group from your Azure IoT Hub, or leave it as $Default. Then select Add to finish the Azure IoT Hub configuration.
Once it's added successfully, you can see an Azure IoT Hub source added to your eventstream in the editor.
To create a new cloud connection for your Azure IoT Hub, follow these steps:
Select Create new connection from the drop-down menu, fill in the Connection settings and Connection credentials of your Azure IoT Hub, and then select Create.
IoT Hub. Enter the name of the IoT Hub in the Azure portal.
Connection name. Enter a name for the new cloud connection, such as iothub-connection.
Shared access key name and Shared access key. Enter the connection credentials for your Azure IoT Hub. You can find it under Shared access policies in the Azure portal. You must have appropriate permissions to access any of the IoT Hub endpoints.
Return to the Azure IoT Hub configuration pane and select Refresh to load the new cloud connection.
Once the Azure IoT Hub is added to your eventstream, select Preview data to verify successful configuration. You should be able to preview incoming data to your eventstream.
Related content
To learn how to add other sources to an eventstream, see the following articles: