Search code examples
azureazcopy

Azcopy: Is it possible do resume a download with a new SAS key


I started downloading a bigger blob of data (around 500GB) yesterday using azcopy. I had it run overnight, and - as these things go when you have big downloads / uploads - my Windows Desktop decided that it has an important update and needs to restart.

Normally, I would have just resumed the download in the morning; however, now I get an authorization error. Likely, because the SAS key expired, so I'd like to give it a new one.

I used the following command for this job:

copy https://<blobstore>.blob.core.windows.net/<path>?se=2019-07-18t21%3A59%3A10z&sig=<signature>&sp=rlac&spr=https&srt=sco&ss=b&st=2019-07-11t13%3A59%3A10z&sv=2018-03-28 . --recursive

Hence my question: Can I give the incomplete job a new SAS key so that it can resume the download?


Solution

  • I found a solution. The command azcopy jobs resume allows to specify the arguments --source-sas and --destination-sas. I could resume the job by supplying a new token:

    azcopy jobs resume <job-id> --source-sas <sas-token>
    

    for example

    azcopy jobs resume 67739a41-d3c6-204a-5449-9c3f0bd18ce2 --source-sas "?sv=2018-03-28&ss=bfqt&srt=sco&sp=rwdlacup&se=2019-08-02T21:00:00Z&st=2019-07-12T04:10:24Z&spr=https&sig=<signature>"