title | description | author | ms.author | ms.topic | ms.custom | ms.date |
---|---|---|---|---|---|---|
Add Azure IoT Hub as source in Real-Time hub |
This article describes how to add an Azure IoT hub as an event source in Fabric Real-Time hub. |
ahartoon |
anboisve |
how-to |
11/18/2024 |
This article describes how to get events from an Azure IoT hub into Real-Time hub.
- Access to a workspace in the Fabric capacity license mode (or) the Trial license mode with Contributor or higher permissions.
- Create an Azure IoT hub if you don't have one.
- 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.
You can get events from an Azure IoT hub into Real-Time hub in one of the ways:
[!INCLUDE launch-get-events-experience]
-
On the Data sources page, select Microsoft sources category at the top, and then select Connect on the Azure IoT Hub tile.
:::image type="content" source="./media/add-source-azure-iot-hub/select-azure-iot-hub.png" alt-text="Screenshot that shows the selection of Azure IoT Hub as the source type in the Data sources page." lightbox="./media/add-source-azure-iot-hub/select-azure-iot-hub.png":::
Now, follow instructions from the Connect to an Azure iot hub section.
-
In Real-Time hub, select Microsoft sources. You can use the search box to the type your resource name or use filters (Source, Subscription, Resource group, Region) to search for your resource.
-
In the Source drop-down list, select Azure IoT Hub.
-
For Subscription, select an Azure subscription that has the resource group with your IoT hub.
-
For Resource group, select a resource group that has your IoT hub.
-
For Region, select a location where your IoT hub is located.
-
Now, move the mouse over the name of the IoT hub that you want to connect to Real-Time hub in the list of IoT hubs, and select the Connect button, or select ... (ellipsis), and then select Connect data source.
:::image type="content" source="./media/add-source-azure-iot-hub/microsoft-sources-connect-button.png" alt-text="Screenshot that shows the Microsoft sources page with filters to show IoT hubs and the connect button for an IoT hub.":::
-
On the Connect page, select New connection.
:::image type="content" source="./media/add-source-azure-iot-hub/new-connection-button.png" alt-text="Screenshot that shows the Connect page the New connection link highlighted." lightbox="./media/add-source-azure-iot-hub/new-connection-button.png":::
If there's an existing connection to your Azure iot hub, you select that existing connection as shown in the following image, and then move on to the step to configure the data format.
:::image type="content" source="./media/add-source-azure-iot-hub/existing-connection.png" alt-text="Screenshot that shows the Connect page with an existing connection to an Azure IoT hub." lightbox="./media/add-source-azure-iot-hub/existing-connection.png":::
-
In the Connection settings section, for IoT Hub, specify the name of your Azure IoT hub.
:::image type="content" source="./media/add-source-azure-iot-hub/iot-hub-name.png" alt-text="Screenshot that shows the connection settings for the IoT hub with the name of the 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.
:::image type="content" source="./media/add-source-azure-iot-hub/connection-page-1.png" alt-text="Screenshot that shows the Connect page one for Azure IoT Hub connector." lightbox="./media/add-source-azure-iot-hub/connection-page-1.png":::
-
-
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 to the right, select the Fabric workspace where you want to save the eventstream that the Wizard is going to create.
-
For eventstream name, enter a name for the eventstream. The wizard creates an eventstream with the selected Azure IoT hub as a source.
-
The Stream name is automatically generated for you by appending -stream to the name of the eventstream. You can see this stream on the Real-time hub All data streams page and on the My data streams page when the wizard finishes.
-
Select Next at the bottom of the page.
:::image type="content" source="./media/add-source-azure-iot-hub/connection-page-2.png" alt-text="Screenshot that shows the Connect page two for Azure IoT Hub connector." lightbox="./media/add-source-azure-iot-hub/connection-page-2.png":::
-
On the Review + connect page, review settings, and select Connect.
:::image type="content" source="./media/add-source-azure-iot-hub/review-create-page.png" alt-text="Screenshot that shows the Review + connect page for Azure IoT Hub connector." lightbox="./media/add-source-azure-iot-hub/review-create-page.png":::
-
On the Review + connect page, if you select Open eventstream, the wizard opens the eventstream with the selected Azure IoT hub as a source. To close the wizard, select Finish at the bottom of the page.
:::image type="content" source="./media/add-source-azure-iot-hub/review-create-success.png" alt-text="Screenshot that shows the Review + connect page with links to open eventstream and close the wizard." lightbox="./media/add-source-azure-iot-hub/review-create-success.png":::
-
You should see the stream on the All data streams and My data streams pages. For detailed steps, see View details of data streams in Fabric Real-Time hub.
:::image type="content" source="./media/add-source-azure-iot-hub/verify-data-stream.png" alt-text="Screenshot that shows the Real-Time hub All data streams page with the stream you just created." lightbox="./media/add-source-azure-iot-hub/verify-data-stream.png":::
To learn about consuming data streams, see the following articles: