How to send data to Azure IoT Hub
In this tutorial you will learn how to send data to Azure IoT Hub
Benefits of the Azure IoT Hub output connector:
In this tutorial, you will learn, how to send data to Azure IoT Hub. The following steps are explained in more detail:
- Create a new Azure IoT Hub resource, by selecting + Create a resource, and then entering IoT Hub
- Assign a resource group by choosing an existing group or creating a new one and fill the IoT hub name and region fields; choose Public access in the networking tab to select a tier that fits your use case in the Management tab (use the free tier for testing)
- Select review and create to provision the IoT hub resource
- Navigate to your IoT Hub resource and select Shared access policies in the Settings section
- Select + Add shared access policy, give a name and check all boxes for the permissions (registry read, registry write, service connect, and device connect permissions)
Adding a shared access policy
Once the policy is created, obtain the Primary Connection String, by clicking the policy and copying the connection string. The connection string will be used to create the connector in akenza.
Obtaining the connection string
Create a new Data Flow with Azure IoT Hub as output connector. Define a Connector Name and insert the Connection String obtained from the shared access policy.
Azure IoT Hub template
- The whole data sample will be forwarded to Azure IoT Hub
- If a device sends data and does not yet exist in the registry of IoT Hub, it will be automatically created
az extension add --name azure-iot
az iot hub monitor-events -n <azure-iot-hub-name> --login <azure-iot-hub-connection-string>
All devices which have sent data can be inspected in the IoT Device Explorer on IoT Hub.
IoT Device Explorer on IoT Hub
Once a device is connected to the IoT Hub, device data can be further used on various Azure services: