'Azure Windows Server license not activated [closed]

I have spun up a Windows Server Datacenter 2019 image on Azure. When I go to the Activation screen in Settings, it shows that Windows is not activated. How do I activate Windows? Do I need to buy a server license?

I just created a new VM. I log into the server using RDP, and check if the machine is activated. It isn't. The error is:

We can't activate Windows on this device as we can't connect to your organization's activation server. Make sure you're connected to your organization's network and try again. If you continue having problems with activation, contact your organization's support person. Error code: 0xC004F074. Then I try to hit the Troubleshooting box: Troubleshooting has completed: We can't activate Windows. Make sure you're connected to the Internet.



Solution 1:[1]

The server doesn't seems to be able to connect to Microsoft's KMS servers. To verify if that is the case run the following from Powershell:

Invoke-Expression "$env:windir\system32\cscript.exe $env:windir\system32\slmgr.vbs /skms kms.core.windows.net:1688"

Test-NetConnection kms.core.windows.net -Port 1688

enter image description here

TcpTestSucceeded must be True , if false then your VM can't reach the KMS and therefore not activate it. So test and see if your VM can reach kms.core.windows.net on port 1688.

Solution 2:[2]

There is another known issue where setting the Azure hosted VM to any time zone other then UTC +00 will cause the Settings app to show the VM as not being activated, but if you run the activation command via sconfig the VM is activated fine, the GUI will persist that the VM is not activated however.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Jarnstrom
Solution 2 Blue Nova