Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Azure DevOps Services | Azure DevOps Server 2022 | Azure DevOps Server 2020
Build tags in Azure DevOps help you categorize and organize your builds, making it easier to filter and locate specific builds. This guide walks you through adding, removing, and using build tags as part of your build management process.
Prerequisites
An Azure DevOps organization and access to a project where you're a member of the Contributors group.
Add a build tag to a completed build
Azure Pipelines UI
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 (for example, contoso).
Press Enter to save the tag.
Azure DevOps CLI
To create a build tag, use the az pipelines build tag add command.
For example, the following command creates a build tag named prod
in the contoso
organization and webapp
project for the build 1234
.
az pipelines build tag add --build-id 1234
--tags prod
--org https://dev.azure.com/Contoso/
--project contoso
Output:
[
"prod"
]
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 automatically add a build tag to a future build in a YAML pipeline, use the addbuildtag
logging command.
In the following example, a new tag is 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've 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 you want to filter by.
Azure DevOps filters the builds based on the specified tag, letting you find the runs you need.