akenza.io
Search…
How to send data to the Azure IoT Hub
In this tutorial you will learn how to send data to the Azure IoT Hub
Benefits of the Azure IoT Hub output connector:
    Directly stream device data from akenza to Azure and subsequently process it in Azure services
    Easily process low-power device data e.g. LoRaWAN device data in a Microsoft service
In this tutorial, you will learn, how to send data to Azure IoT Hub. The following steps are explained in more detail:
    1.
    Setup an Azure IoT Hub
    2.
    Obtain an Azure IoT Hub connection string
    3.
    Setup a Data Flow in akenza
    4.
    Monitor events
    5.
    Use of further Azure services
    6.
    Useful Links

1. Setup an Azure IoT Hub

First, you will need to set up an Azure IoT Hub in order to successfully process data from akenza in Azure services.

Create an IoT Hub resource

    Sign in to the Azure portal
    Create a new Azure IoT Hub resource, by clicking the + Create a resource button, 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)
    Click review and create to provision the IoT hub resource

Add a shared access policy

    Navigate to your IoT Hub resource and click Shared access policies in the Settings section.
    Click + Add shared access policy, give it a name and check all boxes for the permissions (registry read, registry write, service connect, and device connect permissions).
Adding a shared access policy

2. Obtain an Azure IoT Hub connection string

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

3. Setup a Data Flow in akenza

In akenza, 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.
Data Flow with Azure IoT Hub as Output Connector
Create a new device using the Data Flow and start sending data.
    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

4. Monitor Events

In order to monitor uplinks that are sent to Azure IoT Hub, you can use Azure CLI with the Azure IoT CLI Extension. Use the following commands to install the extension and monitor incoming uplinks:
1
az extension add --name azure-iot
2
az iot hub monitor-events -n <azure-iot-hub-name> --login <azure-iot-hub-connection-string>
Copied!
All devices which have sent data can be inspected in the IoT Device Explorer on IoT Hub.
IoT Device Explorer on IoT Hub

5. Use of further Azure services

Once a device is connected to the IoT Hub, device data can be further used on various Azure services:
Possible services are:
    Real-time data stream processing
    Powerful cloud-based predictive analytics tool to enable predictive maintenance
    A scalable, push notification engine for quickly sending messages
    Power BI
    A suite of business analytics
Azure IoT reference architecture - Azure Reference Architectures
docsmsft
Azure IoT Hub Documentation
docsmsft
Tutorial - Configure message routing for Azure IoT Hub using Azure CLI
docsmsft
Use Azure IoT Tools for VSCode to manager IT Hub messaging
docsmsft
Real-time data visualization of data from Azure IoT Hub – Power BI
docsmsft
Last modified 24d ago