I am creating a CICD pipeline in Azure DevOps. I have a pipeline that has a name set dynamically.
name: 'Set dynamically below in a task'
Then in BUILD stage I update it
[string] $date = (Get-Date -Format 'yyyyMMdd')
[string] $projectVersion = (Get-Content 'version.json') -join "`n" | ConvertFrom-Json | Select -ExpandProperty "version"
[string] $buildName = "$projectVersion.$(Build.BuildId)+$date.API"
Write-Host "##vso[build.updatebuildnumber]$buildName"
I have currently 3 stages
- Build
- builds up
- set build name via VSO command
- publish artifact
- Deploy to DEV
- download artifact and deploy to the dev environment
- Deploy to TEST
- download artifact and deploy to test environment
I am actually using ENVIRONMENT within Azure DevOps to track all deployments and here is the problem. While pipeline build number is updated properly in Pipelines view
![Pipelines view](https://i.stack.imgur.com/4yLj7.png)
when I go to Environments tab the not so updated build name is being displayed.
![Pipeline view](https://i.stack.imgur.com/FhOeF.png)
How can I change that?