Introduction

Azure DevOps provides an option to use Self-hosted or Microsoft-hosted agents. With Microsoft-hosted agents, maintenance and upgrades are taken care of for you. Each time you run a pipeline, you get a fresh virtual machine for each job in the pipeline. The virtual machine is discarded after one job. Microsoft-hosted agents can run jobs directly on the VM or in a container.

Azure Pipelines provides a pre-defined agent pool named Azure Pipelines with Microsoft-hosted agents. Since Microsoft takes care of the images and the maintenance, this also needs to be up to date with the latest releases and requirements.

Microsoft-hosted Pipelines provides images for the 2 latest versions of macOS, Windows & Ubuntu. In this blog post I want to update you on recent and upcoming changes for each of those operating systems. If you have pipelines that use ubuntu-16.04macOS-10.14macOS-latestvs2017-win2016, or windows-latest, you will be impacted and this post contains important information for you to read.

macOS

macOS 11 Big Sur is the current version of macOS. To make room for the upcoming demand for macOS, Microsoft is deprecating macOS-10.14 images. In YAML Pipelines, you can update the pipeline by editing the YAML as below. This is just a sample to show the vmImage version that can be used :

jobs:
- job: macOS11
  pool:
    vmImage: 'macOS-11'
  steps:
  - bash: |
      echo Testing macOS-11
      sw_vers
- job: macOSlatest
  pool:
    vmImage: 'macOS-latest'
  steps:
  - bash: |
      echo hello from the latest version of macOS available
      sw_vers

Note: Image macOS-latest will reference image macoS-11 soon.

Ubuntu

When using ubuntu-latest Azure pipelines now uses Ubuntu 20.04. Microsoft is also supporting Ubuntu 18.04 with the ubuntu-18.04 image. In YAML Pipelines, you can update the pipeline by editing the YAML:

jobs:
- job: ubuntu2004
  pool:
    vmImage: 'ubuntu-20.04'
  steps:
  - bash: |
      echo Hello from Ubuntu 20.04
      lsb_release -d
- job: ubuntulatest
  pool:
    vmImage: 'ubuntu-latest'
  steps:
  - bash: |
      echo Hello from the latest version of Ubuntu available
      lsb_release -d

Important: Microsoft is removing ubuntu-16.04 soon, as planned.

Windows

Recently, Microsoft made Windows 2022 available as a pipeline image. Specify windows-2022 to use this image. The sample YAML below shows the available Windows images:

- job: 'windows2022'
  displayName: 'windows-2022 image'
  pool:
    vmImage: 'windows-2022'
  steps:
  - pwsh: |
      Write-Host "hello from Windows 2022 with Visual Studio 2022"
      Get-ComputerInfo | Select-Object WindowsProductName

- job: 'windowslatest'
  displayName: 'windows-latest image'
  pool:
    vmImage: 'windows-latest'
  steps:
  - pwsh: |
      Write-Host "hello from the latest version of Windows available"
      Get-ComputerInfo | Select-Object WindowsProductName

Important: With the upcoming end of mainstream support on Windows 2016 in January 2022, Microsoft is deprecating vs2017-win2016 images starting November 15. Retirement is planned for March 2022.

I understand this may impact your pipelines and you might look for the possible solutions. If you are using vs2017-win2016 these are options to move forward:


– Start using the windows-2019 image. This image contains most of the tools (e.g. .NET Framework versions) currently available on vs2017-win2016.
– In many cases, your apps can be migrated to build on a newer version of Visual Studio with minimal effort.

Finding impacted pipelines

To identify pipelines that are using a deprecated (e.g. vs2017-win2016) image, you can check the following location:
https://dev.azure.com/{organization}/{project}/_settings/agentqueues

Then, filter on the image name:

Image pool filter

You can also query job history for deprecated images across projects using the script located here. You can download this script and run below Powershell command:

./QueryJobHistoryForRetiredImages.ps1 -accountUrl https://dev.azure.com/{org} -pat {pat}