0
votes

I have to download some files from azure to local, using a Mac.

I have been given this Windows command line:

AzCopy /Source:https://XXX.blob.core.windows.net/YYY /SourceKey:TQSxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxpbA== /Dest:C:\myfolder  /Pattern:c /S

I have downloaded and installed azcopy, but it has a radically different syntax, and despite I've been trying for quite some time, I haven't been able to make it work.

What's the correct syntax, given this one?

Looking at some documentation, I've tried:

azcopy cp "https://XXX.blob.core.windows.net/YYY/TQSxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxpbA==" "azcopy_dest" --recursive

but it doesn't work:

failed to perform copy command due to error:

cannot start job due to error: cannot list blobs for download. Failed with error -> github.com/Azure/azure-storage-azcopy/vendor/github.com/Azure/azure-storage-blob-go/azblob.NewResponseError, /go/src/github.com/Azure/azure-storage-azcopy/vendor/github.com/Azure/azure-storage-blob-go/azblob/zz_generated_response_error.go:28

===== RESPONSE ERROR (ServiceCode=ResourceNotFound) ===== Description=The specified resource does not exist.

1
Got the same error when use AZcopy 10 on Linux VM with sas token. Not sure why this happens, but you can download a single file with OAuth token, please use login command first if not yet logged in azcopy cp "https://[account].blob.core.windows.net/[container]/[path/to/blob]" "/path/to/file.txt" Nancy Xiong

1 Answers

0
votes

From you description it seems you are using AZCopy 10, which mean you do not need to specify key. You either need to generate a SAS token or Login before using azcopy.

  1. create a token

azcopy cp "https://XXX.blob.core.windows.net/YYY?[SAS]" "/path/to/dir" --recursive=true

  1. Login azcopy login --tenant-id "your tenantid"

azcopy cp "https://XXX.blob.core.windows.net/YYY" "/path/to/dir" --recursive=true

Used Linux, do not have a Mac but should be the same across all platform.

Hope this helps.