Azure Devops - Cannot build pipeline agent from vs2017-win2016 to windows-latest

Viewed 2006

After my pipeline is run it gave me the warning below.

##[warning]The windows-2016 environment will be deprecated on November 15, 2021, 
and removed on March 15, 2022. Migrate to windows-latest instead. 
For more details see https://github.com/actions/virtual-environments/issues/4312

After seeing that warning, I tried to change Agent Sepecification from vs2017-win2016 to windows-latest. But there isn't windows-latest option in Agent Specification dropdown.

Agent Specification Dropdown List

So, I thought that i can change it from pipeline yaml file. But I couldn't edit my pipeline on yaml editor. Because the edit page is only shown in UI editor format like below image.

Task Assistant UI

My question is, how can I open pipeline edit page with yaml file format? If this isn't allowed, how can I choose windows-latest option for Agent Specification?

2 Answers

In YAML pipelines there are a few magic agent-pool aliases that keep you on the supported image. windows-latest, ubuntu-latest etc. In UI based pipelines these aliases don't exist, so you'll need to manually pick a newer image.

You can track the evolution of the images on GitHub1, which also lists what images are available and what *latest points at (as of Nov 8th 2021):

list of available images and aliases

1) GitHub Actions and Azure Pipelines use the same underlying image.

Just select any of these in your UI pipeline and hit Save:

Set Agent Specetecation to "windows-2019" in UI based pipelines

The pipeline in your screenshot is not a YAML pipeline, but a Classic pipeline.

Where YAML pipelines enable you to select a *-latest agent specification, these classic pipelines only allow you to select a specific build agent OS.

To migrate from a Classic pipeline to a YAML pipeline, see Migrate your Classic pipeline to YAML .

Related