AzCopy.exe copy container blob to local storage emulator

Download  Azure container blob to local emulator sometimes throws unknown error:

The transfer failed: The remote server returned an error: (400) Bad Request.

The value for one of the HTTP headers is not in the correct format.

I got similar error and spent hours to resolve:

Finally I found solution

Solution :Split process in two steps

Step1:Copy Azure contianer blobs to local system folder

 

Run below command in azure storage tool:

AzCopy /Source:https://myaccount.blob.core.windows.net/mycontainer /Dest:C:\myfolder /SourceKey:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX /S

Step2: Azurecopy  local file folder to storage emulator

Run below command in azure storage tool:

AzCopy /Source:C:\myfolder /Dest:http://127.0.0.1:10000/devstoreaccount1/mycontainer /DestKey:XXXXXXXXXXXXXXXXXXXXXXXXXXXX  /DestType:Blob /S

Good luck……