I want to send messages to the Azure IoT Hub using the MQTT protocol. I followed this video and managed to connect my Linux-based device (a Raspberry Pi) to the IoT Hub.
As instructed in the aforementioned tutorial, I used the Azure IoT Explorer to generate a connection string with SAS token.
I would like to have my device send messages to Azure over extended periods of time (i.e. several weeks). How can I specify such a long duration?
I tried passing 20,000 minutes (~ 1 month) as an argument. I was able to generate a seemingly valid SAS token connection string, but then again, if I pass an aberrant value (e.g. 0 or -1) I am still able to generate a token. Although my token is currently working, I am concerned that it will expire after a default "maximum expiration duration".
So what is the maximum duration that can be passed in the Expiration (minutes) field?
EDIT: according to this SO post, the maximum expiration date for the SAS token is 365 days:
You can specify the expiration date for a SAS token, I think the maximum is 365 days, but forever is not a possibility.