Generate a SAS token
Generate a SAS token with the Device Explorer application or Azure IoT Explorer application.
Prerequisites
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
-
To generate a SAS token with the Device Explorer application:
- Download, install, and open the Device Explorer application from https://github.com/Azure/azure-iot-sdk-csharp/releases.
- In the relative field, insert the IoT Hub connection string.
- Select Update.
- In the Management tab, if the device is not created, select Create.
- Select SAS Token.
- Select the device.
- Specify the token validity period by setting the TTL (Days) option.
- Select Generate.
-
To generate a SAS token with Azure IoT Explorer application:
- Download, install, and open Azure IoT Explorer application from https://github.com/Azure/azure-iot-explorer/releases.
- In the suggested field, insert the IoT Hub connection string.
- Select Connect.
- If the device is not created, select New.
- Select the device.
- In the Connection string with SAS token tab, from Primary Key, select Symmetric key.
- Determine the token expiration period (minutes) by setting the Set Expiration option.
- Select Generate.