The following steps describe how to prepare your Niagara station to connect it to your created Azure IoT
Hub using SAS tokens.
- To create a new AbstractMqttDriverNetwork, expand , and double-click Drivers to
open the Driver Manager view.
- In the Driver Manager view, click New, select AbstractMqttDriverNetwork from the drop-down menu, and click OK.
- In the open abstractMqttDriver palette,
expand the Devices folder.
- Drag the AzureSasTokenMqttDevice component to your AbstractMqttDriverNetwork in the Nav tree, name it and click OK.
- Expand AzureSasTokenMqttDevice,
double-click authenticator and consider the
following two optional steps:
- Optional: For Advance Expiration, set an appropriate value to define the time period prior to the
token’s expiry when a new token is generated replacing the existing
token. The default value is 10 seconds.
- Optional: Expand Token Parameters and choose an appropriate value for Next Token Expiry
Period. By default, the token expires every 24 hours.
- Right-click authenticator and select .
- In the Setup From Connection String window, paste in the connection string as copied from the Azure
IoT Hub device configuration (see section “Setting up Azure IoT Hub
on Azure portal”).
The authenticator populates the following fields and connects
the parent device to Azure IoT Hub:
Broker Endpoint
Client ID
Token Parameters
Current Token

Note: The authenticator automatically
generates a new token before the current token expires and reconnects
the device using the new token. To prompt this procedure manually,
you can at any time invoke the Generate New Token action on the authenticator.