For a Windows virtual machine from the Azure Marketplace to activate it needs to be able to do the following:

1, Contact the relevant Azure KMS endpoint on port 1688

  • Azure public cloud regions – kms.core.windows.net:1688
  • Azure China national cloud regions –  kms.core.chinacloudapi.cn:1688
  • Azure Germany national cloud regions – kms.core.cloudapi.de:1688
  • Azure US Gov national cloud regions – kms.core.usgovcloudapi.net:1688

2, The Machine must activate via an Azure External IP address, i.e if you route all internet traffic back down to an on premises environment this will stop Windows Activation within Azure

If you are experiencing the below error when activating your Windows Azure VM:

 We can’t activate Windows on the 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 please look at the first 2 checks in the article to start your troubleshooting.