How can I set ENVIRONMENT status in Azure DevOps yaml pipeline

0 votes

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

  1. Build
    • builds up
    • set build name via VSO command
    • publish artifact
  2. Deploy to DEV
    • download artifact and deploy to the dev environment
  3. 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

when I go to Environments tab the not so updated build name is being displayed.

Pipeline view

How can I change that?

Mar 21, 2022 in Other DevOps Questions by Kichu
• 19,050 points
1,682 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In Other DevOps Questions

0 votes
1 answer

How can I preview PowerPoint files in Azure DevOps (VSTS)?

No, there are no viewers for attachments ...READ MORE

answered Feb 9, 2022 in Other DevOps Questions by Bhavitha
• 1,000 points
383 views
0 votes
0 answers

How to set environment variables in Dockerfile via Azure DevOps

My  environment variables look like this: ENV ACCEPT_EULA=Y ENV ...READ MORE

Apr 12, 2022 in Other DevOps Questions by Kichu
• 19,050 points
3,420 views
0 votes
0 answers
0 votes
1 answer
0 votes
0 answers
0 votes
0 answers

How to set WIP limit in Azure DevOps Board - Sprint View

Is it possible to set WIP limits ...READ MORE

Mar 23, 2022 in Other DevOps Questions by Kichu
• 19,050 points
398 views
0 votes
0 answers

Multiple YAML build pipelines in Azure DevOps

Using the new YAML way I want ...READ MORE

Mar 15, 2022 in DevOps Tools by Kichu
• 19,050 points
920 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP