jabrena
jabrena

Reputation: 1345

How to generate a SAS Token with Curl?

Using Azure CLI, it is possible to generate a SAS Token easily:

SAS_TOKEN=$( \
  az iot hub generate-sas-token \
  --hub-name $IOT_HUB \
  --device-id $DEVICE \
  --query sas \
  --output tsv)

I would like to generate the SAS token using curl, calling an Azure public API. Is it possible?

Upvotes: 1

Views: 355

Answers (1)

Tony Ju
Tony Ju

Reputation: 15609

There is no such API, the workaround is that you can use Azure Functions to generate an IoT SAS Token, then call Azure function using curl to get the SAS token.

Reference:

Using Azure Functions to generate an IoT SAS Token

Upvotes: 1

Related Questions