【发布时间】:2020-08-01 10:35:39
【问题描述】:
我在 Azure Devops 中使用“Azure 文件复制”任务,据我所知,它使用 Az copy 命令将文件复制到 Azure 存储中。
这是我的任务定义:
[注意 - 这是任务的 v3]
这在构建管道中首次运行任务时可以正常工作,并按预期在容器中创建文件(如下所示):
当我随后在管道中运行任务时,它会失败。我可以从错误中看到它似乎在提示覆盖选项 - 是/否/全部。见下文:
我的问题: 有谁知道我如何给出任务参数来告诉它每次都强制覆盖? Microsoft 网站上的文档不是很好,我在 Github 存储库上找不到示例。
提前感谢您的任何指点!
完全错误:
& "AzCopy\AzCopy.exe" /Source:"D:\a\1\s\TestResults\Coverage\Reports" /Dest:"https://project1.blob.core.windows.net/examplecontainer" /@:"D:\a\_temp\36c17ff3-27da-46a2-95d7-7f3a01eab368" /SetContentType:image/png /Pattern:"Example.png"
[2020/04/18 21:29:18][ERROR] D:\a\1\s\TestResults\Coverage\Reports\Example.png: No input is received when user needed to make a choice among several given options.
Overwrite https://project1.blob.core.windows.net/examplecontainer/Example.png with D:\a\1\s\TestResults\Coverage\Reports\Example.png? (Yes/No/All) [2020/04/18 21:29:18] Transfer summary:
-----------------
Total files transferred: 1
Transfer successfully: 0
Transfer skipped: 0
Transfer failed: 1
Elapsed time: 00.00:00:01
##[error]Upload to container: 'examplecontainer' in storage account: 'project1' with blob prefix: '' failed with error: 'AzCopy.exe exited with non-zero exit code while uploading files to blob storage.' For more info please refer to https://aka.ms/azurefilecopyreadme
【问题讨论】:
-
注意 - 我通过使用任务的版本 1 解决了这个问题 - 无法弄清楚版本 3 正在寻找什么。现在使用 v1 为我工作。
标签: azure azure-blob-storage azcopy