Views:
 Please take into consideration that these steps will need a restart of the machine causing a downtime.
 
  1. On your VM, please open CMD as administrator
  2. Run the command "slmgr /skms azkms.core.windows.net:1688 “. This is to be sure that your VM is connected to the Key Management Service (KMS). If it works, it should show a message as the following.
 
 
image
 
  1. Run the command “ slmgr /ipk NTBV8-9K7Q8-V27C6-M2BTV-KHMXV ” .This is to activate your Windows, in this case the key is specifically for Windows Server 2022 Datacenter Azure Edition but if you have another OS on the VMs you can refer to this link to see the other keys for Azure VMs different Windows OS versions. If it works, it should show a message as the following.
 
 
image
 
  1. If the last command shows an error please run the command “ slmgr /ato ” . If it works, it should show a message as the following.
 
 
image
 
  1. If the previous steps didn’t work please run the command “ c:\windows\system32\slmgr.vbs /ato ”
 
 
image
 
  1. Finally restart your VM