忽略 AzureBlob 文件复制任务中的 files/folders

Ignore files/folders in AzureBlob File Copy task

我在发布管道中使用 AzureBlob 文件复制任务。我想忽略源工件中的某些文件和文件夹(例如 .gitignore,所有 .md 文件,.git 文件夹)。

任务的可选参数似乎不接受 AzCopy 标志 --exlude。 我没有使用过 AzCopy,但它确实指定

The general format of the commands is: 'azcopy [command] [arguments] --[flag-name]=[flag-value]'.

我试过使用 /Y /SetContentType /Z /V /S --exclude=*.md 但我收到错误消息

The syntax of the command is incorrect. The option "--exclude=*.md" is not recognized.

部署发布时。我还尝试了 --exclude 标志的不同变体,但都导致了相同的错误消息。

  1. 我只是对命令使用了不正确的语法,还是可选参数严格只接受参数而不接受标志?
  2. 有没有办法忽略此任务中的某些文件和文件夹?

这里结合我之前的评论回答你的两个问题

1.Am I simply using the incorrect syntax for the command, or does the Optional Arguments strictly only take arguments and not flags?

对于这个问题,排除标志似乎不是 supported.Supported复制到 blob 的其他参数是 /BlobType:、/Pattern:、/L、/Z、/XN、/A、/ IA:、/XA:、/NC:、/DestType: 和 /SetContentType。标志不能在可选参数中使用。有关详细信息,请参阅 github 上的 README.md

2.Is there a way to ignore certain files and folders within this task?

对于这个问题,我认为目前在 AzureBlob 文件复制任务中不支持。此问题已在 github 上报告,请参阅 Cannot exclude specific files。您可以在评论中给出的 link 留下您的产品反馈。

希望对您有所帮助。