Generate a SAS token

Generate a SAS token with the Device Explorer application or the Azure IoT Explorer application.
From the Azure portal, obtain the
IoT Hub connection string
. For more information, see https://devblogs.microsoft.com/iotdev/understand-different-connection-strings-in-azure-iot-hub/.
  • To generate a SAS token with the Device Explorer application:
    1. Download, install, and open the Device Explorer application from https://github.com/Azure/azure-iot-sdk-csharp/releases.
    2. In the relative field, insert the
      IoT Hub connection string
      .
    3. Select
      Update
      .
    4. In the
      Management
      tab, if the device is not created, select
      Create
      .
    5. Select
      SAS Token
      .
    6. Select the device.
    7. Specify the token validity period by setting the
      TTL (Days)
      option.
    8. Select
      Generate
      .
  • To generate a SAS token with the Azure IoT Explorer application:
    1. Download, install, and open the Azure IoT Explorer application from https://github.com/Azure/azure-iot-explorer/releases.
    2. In the suggested field, insert the
      IoT Hub connection string
      .
    3. Select
      Connect
      .
    4. If the device is not created, select
      New
      .
    5. Select the device.
    6. In the
      Connection string with SAS token
      tab, from
      Primary Key
      , select
      Symmetric key
      .
    7. Determine the token expiration period (minutes) by setting the
      Set Expiration
      option.
    8. Select
      Generate
      .
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.