Microsoft Azure supports in-place upgrade to Windows Server 2019 and Windows Server 2022. All data, server roles and settings are taken over in the process. For a successful in-place upgrade there are a few requirements.

This guide shows how to successfully perform a direct upgrade to a newer Windows Server version.

Prerequisites and Licensing

Microsoft Azure supports a direct upgrade starting with Windows Server 2012 R2. Earlier versions of the server operating system are not officially supported.

The following upgrade paths are possible:

Source OSWindows Server 2012 R2
Direct upgrade possible toWindows Server 2016
Windows Server 2019
Source OSWindows Server 2016
Direct upgrade possible toWindows Server 2019
Windows Server 2022
Source OSWindows Server 2019
Direct upgrade possible toWindows Server 2022



At least 32 GB free space on the operating system partition.

The virtual server must be hosted on a managed disk.

A snapshot of the operating system disk.
In the event of an unexpected error, the server can be recovered to the initial state with this. The following instructions describe how to create a snapshot:
Create an Azure snapshot of a virtual hard disk – cloudcoffee.ch

In-Place Upgrade Medium

Create upgrade medium using PowerShell

The upgrade medium in the form of a virtual disk contains all the necessary files for a direct upgrade. The following PowerShell script creates the necessary disk.

Source: https://learn.microsoft.com/en-us/azure/virtual-machines/windows-in-place-upgrade?WT.mc_id=modinfra-0000-thmaure#create-upgrade-media-disk

The following parameters in the script should be adjusted to your own needs:

ParameterExplanation
resourceGroupResource group into which the upgrade medium will be created
locationAzure Region for the upgrade medium. DThe Azure region must correspond to the location of the server to be upgraded
zoneAzure Zone in the selected region. This must match the updating server. If the server is not zone-based, the value remains empty
disknameName for the upgrade media
skuWindows Server target version
Possible values are
– “server2022Upgrade”
– “server2019Upgrade”

The PowerShell script creates the necessary upgrade medium.
The managed disk is shown under “Disks.

Attach Upgrade Medium to Virtual Server

The managed disk with the upgrade medium is now attached on the server in the Azure Portal (https://portal.azure.com).

  1. Choose virtual machine
  2. Select “Disks”
  3. Select “Attach existing disks”
  4. Choose disc with upgrade medium
  5. Confirm selection by clicking “Save”

Perform direct upgrade

The direct upgrade is started on the server. A connection via RDP or Azure Bastion to the virtual server is suitable for this purpose.

After logging in, use Explorer to determine the drive letter of the attached upgrade medium. In this example drive E:

Start Windows PowerShell and change to the directory with the setup.exe file on the upgrade medium..

Start upgrade with the following PowerShell command:

The upgrade starts and the target version of the operating system can be selected and installed with “Next”..

Attention: select the same edition as the source server!
(Standard / Datacenter, Desktop Experience / Core)

The upgrade process is started and the server is restarted several times. The RDP connection is interrupted on restart.
Depending on the resources of the virtual server (CPU, RAM, hard disk) this process can take up to an hour.

After completing the direct upgrade, the selected edition is installed and ready to use.

Post upgrade steps

After successfully upgrading the server, the following Azure resources are no longer needed and can be deleted.

Remove snapshot

Delete the snapshot of the operating system disc

Remove upgrade medium

The upgrade files can be deleted. To do this, the managed disk must first be removed from the server. The server does not have to be shut down for this.

After the managed disk is detached from the server, it can be deleted.

Windows Server in place upgrade - delete managed disk

Troubleshooting

Keep files, settings and apps grayed out

When upgrading, the option “Keep files, settings and apps” is grayed out, only “Nothing” can be selected.

The cause is the previously incorrectly selected Windows Server Edition.
The installed Windows Server edition does not match the edition selected for the direct upgrade.
As an example: if the source server is a Windows Server 2019 Datacenter:

the direct upgrade with keeping files, settings and apps are only possible to the same edition. In this example, this is the Windows Server 2022 Datacenter Edition (Desktop Experience).


Follow me on LinkedIn to always stay updated on my recent posts.

Follow on LinkedIn