Generate a SAS token
Generate a SAS token with the Device Explorer application or 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:
- Download, install, and open the Device Explorer application from https://github.com/Azure/azure-iot-sdk-csharp/releases.
- In the relative field, insert theIoT Hub connection string.
- SelectUpdate.
- In theManagementtab, if the device is not created, selectCreate.
- SelectSAS Token.
- Select the device.
- Specify the token validity period by setting theTTL (Days)option.
- SelectGenerate.
- 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 theIoT Hub connection string.
- SelectConnect.
- If the device is not created, selectNew.
- Select the device.
- In theConnection string with SAS tokentab, fromPrimary Key, selectSymmetric key.
- Determine the token expiration period (minutes) by setting theSet Expirationoption.
- SelectGenerate.
Provide Feedback