Search code examples
azureazure-blob-storageazcopy

How to handle AZcopy failed file transfers


I am copying a huge number of small files from local file system to Azure blob storage. Very few files fail to upload. It seems that AZcopy just logs these failures and there is no easy way to retry to upload these files. It is not feasible (time-wise) to search each file one by one and upload it manually. Are there any suggestions to handle these failures and retry to upload the to Blob automatically ?


Solution

  • If the transfer job error is not resulted from the sas token or authentication, you could try below command line from this link.

    Show the error message of the failed job:

    azcopy jobs show <job-id> --with-status=Failed
    

    enter image description here

    Fix them,then execute resume command:

    azcopy jobs resume <job-id> --source-sas="<sas-token>"
    azcopy jobs resume <job-id> --destination-sas="<sas-token>"
    

    Please refer to the statement of above command:

    When you resume a job, AzCopy looks at the job plan file. The plan file lists all the files that were identified for processing when the job was first created. When you resume a job, AzCopy will attempt to transfer all of the files that are listed in the plan file which weren't already transferred.