I have this in my CI/CD pipeline:
az storage blob download-batch --destination "extraction" --source azure_container --auth-mode login --account-name az_account_name
When running it (as part of my full pipeline), I get this:
ERROR:[Errno 20] Not a directory:'extraction/config-0000/scripts'
Directory is expected, not a file.
I dont get why. config-0000 is a directory in the container azure_container. Inside, we have folder, which contain folder, which contain json files.
I just want to download the full folder structure and files from within the container.
Ironically, uploading via az storage blob upload-batch works like a charm...
Any idea on how to do this?
The error "Directory is expected, not a file" tells that the destination path specified in the
--destinationparameter is not a directory. Also, check theextractionfolderin the same directory which you're running the command on your system.In my environment, I have the Blob structure in my storage account.
Now, using the same command, I can download all files and folders from the Azure Blob storage.
Command:
The above command is executed and downloads the exact structure in my environment.
Output:
Reference: az storage blob | Microsoft Learn