Skip to content
| Marketplace
Sign in
Azure DevOps>Azure Pipelines>Build Version Updater
Build Version Updater

Build Version Updater

Samayas

samayas.eu
|
263 installs
| (2) | Free
Updates a version number.
Get it free

Overview

This extension contains a build task that will update a predefined variable when this task is executed by 1. In a CI environment this task can be helpfull to automatically update a version after each successful build or release. This can reduce the effort of further passing a version down the line in building dlls with predefined versioning.

Prerequisites

This extension supports Azure DevOps Server 2019 and Azure Devops Online.

How to use

After installing the extension, you can add 1 task named 'Build Version Updater' to a new or existing build definition or release definition.

Once you've added the 'Build Version Updater' you should have the following:

add-task

Once you've added the task to your Build or Release pipeline you need to configure your individual task.

configure-task

Inside your task configuration you have 2 settings that are important:

  • The 'Project Build Number Variable' is a variable that will be updated.
  • The 'Samayas Azure Devops Server' is a connection to your DevOps Server.

Variables

The 'Project Build Number Variable' is a variable that will be updated by this task.

This is a variable that should already be existing withing your existing Pipeline and should be initialized to an integer value.

variables-task

Every time this task is run this variable will be updated by 1.

Samayas Azure Devops Server Connection

This Task requires a PAT key in order to connect to your Azure Devops Server.

Creating a PAT key for Azure Devops Server Online

Connect to your online project Azure Devops Server -> https://dev.azure.com/youraccount. Click in the upper right corner on your username and select the Security menu.

security-menu

Once your have selected Security menu you'll see a Personal Access Tokens Menu.

PAT-before

Click on the New Token + to create a new token. A Pop-up will show up where u can create a PAT token.

PAT-create

Once you're in the creation popup you should give your PAT token a descriptive name so you know what you've created that Token for.

You need to select the organization for which you want your token to be valid. You might have access to more than one organization or you could select All accessible organizations. Since the token you are creating is only for a specfic organizatio you should select that orgainzation.

The expiry is the time the token stays valid, here you can specify a specifc date or just select 30 60 or 90 days.

After the expiration you need to reupdate the token or the task won't work anymore.

For this specific task the token needs the following access :

  • Build (Read & Execute)
  • Variable Groups (Read, create, & manage)

You need to select custom defined scopes and should one of those scopes not be available then you need to select Show all scopes.

PAT-overview

Once the PAT is created this is the only time to access the actual key. Here you need to copy the PAT key for later usage.

When the PAT key is created it will show up in the list.

PAT-overview

Creating a PAT key for Azure Devops Server

Connect to your devops server-> https://devopsserver. Click in the upper right corner on your username and select the Security menu.

security-menu

Once your have selected Security menu you'll see a Personal Access Tokens Menu.

PAT-before

Click on the Add to create a new token. A Pop-up will show up where u can create a PAT token.

PAT-create

Once you're in the creation screen you should give your PAT token a descriptive name so you know what you've created that Token for.

The expiry is the time the token stays valid, here you can specify a specifc date or just select 30 60 or 1 year.

After the expiration you need to reupdate the token or the task won't work anymore.

For this specific task the token needs the following access :

  • Build (Read & Execute)
  • Variable Groups (Read, create, & manage)

You need to select custom defined scopes and should one of those scopes not be available then you need to select Show all scopes.

PAT-overview

Once the PAT is created this is the only time to access the actual key. Here you need to copy the PAT key for later usage.

When the PAT key is created it will show up in the list.

PAT-overview

Creating a Service Connection

Now that you have a PAT token you can create a Service Connection.

A Service Connection can be created through 2 ways :

  • Directly by clicking on the Manage on the Task.
  • By Accessing Project Settings and Selecting Pipelines Service connections.

Both ways will bring you in the Services Connection Settings Menu.

The initial screen will not have any Service Connections or might have already other Service Connections for other services.

ServiceConnections-initial

Here you need to create a new Service Connection to use. Click on the New Service Connection and select a 'Samayas DevOps Endpoint'.

ServiceConnections-create

As connection name you should give a descriptive name to indicate what your Service Connection is going to be used for. The PAT is the secret key that you have created previously.

Then just create the Service Connection.

Once the connection is created this will show up in the list.

ServiceConnections-overview

Use Case

This variable can the be used in conjunction with a second variable to make a full version number

So you have your variable that is updated and is named ex. ProjectBuildNumber. You have a second variable that is defining you major and minor version ex. ProjectPrefixVersionNumber.

Then you have a final variable that will output your full variable ProjectVersionNumber. This variable can then be used throughout your the rest of your tasks as a variable to be used.

variables-task

Remarks: This can be used for Major.Minor.Build. ex 1.0.{ProjectBuildNumber}. The result will be 1.0.23.0

This can also be used for Major.Minor.Build.Revision. ex 1.0.0.{ProjectBuildNumber}. The result will be 1.0.0.23

In the end it's up to you to build the version that you want, this only updates a counter to be used in external variables.

Selecting Service Connection in Task

Once the Service connection is created you can select that service connection in the drop down from the task.

Your configred task will look like this.

configure-task

Target

The goal of this add-in is to manage versioning after building successfully.

Version History

Version 1.0 Initial Version Version 1.1 Release to Public Version 1.1.1 Update Description Version 1.2 Remove depreciated Task Handler Version 2.0 New Logo

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft