Navigate back to the homepage

Simple semantic versioning method in Azure DevOps pipelines

Frédéric De Smet
August 28th, 2023 · 1 min read

In essence this is a simple way to use semantic versioning in Azure DevOps pipelines. The idea is to use the build number as the version number. major and minor version are set manually. The patch version is automatically updated on every run.


3 major: 0
4 minor: 0
6name: $(major).$(minor)$(Rev:.r)

This will result in the following:

Example of above code

The build number can also be retrieved in a release pipeline if you define the build as a resource for the release pipeline. This can be done by using the following code in the build pipeline.


3 pipelines:
4 - pipeline: build # Alias used in this run
5 source: example-build # Pipeline name in azure DevOps
6 trigger:
7 branches:
8 include:
9 - main

I would also advice to update the run name of the release with the same build number. This can be done by using the following code in the build pipeline.

2- bash: |
3 echo "##vso[build.updatebuildnumber]$("

More articles from blog by Frédéric De Smet

TIP keep your build agent on standby during business hours

Extend the limitations of Azure DevOps.

November 19th, 2021 · 1 min read

Naming convention in Terraform

How can we create a reliable naming convention and centralize the logic behind it.

July 17th, 2021 · 1 min read
© 2020–2023 blog by Frédéric De Smet
Link to $ to $ to $ to $