Legacy V2 SaS Provisioning and Connection
Overview
This section explains how to provision a gateway and how to connect to the Azure IoT Services using a SaS connection string.
The Provisioning section describes how to provision a gateway into the Azure Portal.
The Create a SaS cloud connection section describes how to create a new cloud connection in ESF and how to configure and use the TPM in the gateway to connect and authenticate into the selected Azure IoT Service.
Provisioning
SaS Provisioning can be accomplished using one of two ways:
- Adding a device to IoT Hub
- Adding a device to IoT Central Applications
Using IoT Hub to provision device
In Microsoft Azure Portal, IoT Hub -> IoT Devices, add a new device with a device identity:
Open the device details and copy the “Connection string (primary key)” that will be used for creating the new Cloud connection:
Using IoT Central Applications to provision device
Prerequisites
In order to provision your device with SaS credentials using IoT Central Applications, you must first create an application. Instructions on how to create your own IoT Central application can be found
here.
Create a device
You must Create your device in your Azure IoT Central Application before provisioning using SaS credentials.
Connect device
Click on your device from the Devices page and click Connect
Make sure the Connection method is set to "Shared access signature (SAS)".
Copy the ID scope and Primary Key that will be used for creating the new Cloud connection.
Create a SaS cloud connection
In the ESF Web interface, create a new Cloud Connection using Factory AzureSasCloudEndpoint
There are two methods of connection using Azure IoT Portal:
- Connect using Azure IoT Hub
- Connect using Azure IoT Central
Configure connection using Azure IoT Hub
Select the new connection and configure SasMqttDataTransport with the Connection string that has been previously copied:
Configure connection using Azure IoT Central
Copy the *Global device endpoint** of your Azure Device Provisioning Service. Paste that into the SasMqttDataTransport Connection String following "Hostname=".
Copy the ID Scope and Primary key from your device in IoT Azure IoT Central created during SaS Provisioning. Paste into the SasMqttDataTransport Connection String following "DeviceID=" and "SharedAccessKey=" respectively.
Updated about 1 year ago