0
votes

Im having a problem trying to resolve an expression as part of the pipeline name with azure.

I have created some defined variable as shown below, and when echoing these out they are showing the correct evaluated expressions enter image description here

This being said, when then trying to use them as the Release name format it is not resolving the expression and instead using the raw value

Release format name = $(Minor.Major).$(Patch).b$(rev:r)

result is : $[format('{0}.{1}',variables['Major'], variables['Minor'])].$(Patch).b1 what id expect: 1.0.XbX where the x's are the build patch and rev number

am i missing something in the name box to make it turn into an expression

reference used was https://kasunkodagoda.com/2019/04/03/hidden-gems-in-azure-pipelines-creating-your-own-rev-variable-using-counter-expression-in-azure-pipelines/#8230

1

1 Answers

0
votes

As test result and doc description: We could use the pipeline number format in the Azure DevOps build pipeline instead of release pipeline.

Release name format: We could change the naming scheme by editing the release name format mask, When specifying the format mask, we can use the pre-defined variables.

Build number format: We can also use user-defined and predefined variables that have a scope of "All" in your number

Update1

We cannot use counter or format in the release pipeline and the blog you shared just show the build result.

Check this doc adding counter expressions spec: This feature adds a new expression function, counter, which will atomically increment a variable value at the start of each build.

And this doc: It cannot be used as part of a condition for a step, job, or stage.

And this is my test result

Build pipeline:

enter image description here

Release pipeline:

enter image description here