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

# SaS Provisioning and Connection

# Overview

This section explains how to provision a gateway and how to connect to the Azure IoT Services using SaS. This connection method can only be used with IoT Hub DPS Individual Enrollment, IoT Hub DPS Enrollment Group, IoT Central Individual Enrollment, or IoT Central Enrollment Group.

> 🚧 ESF Cloud Connector for Azure IoT, Version 2.0.0 And Above Only
>
> These instructions apply to the ESF Cloud Connector for Azure IoT, Version 2.0.0 and above.  See [Legacy v2 Azure IoT Connection](https://esf.eurotech.com/v7.2.0/docs/esf-cloud-connector-for-azure-iot-hub-new-legacy-v2) if you are using any version under 2.0.0.

# Provisioning

SaS Provisioning can be accomplished in four ways:

* Start at [Provision Device Using IoT Hub DPS Individual Enrollment](#provision-device-using-iot-hub-dps-individual-enrollment) for IoT Hub DPS Individual Enrollment
* Start at [Provision Device Using IoT Hub DPS Enrollment Group](#provision-device-using-iot-hub-dps-enrollment-group) for IoT Hub DPS Enrollment Group
* Start at [Provision Device Using IoT Central Individual Enrollment](#provision-device-using-iot-central-individual-enrollment) for IoT Central Individual Enrollment
* Start at [Provision Device Using IoT Central Enrollment Group](#provision-device-using-iot-central-enrollment-group) for IoT Central Enrollment Group

## Provision Device Using IoT Hub DPS Individual Enrollment

Go to the **Manage Enrollments** page of your DPS in your Azure Portal and click **+ Add individual enrollment**.

![2724](https://files.readme.io/4dea5f7-sas-new-ind-enrollment.png "sas-new-ind-enrollment.png")

On the **Add Enrollment** page, enter the following information:

* **Mechanism**: Symmetric Key
* Check **Auto-Generate Keys** (recommended) or enter your own Primary and Secondary keys (advanced)
* **Registration ID** and **IoT Hub Device ID**: Both fields should be the same value. This can be any unique identifier. A good method to ensure this is unique is to use the gateway's MAC address and serial number (in the format \[MACAddress]-\[SerialNumber])
* **All other fields**: Leave at the default values

Click **Save**.

![2722](https://files.readme.io/9f1cd0b-sas-add-enrollment.png "sas-add-enrollment.png")

The Azure Portal will return you to the **Manage Enrollments** page. Navigate to the **Manage Enrollments** page if you are not automatically returned to it.

Continue at [Create a SaS cloud connection](#create-a-sas-cloud-connection).

## Provision Device Using IoT Hub DPS Enrollment Group

> 📘 Azure CLI Required
>
> The Azure CLI is required for IoT Hub DPS Enrollment Group provisioning. Ensure it is installed and available before proceeding.  Instructions for installing the Azure CLI are available [here](https://docs.microsoft.com/en-us/cli/azure/install-azure-cli).

Go to your DPS in your Azure Portal. Go to the **Manage Enrollments** page. If you already have an enrollment group set up for SaS that you want to use, skip to [Add Device to Enrollment Group](#add-device-to-enrollment-group).

#### Create Enrollment Group

Click **+ Add Enrollment Group**.

![2724](https://files.readme.io/bc4d7eb-sas-add-new-enrollment-group.png "sas-add-new-enrollment-group.png")

On the **Add Enrollment Group** page, enter the following information:

* **Group Name**: Any unique designator.
* **Attestation Type**: Symmetric Key
* Check **Auto-Generate Keys** (recommended) or enter your own Primary and Secondary keys (advanced)
* **All other fields**: Leave at the default values

Click **Save**.

![2715](https://files.readme.io/911a97a-sas-new-enrollment-group-details.png "sas-new-enrollment-group-details.png")

The Azure Portal will return you to the **Manage Enrollments** page. Navigate to the **Manage Enrollments** page if you are not automatically returned to it.

#### Add Device to Enrollment Group

Navigate to the DPS **Manage Enrollments** page. Click on the enrollment group the device should be registered in to go to the **Enrollment Group Details** page. Copy the **Primary key**.

![2719](https://files.readme.io/b1a3137-sas-get-primary-key.png "sas-get-primary-key.png")

Run the following command in Azure CLI. Replace "\<primary\_key>" with the Primary Key you copied above. Replace "\<device\_id>" with any unique designator. A good method to ensure this is unique is to use the gateway's MAC address and serial number (in the format \[MACAddress]-\[SerialNumber])

```shell
az iot central device compute-device-key --pk <primary_key> --device-id <device_id>
```

The Azure CLI will display a key. You will need this key and the Device ID you used in the next section.

Continue at [Create a SaS cloud connection](#create-a-sas-cloud-connection).

## Provision Device Using IoT Central Individual Enrollment

### Prerequisites

#### Create an Application

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](https://esf.eurotech.com/v7.2.0/docs/create-a-device-in-iot-central-applications) 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 **Authentication Type** is set to "Shared access signature (SAS)".

Leave this window open. It will be used in the next section.

![1281](https://files.readme.io/a85d9ad-sas-connect-device.png "sas-connect-device.png")

Continue at [Create a SaS cloud connection](#create-a-sas-cloud-connection).

## Provision Device Using IoT Central Enrollment Group

> 📘 Azure CLI Required
>
> The Azure CLI is required for IoT Central Enrollment Group provisioning. Ensure it is installed and available before proceeding. Instructions for installing the Azure CLI are available [here](https://docs.microsoft.com/en-us/cli/azure/install-azure-cli).

### Prerequisites

#### Create an Application

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).

Navigate to the **Device connection** section of the **Administration** page in your IoT Central Application. Click **+ Create enrollment group**.

![3386](https://files.readme.io/32dac23-sas-device-connection.png "sas-device-connection.png")

The **Name** must be set to a unique enrollment group name. Set the **Attestation type** to "Shared access signature (SAS)." Leave all other fields at default values and click **Save**.

![3353](https://files.readme.io/e904d69-sas-create-new-group.png "sas-create-new-group.png")

The Azure Portal will return you to the Enrollment Group details page. Copy the **Primary key**.

![3365](https://files.readme.io/5b13601-sas-group-primary-key.png "sas-group-primary-key.png")

Run the following command in Azure CLI. Replace "\<primary\_key>" with the Primary Key you copied above. Replace "\<device\_id>" with any unique designator. A good method to ensure this is unique is to use the gateway's MAC address and serial number (in the format \[MACAddress]-\[SerialNumber]).

```shell
az iot central device compute-device-key --pk <primary_key> --device-id <device_id>
```

The Azure CLI will display a key. You will need this key and the Device ID you used in the next section.

Continue at [Create a SaS cloud connection](#create-a-sas-cloud-connection).

# Create a SaS cloud connection

In the ESF Web interface, go to the **Cloud Connection** section and click **New Connection**.

On the **New Cloud Connection** dialog, enter the following information:

* **Cloud Connection Factory PID**:  AzureDpsSas
* **Cloud Connection Service PID**: AzureDpsSas or other valid Cloud Connection Service PID

Click **Apply**.

![1195](https://files.readme.io/62eaccb-sas-create-cloud-connection.png "sas-create-cloud-connection.png")

Select the new connection and go to the **SasMqttDataTransport** tab.

![2328](https://files.readme.io/8c99312-sas_data_transport.png "sas_data_transport.png")

Select the appropriate **Device Model ID** from the list of options. If a device model does not need to be specified your application, leave the default 'None' field'. Set the 'Device Model ID Version' to the appropriate version of the Device Model ID.

Connecting to Azure IoT Portal can be accomplished in four ways:

* Start at [Configure connection using IoT Hub DPS Individual Enrollment](#configure-connection-using-iot-hub-dps-individual-enrollment) for IoT Hub DPS Individual Enrollment
* Start at [Configure connection using IoT Hub DPS Enrollment Group](#configure-connection-using-iot-hub-dps-enrollment-group) for IoT Hub DPS Enrollment Group
* Start at [Configure connection using IoT Central Individual Enrollment](#configure-connection-using-iot-central-individual-enrollment) for IoT Central Individual Enrollment
* Start at [Configure connection using IoT Central Enrollment Group](#configure-connection-using-iot-central-enrollment-group) for IoT Central Enrollment Group

## Configure connection using IoT Hub DPS Individual Enrollment

Navigate to the Azure DPS **Manage Enrollments** page and select the **Individual Enrollments** tab. Find your device in the list and click it to go to the **Enrollment Details** page. Copy the **Primary Key** to the **Symmetric Key** in ESF. Copy the Registration ID from the top of the page to the **Registration ID** in ESF.

> 📘 Finding the Registration ID on the Enrollment Details Page
>
> The Registration ID is the larger text near the top of the page. It is not labelled as "Registration ID." This is the topmost red square in the image below.

![2723](https://files.readme.io/51dc1a0-sas-PK-RegID.png "sas-PK-RegID.png")

Navigate to the **Overview** page of the Azure DPS. Copy/paste the **Global device endpoint** and **ID Scope** into the **Global Endpoint** and **Scope ID** in ESF.  Click **Apply**.

![2717](https://files.readme.io/58b1441-sas-global-endpoint.png "sas-global-endpoint.png")

Click the **Connect/Disconnect** button. The **Status** should change to Connected. The connection process may take up to 30 seconds.

When the AzureDpsSas is connected, navigate to the device in DPS (via **Manage Enrollments**/**Individual Enrollments**). Select your device to go to the **Enrollment Details** page.

In the **Registration Status** section, confirm that the **Status** is "assigned." If the Status is still "unassigned" try refreshing the page in your browser (not the Azure Portal "refresh" button).

![2718](https://files.readme.io/6d6b30e-sas-confirm-connection.png "sas-confirm-connection.png")

When the gateway connects for the first time, a Device will be created in the IoT Hub. Navigate to your IoT Hub in the Azure Portal. Go to the **IoT Devices** page and confirm the device is listed. The gateway will be listed under the Device ID you entered earlier.

![2715](https://files.readme.io/ddc863d-sas-iot-hub-device.png "sas-iot-hub-device.png")

The device is now connected.

## Configure connection using IoT Hub DPS Enrollment Group

Copy the key created by the Azure CLI command (without the quote marks). Paste this into the **Symmetric Key** in ESF. Copy and paste the Device ID from the CLI command to the **Registration ID** in ESF.

Navigate to the **Overview** page of the Azure DPS. Copy/paste the **Global device endpoint** and **ID Scope** into the **Global Endpoint** and **Scope ID** in ESF.  Click **Apply**.

![2717](https://files.readme.io/56c6f7f-sas-global-endpoint.png "sas-global-endpoint.png")

Click the **Connect/Disconnect** button. The **Status** should change to Connected. The connection process may take up to 30 seconds.

When the AzureDpsSas is connected, navigate to the **Enrollment Group Details** page in DPS (via **Manage Enrollments**/**Enrollment Groups** and click your Enrollment Group). Select the **Registration Records** tab.

![2730](https://files.readme.io/e9c39a8-sas-reg-records.png "sas-reg-records.png")

Click your device to go to the **Device Registration** page.  In the **Registration Status** section, confirm that the **Status** is "assigned." If the **Status** is still "unassigned" try refreshing the page in your browser (not the Azure Portal "refresh" button).

![2723](https://files.readme.io/3595926-sas-confirm-device-assigned.png "sas-confirm-device-assigned.png")

When the gateway connects for the first time, a Device will be created in the IoT Hub. Navigate to your IoT Hub in the Azure Portal. Go to the **IoT Devices** page and confirm the device is listed. In the IoT Hub the gateway will be listed under the Device ID you used in the Azure CLI.

![2715](https://files.readme.io/f8b387a-sas-iot-hub-device.png "sas-iot-hub-device.png")

The device is now connected.

## Configure connection using IoT Central Individual Enrollment

The **Scope ID**, **Symmetric Key** and **Registration ID** can be found on the **Device Connection** details page (**Devices**/**\[Device Name]**/**Connect**).

Copy/paste the following items from the **Device Connection** details page to the ESF Cloud Connection Configuration:

<Table align={["left","left"]}>
  <thead>
    <tr>
      <th>
        Azure IoT Central Device Connection
      </th>

      <th>
        ESF Cloud Connection Configuration
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        ID Scope
      </td>

      <td>
        Scope ID
      </td>
    </tr>

    <tr>
      <td>
        Device ID
      </td>

      <td>
        Registration ID
      </td>
    </tr>

    <tr>
      <td>
        Primary Key
      </td>

      <td>
        Symmetric Key
      </td>
    </tr>
  </tbody>
</Table>

![1281](https://files.readme.io/322a139-sas-connection-details.png "sas-connection-details.png")

The **Global Endpoint** can be found in the DPS in the Azure Portal by navigating to the **Overview** page of your Azure DPS.

Copy/paste the **Global device endpoint** to the **Global Endpoint** in ESF and click **Apply**.

![3361](https://files.readme.io/093976b-sas-global-device-endpoint.png "sas-global-device-endpoint.png")

Click the **Connect/Disconnect** button. The **Status** should change to Connected. The connection process may take up to 30 seconds.

When the AzureDpsSas is connected, navigate to the **Devices** page in your IoT Central Application. Confirm the **Device status** is **Provisioned**.

![3356](https://files.readme.io/3a9558b-sas-device-provisioned.png "sas-device-provisioned.png")

The device is now connected.

## Configure connection using IoT Central Enrollment Group

Copy the key created by the Azure CLI command (without the quote marks). Paste this into the Symmetric Key in ESF. Copy and paste the Device ID from the CLI command to the Registration ID in ESF.

Navigate to the **Device connection** section of the **Administration** page in your IoT Central Application. Copy the **ID Scope** and paste it in the **Scope ID** in ESF.

![3360](https://files.readme.io/d8ce630-sas-group-scope-id.png "sas-group-scope-id.png")

Navigate to the **Overview** page of the Azure DPS. Copy/paste the **Global device endpoint** into the **Global Endpoint** in ESF.  Click **Apply**.

![3361](https://files.readme.io/56f8c94-sas-global-device-endpoint.png "sas-global-device-endpoint.png")

Click the **Connect/Disconnect** button. The **Status** should change to Connected. The connection process may take up to 30 seconds.

When the AzureDpsSas is connected, navigate to the **Devices** page in your IoT Central Application. Confirm the device is listed, and that **Device status** is **Provisioned**. If the device does not show up, refresh the page in your browser.

![3356](https://files.readme.io/addcd60-sas-device-provisioned.png "sas-device-provisioned.png")

The device is now connected.