VSTS: Unable to add Build Tag which trigger release

Stephane picture Stephane · Jun 21, 2017 · Viewed 8.6k times · Source

In VSTS online, I have in my Release process (Under Triggers) the Continuous Deployment checked. On the Set trigger on artifact source, I put a Tag condition (with tags) set to Automated.

Release trigger

I also have a tag in the Build Process. (Correctly adds the Tag to the build)

But my release is not triggered automatically? In the Deployments status (In my Build) it says "Tags set for release trigger did not match the tags in build branch". But they match (See pictures). What could be the issue?

Build

Answer

Marina Liu picture Marina Liu · Jun 22, 2017

This is because you added the tag Automated after the build is finished (by label source or manually). This can’t trigger CD release. Tags should be add during a build (not a build is finished). So you can add a power shell task with inline script in your build definition:

Write-Host "##vso[build.addbuildtag]Automatd" 

Then the release will be trigger after build is finished.

enter image description here