Search code examples
azure-iot-hub

Options to generate per-device SAS tokens


I am going through the following article:

https://learn.microsoft.com/en-us/azure/iot-hub/iot-hub-dev-guide-sas?tabs=node#sas-tokens

... and I understand that I have the following options to generate a per device SAS token:

Other than above two options, are there any other way(s) to generate per-device SAS connection strings?

Is there any way to generate per-device SAS tokens in Azure Portal?


Solution

  • Other than above two options, are there any other way(s) to generate per-device SAS connection strings?

    Next to Roman's suggestion for Azure IoT Explorer, you can also write your own SAS token generator. The documentation you linked also code samples in four programming languages; you can use those to create SAS tokens for a device as well. Use {hub name}.azure-devices.net/devices/{device name} for the resourceUri and don't include a policyName.

    Is there any way to generate per-device SAS tokens in Azure Portal?

    No (I mean, you could use the Cloud Shell and use the Azure CLI in the Portal, but I don't think that's what you're asking). There is no visual interface for this in the Azure Portal.