Resuming a previous broken download of Azure Blob

DUCOS Eric (DEXIP) 116 Reputation points
2021-01-23T18:08:26.837+00:00

Hi,

I try to download a big file stored in Azure Storage Blob (about 5 Gb) from a Xamarin.Forms mobile apps.

I am using an SAS uri on the item.

The download process is run in a background thread.

I just want to implement an algorithm in this background thread so that in case where the user for any reason cancel the app (or if the media goes out of network breaking down the download operation), I could resume the download where it was stopped.

I can I do that ?

Regards.

Eric.

Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
2,561 questions
0 comments No comments
{count} votes

Accepted answer
  1. DUCOS Eric (DEXIP) 116 Reputation points
    2021-01-27T13:32:17.48+00:00

    Hi,

    The answers above were not really a help for me...but I just found after having tested it that the HTTP request on a SAS uri of a blob item accepted the AddRange to start again the download from an offset.

    So I have found the solution on myself...If a "partial" file exists, I recall the HTTPRequest and give an offset corresponding to the size of the partial file and append the downloaded data to the file in append mode.

    Regards.

    Eric.

    0 comments No comments

3 additional answers

Sort by: Most helpful
  1. Andreas Baumgarten 100.6K Reputation points MVP
    2021-01-23T18:34:21.513+00:00

    Here is a similar question in the TechNet forums with answers. Maybe this helps:
    https://social.msdn.microsoft.com/Forums/azure/en-US/3130a967-621b-4698-ab19-85d5c7ea5237/how-to-resume-the-failed-uploading-and-downloading-of-blobs?forum=windowsazuredevelopment


    (If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)

    Regards
    Andreas Baumgarten

    0 comments No comments

  2. Sumarigo-MSFT 44,586 Reputation points Microsoft Employee
    2021-01-27T06:05:42.523+00:00

    @DUCOS Eric (DEXIP) Following up to see if the above suggestion was helpful. And, if you have any further query do let us know.
    Just checking in to see if the above answer helped. If this answers your query, please don’t forget to "Accept the answer" and Up-Vote for the same, which might be beneficial to other community members reading this thread. And, if you have any further query do let us know.

    Adding more information to the above response: There is a similar discussion in SO and MSDN forum, please refer to the suggestion which gives some idea on your scenario

    For browser method like uploadFromBrowserData() which accepts File or Blob type. You can create a customized PauseResume policy and injects into pipeline. The policy can simply hold outgoing requests until resume.

    Refer to this simple about how to create a customized policy.

    You can also use Azcopy tool to resume the download, It's one of the fastest tool in uploading/downloading the data

    0 comments No comments

  3. Martin Monperrus 0 Reputation points
    2024-05-25T06:06:35.7033333+00:00

    Using tool az you can use parameter --start-range

    az storage blob download -f file-end.vhd --blob-url "<URL>" --start-range 1023
    

    It requires to manually stitch the file parts though.

    0 comments No comments