---
updatedAt: 2025-11-05T20:39:33.000Z
agentTools:
  projectIndex: https://esf.eurotech.com/v7.0.0/llms.txt
---

# 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](#provisioning) section describes how to provision a gateway into the Azure Portal.\
The [Create a SaS cloud connection](#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:

![809](https://files.readme.io/7f912fe-2ae5a96-sas-iot-hub-prov.png "2ae5a96-sas-iot-hub-prov.png")

Open the device details and copy the “Connection string (primary key)” that will be used for creating the new Cloud connection:

![478](https://files.readme.io/6b891e5-546dbf7-sas-iot-hub-conn-string.png "546dbf7-sas-iot-hub-conn-string.png")

## 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](https://docs.microsoft.com/en-us/azure/iot-central/core/quick-deploy-iot-central).

### Create a device

You must [Create your device](create-iot-central-application-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**

![1574](https://files.readme.io/c090ff0-bae24ca-azure-iot-central-connect-device.png "bae24ca-azure-iot-central-connect-device.png")

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.

![637](https://files.readme.io/955ecf5-16f5c84-azure-iot-central-sas-connect-details.png "16f5c84-azure-iot-central-sas-connect-details.png")

# Create a SaS cloud connection

In the ESF Web interface, create a new Cloud Connection using Factory AzureSasCloudEndpoint

![460](https://files.readme.io/faf7752-sas-cloud-connection.png "sas-cloud-connection.png")

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:

![898](https://files.readme.io/0fbbdd0-sas-mqtt-data-transport.png "sas-mqtt-data-transport.png")

## 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=".

![898](https://files.readme.io/5e9faf9-sas-mqtt-data-transport-hostname.png "sas-mqtt-data-transport-hostname.png")

Copy the **ID Scope** and **Primary key** from your device in IoT Azure IoT Central created during [SaS Provisioning](sas-provisioning). Paste into the SasMqttDataTransport Connection String following "DeviceID=" and "SharedAccessKey=" respectively.

![637](https://files.readme.io/bcab78e-azure-iot-central-sas-connect-details.png "azure-iot-central-sas-connect-details.png")

![898](https://files.readme.io/8af4417-sas-mqtt-data-transport-deviceid-saskey.png "sas-mqtt-data-transport-deviceid-saskey.png")