1

I am using the AzureBlob File Copy task in a release pipeline. I want to ignore certain files and folders from my source artifact (e.g. .gitignore, all .md files, the .git folder).

The Optional Arguments for the tasks does not seem to accept the AzCopy flag --exlude. I have not used AzCopy, but it does specify that

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

I tried using /Y /SetContentType /Z /V /S --exclude=*.md but I get the error

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

when the release is deployed. I also tried different variations of the --exclude flag, but all have resulted in the same error message.

  1. Am I simply using the incorrect syntax for the command, or does the Optional Arguments strictly only take arguments and not flags?
  2. Is there a way to ignore certain files and folders within this task?
Daniel L
  • 13
  • 4
  • It seems that the exclude flag is not supported.Supported additional arguments for copy to blob are /BlobType:, /Pattern:, /L, /Z, /XN, /A, /IA:, /XA:, /NC:, /DestType: and /SetContentType. You can refer to [README.md](https://github.com/microsoft/azure-pipelines-tasks/tree/master/Tasks/AzureFileCopyV2) on github – Hugh Lin Oct 03 '19 at 11:35
  • @HughLin-MSFT Thank you for the comment and the link to the readme! =) – Daniel L Oct 06 '19 at 17:07
  • Hi,Daniel L I give an answer below,please view it :) – Hugh Lin Oct 11 '19 at 10:24

1 Answers1

0

Here I will answer your two questions in conjunction with my previous comment.

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

For this issue, it seems that the exclude flag is not supported.Supported additional arguments for copy to blob are /BlobType:, /Pattern:, /L, /Z, /XN, /A, /IA:, /XA:, /NC:, /DestType: and /SetContentType. The flags cannot be used in Optional Arguments. For details please refer to the README.md on github.

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

For this issue ,I think it is currently not support in AzureBlob File Copy task. This issue had been reported on the github ,please refer to Cannot exclude specific files . You can leave your product feedback on the link given in the comment.

Hope this helps.

Hugh Lin
  • 17,829
  • 2
  • 21
  • 25
  • The Github discussion you linked unfortunately concludes with a link to a totally different feature request (deleting old files/keeping folders in sync) – chrki Nov 18 '20 at 17:29