Currently, I’m using az storage blob directory download
but every time I run it, I get: This command is implicitly deprecated because command group 'storage blob directory' is deprecated and will be removed in a future release. Use 'az storage fs directory' instead.
I checked the docs and I can’t seem to find what the values for --file-system
should be. Can someone share an example of downloading the content of a directory (a folder) inside a container inside a blob from Azure Storage to a Windows machine?
3
Answers
–file-system is your container name
Above will download the entire directory
Follow this command:
az storage fs directory download -f <container name> --account-name <storage account name> -s <the source dir you want to download> -d "./" --recursive --account-key <The access key of the storage account>
Before run the above command, please make sure your storage account has already enable hierarchical namespace, otherwise the file level of storage account will be flat in your side.
It works on my side:
This is the structure on my side:
I can download the specific directory to current directory:
Your can refer to this official document:
Examples of az storage fs directory
Maybe I am oversimplifying it, but why not just use pattern:
ref: https://learn.microsoft.com/en-us/cli/azure/storage/blob?view=azure-cli-latest#az-storage-blob-download-batch
Hopefully, this will work for you.