Skip to content
Advertisement

how to download a sub directory from azure blob storage using blobxfer

I am using ubuntu 64bit 14.04. How can I use blobxfer to download a sub directory from Azure blob storage to my local machine . Say I have a storage account by name MY_STORAGE_ACCOUNT ,container by name MY_CONTAINER and following contents inside container.

directory1/directory2/directory3/file1 
directory1/directory2/directory3/file2
directory1/directory2/directory3/file3
..
..
directory1/directory2/directory3/fileN

I want to download the sub directory directory3 only .

I have a SAS key which has access and can download individual files however wildcards aren’t working in that . My command looks like below

blobxfer --saskey "$MYSASKEY" MY_STORAGE_ACCOUNT MY_CONTAINER "$LOCAL_DIR"  --download --remoteresource "directory1/directory2/directory3/*

and I am getting the following error which probably says it can’t understand wildcard in the command .

requests.exceptions.HTTPError: 404 Client Error: The specified blob does not exist.

Advertisement

Answer

Please try this:

blobxfer --saskey "$MYSASKEY" MY_STORAGE_ACCOUNT MY_CONTAINER "$LOCAL_DIR"  --download --remoteresource . --include "directory1/directory2/directory3/*"

Also when you using SAS key, please make sure that List permission is included in SAS.

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement