How to add, remove, and use build tags
Azure DevOps Services | Azure DevOps Server 2022 | Azure DevOps Server 2020
Build tags in Azure DevOps let you categorize and organize your builds. Tags make it easier to filter and search for specific builds. In this article, learn how to add, remove, and use build tags in Azure DevOps.
Prerequisites
An Azure DevOps organization and access to a project where you are a member of the Contributors group.
Add a build tag to a completed build
To add a tag to a completed build:
Open your Azure DevOps project and go to Pipelines.
Select the pipeline where you want to add a tag.
Select More actions and choose Add tags to add your first tag or Edit tags if you have an existing tag.
Enter a tag name (example: contoso).
Press Enter to save the tags.
Remove a build tag
To remove build tags from your builds in Azure DevOps, follow these steps:
Open your Azure DevOps project and go to Pipelines.
Select the pipeline where you want to remove a tag.
Select More actions and choose Edit tags.
Select the X next to the tag name to remove your tag.
Press Save to save the changes.
Add a build tag to a future build
To add a build tag to a build in a YAML pipeline, use the addbuildtag
logging command.
In the following example a new tag gets added in a script task with a variable that includes the current date.
steps:
- script: |
last_scanned="last_scanned-$(date +%Y%m%d)"
echo "##vso[build.addbuildtag]$last_scanned"
displayName: 'Apply last scanned tag'
Filter with a build tag
Once you have added build tags to your builds, you can use them to filter and search for specific builds. To use build tags in Azure DevOps, follow these steps:
Open your Azure DevOps project and go to Pipelines.
Select Runs tab.
In the filter bar, select the tag that you want to filter by.
Azure DevOps will filter the builds based on the specified tag, allowing you to find the runs you need.