0
votes

We have an application that continuously uploads data to the Azure IoT Hub through the C device client SDK and its IoTHubDeviceClient_UploadToBlobAsync function. We want to start as many uploads in parallel to optimize upload speed, but we also frequently get abrupt power offs. This has resulted in devices getting the error 403 that says the device has exceeded the 10 ongoing uploads limit, because uploads were started but not completed correctly. This means we have to wait for the SaS token to expire in the IoT Hub before we can start any new uploads (default 1 hour).

I understand that the in the last steps of uploading requires the device to notify the IoT Hub about the completion of uploading, but is there a way to inform the IoT Hub that it should "reset" and discard/mark complete any ongoing uploads? It can be either from device side or from any backend process that has connection to the Azure IoT Hub.

We've tried to reduce the time of the SaS token expiration to 1 minute, but it doesn't seem like it allows anything lower than ~30 minutes, which is slightly too long for our most common operation.

1

1 Answers

0
votes

Basically, the UploadToBlobAsync method is a wrapper around the REST APIs to Azure IoT Hub to retrieve a storage SaS URI and notifying a status of the completion.

Based on the above REST APIs, you can control uploading a blob file via the Azure IoT Hub.

More details about the usage of the above REST API calls can be found here and here.