Skip to content

Instantly share code, notes, and snippets.

@almmechanics
Last active July 8, 2020 12:11
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save almmechanics/f523b463d147c3c817f9aa3e2bfeeaab to your computer and use it in GitHub Desktop.
Save almmechanics/f523b463d147c3c817f9aa3e2bfeeaab to your computer and use it in GitHub Desktop.
Azure DevOps Build/Release pipeline naming patterns

Naming Patterns for Azure DevOps Build and Release Pipelines

The following are some 'good' patterns within Azure DevOps to allow visibility within Build and Release pipeline. They are not a replacement for symver but could easily be incorporated to increase visibility.

Current Problem

The defaults for AzureDevOps for naming only refer to the Build number without a context - this makes traceability difficult if you wish to use any of the built in reporting.

Build Pipelines

Modify the Build template in the Options tab:

Change the 'Build number format' to give a context for the build, e.g.

 $(TeamProject)_$(BuildDefinitionName)_$(SourceBranchName)_$(Date:yyyyMMdd)$(Rev:.r)

This example will create a build number that contains the following:

  • Azure DevOps Team project name
  • Build definition name
  • Source repository
  • Branch of repository
  • Build Date
  • Instance of builds that day

Additional Tagging of Git resources

If you intend to use git tagging to indicate a successful build then apply the following to the build definition.

On the 'Get Sources' option of the build the 'Tag Format' to be:

 $(Build.BuildNumber)

This will then use the same build number in the git tagging.

Note: Do not use spaces in the build definition names as Git Tagging does not support this and the associated error messages are not easy to decipher.

Release Pipelines

To allow visibility of the build numbering within the release pipeline, then add the following to the Options tab of the Release Definition:

 Release $(Rev:rrr) for build $(Build.BuildNumber)

This example will create a release number that contains the following:

  • Release revision
  • Build number of primary artefact

Azure DevOps Dashboard for release

By using the 'Deployment Status' Widget in a Dashboard it is possible to list the releases by environment and their current status.

To configure the 'Deployment Status' widget to show the status of each environment apply the following settings:

Field Configuration
Build Pipeline < build definition>
Branch Default branch in build pipeline
Linked release pipelines Release definition and environments that use < build definition>
Last Column Latest deployed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment