Mohamed Shehata
Mohamed Shehata

Reputation: 91

Using a variable for branch name is not working

We have one build pipeline (Product1) that use multiple branches (dev, test, prod).

In release pipeline/artifacts settings, we use the following settings:

The scenario that we are having:

How can we use branch variables in release pipelines?

Upvotes: 5

Views: 1899

Answers (1)

Andy Li-MSFT
Andy Li-MSFT

Reputation: 30372

As you set the Default version: Latest from a specific branch with tags.

You need to add tags for builds, then specify the specific tag in artifacts settings, otherwise it will use the last successful builds generated from the build pipeline (will ignore the specified branch).

For example, in below screenshot I added a tag master for the successful build using the master branch, then specify the tag in Artifact settings. Thus when you create a release it will automatically select the latest build which has the tag master and using master branch.

enter image description here

Upvotes: 3

Related Questions