Azure Devops - 无法构建从 vs2017-win2016 到 windows-latest 的管道代理

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

在我的管道 运行 之后,它给了我下面的警告。

##[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

看到那个警告后,我尝试将 Agent Sepecification 从 vs2017-win2016 更改为 windows-latest。但是代理规范下拉列表中没有 windows-最新选项。

所以,我认为我可以从管道 yaml 文件更改它。但是我无法在 yaml 编辑器上编辑我的管道。因为编辑页面仅以 UI 编辑器格式显示,如下图。

我的问题是,如何打开 yaml 文件格式的管道编辑页面? 如果不允许,我如何选择 windows-Agent Specification 的最新选项?

您屏幕截图中的管道不是 YAML 管道,而是Classic pipeline

在 YAML 管道使您能够 select 一个 *-latest 代理规范的地方,这些经典管道只允许您 select 一个特定的构建代理 OS。

要从经典管道迁移到 YAML 管道,请参阅将您的经典管道迁移到 YAML .

在 YAML 管道中,有一些神奇的代理池别名可以让您使用受支持的映像。 windows-latestubuntu-latest 等。在基于 UI 的管道中,这些别名不存在,因此您需要手动选择更新的图像。

您可以 track the evolution of the images on GitHub1,其中还列出了可用的图像以及 *latest 指向的内容(截至 2021 年 11 月 8 日):

1) GitHub Actions 和 Azure Pipelines 使用相同的底层图像。

只需 select 您的 UI 管道中的任何一个,然后点击 保存: