0
votes

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

  • AzCopy.exe (1.0.8698.584)
  • Microsoft.Data.Edm.dll (5.6.0.61587)
  • Microsoft.Data.OData.dll (5.6.0.61587)
  • Microsoft.Data.Services.Client.dll (5.6.0.61587)
  • Microsoft.WindowsAzure.Storage.DataMovement.dll (1.0.8698.584)
  • Microsoft.WindowsAzure.Storage.dll (3.0.3.0)
2
Which version of SDK are you using? Can you list the version number of all the files (exes and dlls) in AzCopy folder? - Gaurav Mantri
@GauravMantri I've updated the question with AzCopy folder files and versions. Any help you can provide would be appreciated! - dblood
Thanks. I've the same DLLs and also seeing the same problem. I'm inclined to believe the problem is somewhat related to the problem here: stackoverflow.com/questions/21650463/… but I'm not 100% sure. Let me do some more research into it. It may be a little while before I get back on this. - Gaurav Mantri
thanks for investigating. Any help is appreciated. It seems like the most basic of operations. And there are examples of this very functionality. - dblood

2 Answers

5
votes

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.

0
votes

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