Since it's not possible in TFS to have one single build definition to handle the same code in multiple branches when using TFVC, we have to maintain multiple build definitions for our branches.
Now we have extended our CI/CD pipeline to do automated release deployments. Since we have multiple branches, we also have multiple build definitions and now we also have multiple release definitions.
With TFS 2017.1 it's now possible to define multiple Continuous Deployment triggers (artifact sources) in a release definition. If one of the build definitions associated to these artifact sources is successfully built, a new release can automatically be created and deployed. To be able to get rid of multiple release definitions it would be necessary to determine the build that acutally triggered the creation of a new release and its deployment.
There are a number of variables that can be used in the release definition but unfortunately it does not seem to be possible to get the build/artifact that actually triggered the release (see https://www.visualstudio.com/en-us/docs/build/concepts/definitions/release/variables#primary-artifact-variables).
How can the build definition/artifact be determined that triggered the release?
I had the same issue. I would have preferred a more direct way to find the triggered "{Artifact alias}" of the corresponding build, but the only way I found to determine which build has triggered the release was to get the following environment variable : $env:RELEASE_RELEASEDESCRIPTION This variable has the following computed value : "Triggered by" + {Artifact alias} + BuildId + "." Hope this helps Best regards Stéphane