My project is to use the phone to receive the data from the Bluetooth device and then send it to iot central. But sas expire after a few hours, is there any way to get long-term authorization?

Feiling Pan 40 Reputation points
2023-06-19T13:38:44.1233333+00:00

reference of get sas https://learn.microsoft.com/en-us/answers/questions/1304256/how-to-use-postman-to-test-send-data-to-iot-centra

I've checked the documents, but --du seems limited in 3600, I want a long-period sas.

az iot hub generate-sas-token [--auth-type {key, login}]
                              [--connection-string]
                              [--device-id]
                              [--du]
                              [--hub-name]
                              [--key-type {primary, secondary}]
                              [--login]
                              [--module-id]
                              [--pn]
                              [--resource-group]
Azure IoT Central
Azure IoT Central
An Azure hosted internet of things (IoT) application platform.
347 questions
0 comments No comments
{count} votes

Accepted answer
  1. AshokPeddakotla-MSFT 27,571 Reputation points
    2023-06-20T10:11:52.89+00:00

    Feiling Pan Greetings!

    Looks like you are referring to this page az iot hub generate-sas-token

    Please note that generating a SAS token with a longer duration can increase the security risk. So you should only do this if it is necessary for your scenario.

    The default value is 3600 seconds. You can set the token expiration as desired.

    For ex:

    az iot hub generate-sas-token -n myIoTHub -d myDevice --du 630720

    Also, check Control access to IoT Hub using Shared Access Signatures for more details.

    Hope this helps. Do let us know if you have any further queries.

    If this answers your query, do click Accept Answer and Yes for was this answer helpful. And, if you have any further query do let us know.

    0 comments No comments

0 additional answers

Sort by: Most helpful