How to connect UniStream to Azure IOT Hub using MQTT
Ofir Levi
Jul-27th, 2020 6:22

First you will need to get the following details from Azure IOT Hub:

1. IOT Hub Host Name, for example: "contoso.azure-devices.net"

2. Generate ClientID on Azure IOT Hub, for example: unitronics

3. The UniStream MQTT username will be {iothubhostname}/{device_id}/?api-version=2018-06-30, where {iothubhostname} is the full CName of the IoT hub and {device_id} is the ClientID. For example, contoso.azure-devices.net/unitronics/?api-version=2018-06-30 

4. Now Azure IOT Hub must generate SAS token like :SharedAccessSignature sig={signature-string}&se={expiry}&sr={URL-encoded-resourceURI}. For example: SharedAccessSignature sr={your hub name}.azure-devices.net%2Fdevices%2FMyDevice01%2Fapi-version%3D2016-11-14&sig=vSgHBMUG.....Ntg%3d&se=1456481802



Reference links:

a. https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-mqtt-support

b. https://weblogs.asp.net/morteza/how-to-send-mqtt-messages-to-an-azure-iothub-by-mqttfx-client




Was this article helpful?
2 out of 2 found this helpful