I have build that is used as release pipeline written in yaml. It takes resources out of the build pipeline and deploys it to an environment.
Build details after running update build task
Inside the build I'm runnig this task that is able to change build number.
##vso[build.updatebuildnumber]$versionValue
However in the env view it shows build number in default format #20230131.3 on BuildName
If I run this request:
$releaseUri = "https://dev.azure.com/$($organization)/$($project)/\_apis/build/builds/4577?api-version=7.0"
Invoke-RestMethod -Uri $releaseUri -Method Get -ContentType "application/json" -Headers @{Authorization=("Basic {0}" -f $base64AuthInfo)}
I'm getting correct build number
buildNumber : rel-2023.1.30-4448-7a8e9f4
But why it is not shown on environment overview for a given deployment?
I tried updating manually buildNumber
[$updateBuildUri = "https://dev.azure.com/$($organization)/$($project)/_apis/build/builds/4595?api-version=7.0"
$body = "{
`"buildNumber`": `"Adam1234`"
}"
Invoke-RestMethod -Uri $updateBuildUri -Method PATCH -ContentType "application/json" -Headers @{Authorization=("Basic {0}" -f $base64AuthInfo)} -Body $body][1]
but without any results at the environment view.