Because MQTT is a messaging protocol, not a data communications protocol, it does not specify a particular format for making a connection or the data payload. Thus, each MQTT implementation can be different with its own, unique connection characteristics.
Our Standard MQTT option provides a generic way to configure a connection to any MQTT broker. In addition, we offer the following pre-configured options to facilitate connecting to Azure, Google, or AWS MQTT brokers.
To make a connection to Azure IoT Hub you will need to follow some extra steps. A password must be generated by a separate tool as described below.
Once you have a password, click the Azure IoT Hub radio button and enter the following information:

The IoT Hub Name provided by Azure.
A name for the device that you want to connect.
By default Azure IoT Hub treats an MQTT payload as binary data. Selecting this option (the default) will inform IoT Hub that the payload is JSON text, typical of a DataHub MQTT client connection. This may affect how other downstream Azure services process the MQTT messages.
Optionally, you can enter the MQTT message format to receive data and event updates from the IoT Hub.
After making your entries, press the button to add that configuration to the list, and clear the fields for another entry. You will see the necessary information entered in the Connection, Authentication, and Message Content tabs. You can optionally configure a Last Will Message, if desired.
When you are finished, you can configure your Exchange Data options.
![]() | |
Azure IoT Hub does not allow a client application to subscribe to a topic. That is the way Azure is designed. It was never intended to be a general-purpose MQTT broker. The only way to get data from Azure via MQTT is through a mechanism called “Cloud-to-device events”. There is a setting in the DataHub configuration for that. You need to generate the events from the Azure portal. The Azure documentation can provide more information: https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-devguide-messaging. |
DataHub software supports CA certificates for SSL, in either PEM or PFX format. To use a CA certificate you need to do the following in your Azure IoT Hub configuration :
Go to Certificates and add your CA certificate.
Create your device and set the Authentication type to authenticate by Certificate.
Then, in the DataHub MQTT Client Azure IoT Hub Authentication tab:
Check the box.
Add your CA signed client certificate in the Client Certificate field.
The Azure IoT password is an SAS token. To generate the SAS token:
Open your IoT Hub in the Azure portal.
On the left menu under find the , and click on the policy you want to use.
On the right you will see the Shared Access Keys.
Find and make a copy of the Connection-String Primary. You will need this in the Azure IoT Explorer.
Download the current release of the Azure IoT Explorer from:
Install it and run the application.
Paste in the copy you made of the IoT Hub Connection String Primary, and click .
This will list your IoT Devices.
Click your device.
Find the Connection string with SAS Token section.
Set Symmetric Key to Primary Key.
Set the keys expiration time in minutes.
Click . The result will look like this:
HostName=SWTBOPCUAHub.azure-devices.net;DeviceId=TestDevice2; SharedAccessSignature=SharedAccessSignature sr=SWTBOPCUAHub.az ure-devices.net%2Fdevices%2FTestDevice2&sig=FLwubhFB4V%2F7j6pZ S3KXEomL4%2F2uCaBSipyKiIZCWuw%3D&se=1592419771
(But all one string, no carriage returns.)
Azure only requires the part of this string starting from
"SharedAccessSignature=". You can copy the
entire string, or only the portion starting from
"SharedAccessSignature=" to the end of the
string. If you plan to share this configuration with older versions
of the DataHub program then you should copy only that portion. The
result should be a single string, similar to this:
SharedAccessSignature sr=SWTBOPCUAHub.azure-devices.net%2Fdevi ces%2FTestDevice2&sig=FLwubhFB4V%2F7j6pZS3KXEomL4%2F2uBaCSipyK iIZCWuw%3D&se=1592419771
(All one string, no carriage returns.)
This is the SAS token, which you can paste verbatim into the DataHub configuration Password field.