Is there an option to handle the next situation: I have a pipeline and Copy Files task implemented in it, it is used to upload some static html file from git to blob. Everything works perfect. But sometimes I need this file to be changed in the blob storage (using hosted application tools). So, the question is: can I "detect" if my git file is older than target blob file and ignore this file for the copy task to leave it untouched. My initial idea was to use Azure file copy and use an "Optional Arguments" textbox. However, I couldn't find required option in the documentation. Does it allow such things? Or should this case be handled some other way?
-
Hi @AlexVmv, Is there any update about this ticket? Feel free to let me know if the answer could give you some help. Just a remind of [this](https://meta.stackexchange.com/questions/5234/how-does-accepting-an-answer-work). – Kevin Lu-MSFT Mar 01 '21 at 08:24
2 Answers
I think you're looking for the isSourceNewer
value for the --overwrite
option.
--overwrite string Overwrite the conflicting files and blobs at the destination if this flag is set to
true
. (defaulttrue
) Possible values includetrue
,false
,prompt
, andifSourceNewer
.
More info: azcopy copy - Options

- 14,105
- 2
- 40
- 53
-
So, I tried to use this, but I got the next error: failed to parse user input due to error: couldn't parse "ifSourceNewer" into a "OverwriteOption" I am using Pipeline task version 4.*. According to description it supports AzCopy version 10.3.3. The log shows : ##[command] & "AzCopy\AzCopy.exe" copy
--overwrite=ifSourceNewer
Agree with ickvdbosch. The isSourceNewer
value for the --overwrite
option could meet your requirements.
error: couldn't parse "ifSourceNewer" into a "OverwriteOption"
Based on my test, I could reproduce this issue in Azure file copy task.
It seems that the isSourceNewer
value couldn't be set to Overwrite
option in Azure File copy task.
Workaround: you could use PowerShell task to run the azcopy script to upload the files with --overwrite=ifSourceNewer
For example:
azcopy copy "filepath" "BlobURLwithSASToken" --overwrite=ifSourceNewer --recursive
For more detailed info, you could refer to this doc.
For the issue about the Azure File copy task, I suggest that you could submit a feedback ticket in the following link: Report task issues.

- 20,786
- 3
- 19
- 28
-
it seems like I should use something like this? azcopy login --service-principal --application-id "***" --tenant-id="" --aad-endpoint "https://login.windows.net/", however I don't know how to obtain application-id, or should be there another authorization method used? Using only tenant-id is still not enough, I can login using it, but I can't authorize my azcopy copy – AlexVrnv Mar 04 '21 at 10:33