Skip to content

Commit e7d1f57

Browse files
committed
edits
1 parent c0ea19b commit e7d1f57

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

docs/pipelines/process/run-number.md

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ ms.topic: conceptual
55
ms.assetid: 7C469647-117D-4867-B094-8BC811C0003E
66
ms.date: 08/11/2025
77
monikerRange: "<=azure-devops"
8+
#customer intent: As an Azure Pipelines customer, I want to understand the composition of run numbers so I can customize them to be more meaningful and useful for my team.
89
---
910

1011
# Run and build numbers
@@ -13,7 +14,7 @@ monikerRange: "<=azure-devops"
1314

1415
Azure Pipelines assigns a unique run number, also called a build number, to identify each execution of a pipeline or build. This article explains the structure of these numbers and how you can customize them to be more meaningful for your team.
1516

16-
If you don't specify a build name in YAML pipelines, or you leave the **Build number format** field blank in Classic pipelines, each run gets a unique integer as its name. You can use a combination of naming patterns, tokens, and variables to give runs more useful names.
17+
If you don't specify a build name in YAML pipelines, or you leave the **Build number format** field blank in Classic pipelines, each run gets a unique integer as its name. Build names can use a combination of tokens, variables, and underscore characters. You can use naming patterns, tokens, and variables to give runs more useful names.
1718

1819
::: moniker range=">=azure-devops-2020"
1920

@@ -42,18 +43,21 @@ If the previous build number was **MyBuild_20230621.1**, the next build number t
4243

4344
`$(Rev:r)` also resets to `1` if you change the version. If your build format is `1.0.$(Rev:r)` and your last build number was **1.0.3**, if you change the version to `1.1.$(Rev:r)`, the next build number is **1.1.1**.
4445

45-
For example, if you specify the build number format `$(TeamProject)_$(Build.DefinitionName)_$(SourceBranchName)_$(Date:yyyyMMdd).$(Rev:r)`, the second run on May 6, 2024 is named **Fabrikam_CIBuild_main_20240506.2**.
46+
For example, if you specify the following build number format, the second run on May 6, 2024 is named **Fabrikam_CIBuild_main_20240506.2**.
47+
48+
```yaml
49+
$(TeamProject)_$(Build.DefinitionName)_$(SourceBranchName)_$(Date:yyyyMMdd).$(Rev:r)
50+
```
4651

4752
The build number tokens resolve as follows:
4853

4954
- Project name: **Fabrikam**
5055
- Build definition name: **CIBuild**
5156
- Branch: **main**
52-
- Build/run ID: **752**
5357
- Date: **May 6, 2024**
5458
- Run number for that day: **2**
5559

56-
### Tokens
60+
### Run number tokens
5761

5862
The following table shows how run number tokens resolve. You can use these tokens only to define run numbers. They don't work anywhere else in a pipeline.
5963

@@ -79,13 +83,13 @@ The following table shows how run number tokens resolve. You can use these token
7983
>
8084
>However, if you use a zero-padded `Rev` as part of a version numbering scheme, some pipeline tasks or popular tools like NuGet packages remove the leading zeros. This behavior causes a version number mismatch in the artifacts that the build produces.
8185

82-
### Expressions
86+
### Expressions in run numbers
8387

84-
If you use an expression to set the build number, you can't use `$(Build.BuildId)`, `$(Build.BuildUri)`, or `$(Build.BuildNumber)` tokens, because their values aren't set at the time pipeline expressions are evaluated.
88+
If you use an expression to set the run number, you can't use the `$(Build.BuildId)`, `$(Build.BuildUri)`, or `$(Build.BuildNumber)` tokens, because their values aren't set at the time pipeline expressions are evaluated.
8589

86-
### Variables
90+
### Variables in run numbers
8791

88-
You can use both predefined and user-defined variables in your build number. For example, if you define `My.Variable`, you can specify the following number format. The first four variables are predefined.
92+
You can use both predefined and user-defined variables in your run number. For example, if you define `My.Variable`, you can specify the following number format. The first four variables are predefined.
8993

9094
```yaml
9195
$(Build.DefinitionName)_$(Build.DefinitionVersion)_$(Build.RequestedFor)_$(Build.BuildId)_$(My.Variable)

0 commit comments

Comments
 (0)