简体   繁体   English

如何在 script.ps1 中运行 az storage blob download-batch 命令?

[英]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:我想在 powershell (.ps1) 中创建一个脚本,您可以在其中运行以下命令:

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.由于您的错误消息不清楚,我将解释可能导致命令问题的几点,但请确保下次包含https://stackoverflow.com/help/minimal-reproducible-example

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.请确保您已安装正确版本的 Azure CLI。

    Current version of Azure CLI is 2.0.76 Azure CLI 的当前版本是 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如果您使用 SAS 访问 blob,请确保您拥有正确的 SAS 令牌集

https://docs.microsoft.com/en-us/cli/azure/install-azure-cli?view=azure-cli-latest 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.如果您需要进一步的帮助,请随时在您的对话中标记我,希望对您有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在 .ps1 脚本和 .ps1 脚本文件中使用 az vm run-command - Using az vm run-command from within a .ps1 script and with .ps1 script file 将'az vm run-command'与.ps1文件一起使用 - Using the 'az vm run-command' with a .ps1 file az storage blob download 在 Azure 管道中运行时不下载文件 - az storage blob download not downloading file when run in Azure Pipelines az storage blob upload-batch 的最低权限 - Least privilege permissions for az storage blob upload-batch Azure CLI - az 存储 blob 删除批处理模式 - Azure CLI - az storage blob delete-batch pattern 如何使用 Az PowerShell 命令在多个订阅上运行 Powershell 脚本 - How to run Powershell script on multiple Subscriptions Using Az PowerShell Command az storage account:“blob-service-properties”不在“az storage account”命令组中 - az storage account: 'blob-service-properties' is not in the 'az storage account' command group az cmd 在“az storage blob upload-batch”后“帐户清除”失败 - az cmd “account clear” fails after “az storage blob upload-batch” 运行命令脚本无法识别术语“az” - The term 'az' is not recognized from Run Command Script 如何使用 az cli 列出存储 blob url? - How to list storage blob url using az cli?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM