skip to Main Content

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


  1. –file-system is your container name

    az storage fs directory download -f myfilesystem --account-name mystorageaccount -s SourceDirectoryPath -d "<local-path>" --recursive
    

    Above will download the entire directory

    Login or Signup to reply.
  2. 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:

    enter image description here

    I can download the specific directory to current directory:

    enter image description here

    Your can refer to this official document:

    Examples of az storage fs directory

    Login or Signup to reply.
  3. Maybe I am oversimplifying it, but why not just use pattern:

    az storage blob download-batch --destination "<where you want to download>" --pattern "<directory you want to download from>/*.*" --source "<container name>" --account-name "<storage account>" --account-key "***-key-***" 
    

    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.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search