marcelo silva
marcelo silva

Reputation: 3

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?

Upvotes: 0

Views: 4777

Answers (1)

Mohit Verma
Mohit Verma

Reputation: 5294

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://learn.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:

enter image description here

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

Upvotes: 1

Related Questions