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 in Other DevOps Questions by Kichu
• 19,040 points
945 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 in Other DevOps Questions by Bhavitha
• 1,000 points
127 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 in Other DevOps Questions by Kichu
• 19,040 points
1,761 views
0 votes
0 answers
0 votes
1 answer
0 votes
0 answers
0 votes
0 answers
0 votes
0 answers
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