简体   繁体   中英

how to run az storage blob download-batch command in script .ps1?

I would like to make a script in powershell (.ps1) where you run the following command:

az storage blob download-batch -d. --pattern * .py -s MyContainer --account-name MyStorageAccount

But failing, could you help me?

Since you error message is not clear, i am gonna explain few points which could cause the issue with the command, but please make sure to include https://stackoverflow.com/help/minimal-reproducible-example next time.

Here is some prerequisite which you need to keep in mind before running this command:

  • Please ensure you have installed the right version of Azure CLI.

    Current version of Azure CLI is 2.0.76

    You can get the more details here:

  • Please ensure if you have the right permission if you are using login mode to download the files.

  • Please ensure you have right set of SAS token if you are using SAS to access the blob

https://docs.microsoft.com/en-us/cli/azure/install-azure-cli?view=azure-cli-latest

I have ran the command and it worked for me using login mode, here is the detail for the same:

在此处输入图像描述

Feel free to tag me in your conversation if you need further assistance, hope it helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM