1 minute read

I released a new version of the "Version number counter" extension for Azure DevOps this week. The "Version number counter" extension for Azure Pipelines is an extension that automatically increments a version number on each run. 

With this new version, I added another great feature. This addition includes the support of the build identity. By using the build identity, you do not have to specify a Personal Access Token for the authentication, but the authentication goes via OAuth of the build identity.

How to use the extenstion

After installing the extension, the extension can be made available within your pipeline via the UI or your favorite IDE.

Permissions

Specific permissions are required for both options (OAuth or PAT) to increment the version variable.

OAuth

When using the OAuth system token. The build identity: Project Collection Build Service ({OrgName}) should have the "Edit build pipeline" permissions on the pipeline.

Personal Access Token

The minimal permissions required for a PAT are:

  • Build: Read & Execute

Classic

When using the classic pipelines, drag the extension to the pipeline and configure it correctly.


When using the OAuth token, ensure that the "Allow scripts to access the OAuth token" is configured on the agent job.

Yaml

The below snippet represents how to use the extension in YAML and make sure that it can use the OAuth token of the build identity.

- task: versioncounter@2
  inputs:
    VersionVariable: 'versionnumber'
    UseSystemAccessToken: true
  env:
      SYSTEM_ACCESSTOKEN: $(System.AccessToken)

When you would like more information about job authorizations and the use of the build identity, take a look at the below article: