dblood
dblood

Reputation: 1778

Cannot download BLOBs from Azure Storage using AzCopy

I am trying to use AzCopy to download blobs from a container in an Azure storage account. Every time I issue the command it immediately returns and says "Finished 0 of total 0 file(s)."

The container is private. I'm using Windows Azure Storage Command Line which is included in the Windows Azure Storage tools download that includes AzCopy.

I can successfully upload files using AzCopy with no problem. Here are examples of my commands.

Upload (Copy) To Azure Storage - This Works

AzCopy c:\temp https://<myaccount>.blob.core.windows.net/<mycontainer> /destkey:<mykey> /V:C:\temp\logs\azcopy.log

Download (Copy) From Azure Storage - This Does Not Work

AzCopy https://<myaccount>.blob.core.windows.net/<mycontainer> c:\temp\meb /sourceKey:<mykey> /V:C:\temp\logs\azcopy.log

I know my key is correct because upload works without a problem. It's like it thinks there are no files in the container, but if I login to the Azure portal I can see files in -mycontainer- which resides in -myaccount-.

I can't find any details online about anyone having a similar issue. What am I missing?

AzCopy Folder Files and Versions

Upvotes: 0

Views: 8892

Answers (2)

Hafiz Arslan
Hafiz Arslan

Reputation: 473

Its very simple with AzCopy. Download latest version from https://azure.microsoft.com/en-us/documentation/articles/storage-use-azcopy/ and in azcopy type: Copy a blob within a storage account:

AzCopy /Source:https://myaccount.blob.core.windows.net/mycontainer1 /Dest:https://myaccount.blob.core.windows.net/mycontainer2 /SourceKey:key /DestKey:key /Pattern:abc.txt

Copy a blob across storage accounts:

AzCopy /Source:https://sourceaccount.blob.core.windows.net/mycontainer1 /Dest:https://destaccount.blob.core.windows.net/mycontainer2 /SourceKey:key1 /DestKey:key2 /Pattern:abc.txt

Copy a blob from the secondary region

If your storage account has read-access geo-redundant storage enabled, then you can copy data from the secondary region.

Copy a blob to the primary account from the secondary:

AzCopy /Source:https://myaccount1-secondary.blob.core.windows.net/mynewcontainer1 /Dest:https://myaccount2.blob.core.windows.net/mynewcontainer2 /SourceKey:key1 /DestKey:key2 /Pattern:abc.txt

To resume any intrrupted operation specify /Z option or for recursive operation specify /S

Upvotes: 0

Gaurav Mantri
Gaurav Mantri

Reputation: 136136

Try downloading the blob by specifying /S parameter. So your download command would be:

AzCopy https://<myaccount>.blob.core.windows.net/<mycontainer> c:\temp\meb /sourceKey:<mykey> /S /V:C:\temp\logs\azcopy.log

From the documentation:

/S                        Recursive copy.
                          In recursive copy mode the source and destination
                          are treated as a directory (file-system) or
                          as a prefix string (blob storage).

This should do the trick.

Upvotes: 5

Related Questions