Do SAS URIs expire after successful file uploads in IoT Hub?

Schröder, Bernd 20 Reputation points
2025-01-20T13:36:29.6933333+00:00

I am running a script that collects data from a device and uploads it to a storage account at regular intervals. This process is leading to an error, as described in this issue (403 TooManyDevicesError after 10 Files).

I suspect that I might be hitting the file upload limit of 10 concurrent uploads, even though the files are already stored. According to the documentation, SAS URIs are valid for at least one hour (or one minute according to this document, but there seems to be no option to set them for less than one hour).

My questions are:

  • While the SAS URIs are valid, is the upload still active?
  • Are the URIs deleted once the file upload is completed?
  • Is there a way to delete them manually, or is it simply a limitation that allows for only 10 uploads within an hour?

Thank you in advance.

Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
3,048 questions
Azure IoT Hub
Azure IoT Hub
An Azure service that enables bidirectional communication between internet of things (IoT) devices and applications.
1,228 questions
Azure IoT SDK
Azure IoT SDK
An Azure software development kit that facilitates building applications that connect to Azure IoT services.
227 questions
0 comments No comments
{count} votes

Accepted answer
  1. Marcin Policht 32,735 Reputation points MVP
    2025-01-20T13:40:32.9233333+00:00
    1. While the SAS URIs are valid, is the upload still active?
      No, the SAS URI's validity indicates the time period during which the URI can be used to perform operations on the associated resource (e.g., upload, read, or delete a file). Once a file upload completes, the operation is finalized, but the SAS URI remains valid until its expiration time, allowing additional operations on the resource if permitted by the URI's configuration.
    2. Are the URIs deleted once the file upload is completed?
      No, SAS URIs are not "deleted" upon file upload completion because they are essentially temporary tokens tied to the storage account. They remain valid until their expiry time unless the associated access key or policy is revoked.
    3. Is there a way to delete them manually, or is it simply a limitation that allows for only 10 uploads within an hour?
      SAS URIs themselves cannot be "deleted," but you can revoke their validity by:
      • Regenerating the storage account key if the SAS was generated using an account key.
      • Deleting or updating the stored access policy if the SAS was created with one.

    The 10 concurrent uploads limit you mentioned may be specific to the configuration of your storage account or the device. This is not directly tied to SAS URI limitations but rather to constraints on concurrent operations imposed by your application, device, or storage settings. You can explore strategies like queuing uploads, reducing concurrency, or leveraging Azure Storage batch operations to overcome the limitation.

    To address your current issue, consider adjusting the script to upload files sequentially or limit the number of concurrent uploads to less than 10.


    If the above response helps answer your question, remember to "Accept Answer" so that others in the community facing similar issues can easily find the solution. Your contribution is highly appreciated.

    hth

    Marcin


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.