Azure CLI 存储批量复制不适用于 mac Seira

Azure CLI storage Batch Copy not working on mac Seira

我在 windows 上有一个 AzCopy 命令,它将所有 blob 从存储帐户复制到本地网络驱动器,并进行测试以确保该文件在复制之前不存在。

AzCopy /Source:https://storage.blob.core.windows.net/photos /Dest:C:\folder /SourceKey:xxxxxkeyxxxxxxx /S /XO /XN

此命令运行良好。但是我需要在 mac 上设置相同的过程。我已经安装了 Azure CLI 工具并创建了以下批量复制命令。我在测试时干运行

az storage blob copy start-batch \
--destination-container "/Volumes/Seagate Backup Plus Drive/folder" \
—-source-account-key xxxxkeyxxxx \
—-source-account-name storage \
—-source-uri https://storage.blob.core.windows.net/photos \
--dryrun

但我收到以下错误消息

az: error: unrecognized arguments: Backup Plus Drive/New folder 
—-source-account-key xxxxkeyxxxx 
—-source-account-name storage 
—-source-uri https://storage.blob.core.windows.net/photos

我读到 here 您可以通过 Azure CLI 使用 AzCopy。但是当我尝试它时它说找不到命令。

我是一个完整的 Mac 新手,不确定我做错了什么。非常感谢任何帮助。

此过程还需要设置为非技术人员能够 运行 的批处理过程。我还没有研究这个,因为我想让副本先工作。

你的脚本有两个错误。

首先,Seagate Backup Plus Drive三个空格。当你使用 Azure CLi 时,你应该使用 %20 来替换它。例如:

/Volumes/Seagate%20Backup%20Plus%20Drive

您可以在 Azure 门户上查看。

其次,—-source-account-key xxxxkeyxxxx这是错误的。正确的格式是 --source-account-key xxxxkeyxxxx。仔细看,—---是不一样的

您还需要替换 —-source-account-name storage —-source-uri https://storage.blob.core.windows.net/photos 它们是同样的错误。