Integration with AZURE IoT HUB using the Advantco MQTT adapter
Azure IoT Hub is a fully managed service that enables reliable and secure bidirectional communications between millions of IoT devices and a solution back end. It also provides extensive monitoring for device connectivity and includes device libraries for most popular languages and platforms.
(source Azure IoT Hub)
This blog guides you thru 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.
Provide the configuration parameters of IoT hub and click Create
Status of deployment is shown below:
After successfully creation, the configuration looks as below:
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.
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:
For detail how to use this tool, refer to link
2.4 Obtain the Azure IoT Certificate
Go to the Azure IoT portal and click on the lock icon and then click details
Click in view certificate
Export certificate to file:
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.
3.2 Configuration of sender MQTT channel
3.3 Configuration of receiver MQTT channel
4. Configure the MQTT Adapter on the SAP Cloud Platform Integration
4.1 Import certificate file to system.jks
Download the system.jks file to the local system from SAP Cloud Platform Integration
Import the downloaded cert above to the keystore
Deploy system.jks to SAP Cloud Platform Integration
4.2 Configuration of sender MQTT channel
4.3 Configuration of receiver MQTT channel
5. Sample scenarios in SAP Cloud Platform Integration
5.1 RabbitMQ to Azure IoT Hub
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.
5.2 Azure IoT Hub to RabbitMQ
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
Result in RabbitMQ:
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.