Integration with AZURE IoT HUB using the Advantco MQTT adapter

  •  

    1. Introduction.

    The Azure Internet of Things (IoT) is a collection of Microsoft-managed cloud services that connect, monitor, and control billions of IoT assets. In simpler terms, an IoT solution is made up of one or more IoT devices that communicate with one or more back-end services hosted in the cloud.
    (source Azure IoT Hub)
    This blog guides you through the configuration steps to connect your SAP PI/PO or SAP Cloud Platform Integration to Azure IoT Hub using the Advantco MQTT adapter.

    2. Configure on Azure IoT Hub

    2.1 Create an IoT hub
    Sign in to the Azure portal
    Click New -> Internet of Things -> Azure IoT Hub.
    Integration with AZURE IoT HUB using the Advantco MQTT adapter
    Provide the configuration parameters of IoT hub and click Create
    Integration with AZURE IoT HUB using the Advantco MQTT adapter
    Status of deployment is shown below:
    Integration with AZURE IoT HUB using the Advantco MQTT adapter
    After successfully creation, the configuration looks as below:
    Integration with AZURE IoT HUB using the Advantco MQTT adapter

    2.2 Obtain IoT Hub Connection String
    On the IoT Hub setting page, select Shared access polices -> iothubowner policy -> make a note of the connection string.
    Integration with AZURE IoT HUB using the Advantco MQTT adapter

    2.3 Create a Device Identity
    We use Device Explorer tool to create device, to download this tool, open the link: https://github.com/Azure/azure-iot-sdks/releases and select the download link as below image:
    Integration with AZURE IoT HUB using the Advantco MQTT adapter
    For more details on how to use this tool, refer to the link
    https://docs.microsoft.com/en-us/cli/azure/iot/hub/device-identity?view=azure-cli-latest 

    2.4 Obtain the Azure IoT Certificate
    Go to the Azure IoT portal and click on the lock icon and then click details
    Integration with AZURE IoT HUB using the Advantco MQTT adapter
    Click in view certificate
    Integration with AZURE IoT HUB using the Advantco MQTT adapter
    Export certificate to file:
    Integration with AZURE IoT HUB using the Advantco MQTT adapter

    3. Configure MQTT Adapter on SAP PI/PO

    3.1. Create Keystore View
    Create new Key store view (Example: AZURE-I0T) and import the downloaded cert above file to this view.
    Integration with AZURE IoT HUB using the Advantco MQTT adapter

    3.2 Configuration of sender MQTT channel
    Integration with AZURE IoT HUB using the Advantco MQTT adapter

    3.3 Configuration of receiver MQTT channel
    Integration with AZURE IoT HUB using the Advantco MQTT adapter

    4. Configure the MQTT Adapter on the SAP Cloud Platform Integration

    4.1 Import certificate file to Keystore
    Go to Manage Keystore > Add > Certificate

    Integration with AZURE IoT HUB using the Advantco MQTT adapter_Pic11

    4.2 Configuration of sender MQTT channel
    Integration with AZURE IoT HUB using the Advantco MQTT adapter

    4.3 Configuration of receiver MQTT channel
    Integration with AZURE IoT HUB using the Advantco MQTT adapter

    5. Sample scenarios in SAP Cloud Platform Integration

    5.1 RabbitMQ to Azure IoT Hub

    Integration with AZURE IoT HUB using the Advantco MQTT adapter

    We use Device Explorer tool to monitor the messages on the device
    Open Device Explorer tool -> select Data tab -> select Device Id -> click Monitor Button

    Publish an message to hci_azure_iot_hub_snd queue on RabbitMQ -> we will see the content message on the Device explorer tool as below image.

    Integration with AZURE IoT HUB using the Advantco MQTT adapter

    5.2 Azure IoT Hub to RabbitMQ
    Integration with AZURE IoT HUB using the Advantco MQTT adapter

    We use device explorer tool to send an message to the Azure IoT Hub
    Open Device Explorer tool -> select Mesasge to Device tab -> select Device Id -> input the message content -> click Send button

    Integration with AZURE IoT HUB using the Advantco MQTT adapter

    Result in RabbitMQ:
    Integration with AZURE IoT HUB using the Advantco MQTT adapter

     

    6. Conclusion

    The Advantco MQTT adapter is available for both SAP PI/PO and SAP Cloud Platform Integration. It is an ideal solution when connecting to Azure IoT Hub.
    Key benefits:
    Minimal effort to install, configure and usage of the MQTT adapter.
    Maintain and supported by team with profound knowledge of SAP PI/PO and CPI adapters developments.


    Please reach out to our sales team at sales@advantco.com if you have any questions.