首页 > 解决方案 > 如何将文件从 Azure 存储文件共享复制到发布管道代理

问题描述

我想将 FileShare 中 Azure 文件存储中的文件下载到我的发布管道代理中。

在此处输入图像描述

在发布管道中,我使用 PowerShell 步骤并运行命令:

Start-AzStorageFileCopy    -SrcShareName "report.xml" -SrcFilePath "."  -DestFilePath "$(System.DefaultWorkingDirectory)" -DestShareName  "report.xml" -Context $(context)

它现在问我一个参数-name

2020-05-09T01:43:34.1007773Z ##[error]Cannot process command because of one or more missing mandatory parameters: Name.

基本上我的计划是将此文件用于发布管道中的测试报告。因此,我需要在发布测试结果步骤中使用此文件。

在此处输入图像描述

标签: azureazure-devopsazure-pipelinesazure-files

解决方案


您正在寻找从发布代理作业本地下载文件,所以我会坚持使用下面的这个命令:

Get-AzStorageFileContent -Context $Context -ShareName "acishare" -Path "report.xml" -Destination $(System.DefaultWorkingDirectory)

推荐阅读