Ask Learn
Preview
Please sign in to use this experience.
Sign inThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Azure uses the following KMS endpoints for Windows product activation of Azure Virtual Machines:
Azure VMs will activate using the Azure KMS service if all of the following are true:
Windows activation works the same way regardless if the VM is using Azure Hybrid Use Benefit (HUB) or not.
Note that while using an Automatic Virtual Machine Activation (AVMA) key may work on some Azure VMs, the use of AVMA keys is not supported because not all Azure hosts are guaranteed to support it. So while it may work initially, when the VM moves to a different Azure host when deallocated and started, when the Redeploy option is used, or when planned maintenance occurs, it may end up on an Azure host that does not support AVMA.
Run slmgr.vbs /dlv from within the VM to check #1 and #2 above. In the example below, VOLUME_KMSCLIENT is what tells you a KMS client setup key was used, and Registered KMS machine name: kms.core.windows.net:1688 is what confirms that it is configured to activate against the Azure KMS service. Note that the KMS endpoint differs for public versus national cloud regions as listed at the beginning of this article.
C:\>cscript c:\windows\system32\slmgr.vbs /dlv
Microsoft (R) Windows Script Host Version 5.812
Copyright (C) Microsoft Corporation. All rights reserved.
Software licensing service version: 10.0.14393.351
Name: Windows(R), ServerDatacenter edition
Description: Windows(R) Operating System, VOLUME_KMSCLIENT channel
Activation ID: 21c56779-b449-4d20-adfc-eece0e1ad74b
Application ID: 55c92734-d682-4d71-983e-d6ec3f16059f
Extended PID: 03612-03764-000-000000-03-1033-14393.0000-1642017
Product Key Channel: Volume:GVLK
Installation ID: 009858430382850574122213203392636030969202304948320740858134404
Partial Product Key: 8XDDG
License Status: Licensed
Volume activation expiration: 258206 minute(s) (180 day(s))
Remaining Windows rearm count: 1000
Remaining SKU rearm count: 1000
Trusted time: 6/14/2017 6:24:25 PM
Configured Activation Type: All
Most recent activation information:
Key Management Service client information
Client Machine ID (CMID): 54653727-addd-4b5f-bde9-824359786b75
Registered KMS machine name: kms.core.windows.net:1688
KMS machine IP address: 23.102.135.246
KMS machine extended PID: 06401-00206-001-010007-03-1033-9600.0000-2322016
Activation interval: 120 minutes
Renewal interval: 10080 minutes
KMS host caching is enabled
If slmgr.vbs /dlv shows RETAIL channel, run the following commands to set the KMS client setup key for the version of Windows Server 2016 being used, and force it to retry activation.
cscript c:\windows\system32\slmgr.vbs /ipk <KMS client setup key>
cscript c:\windows\system32\slmgr.vbs /ato
For example, for Windows Server 2016 Datacenter, you would run:
cscript c:\windows\system32\slmgr.vbs /ipk CB7KF-BWN84-R7R2Y-793K2-8XDDG
This step is not necessary for VMs created from the Windows Server 2016 gallery image, as the gallery image has the appropriate KMS client setup key already configured.
For activation issues involving Windows Server 2016 VMs failing to activate despite having the KMS client setup key configured, or for activation issues with Azure VMs using other versions of Windows, please review the remaining steps below.
Windows VMs should be configured with the KMS client setup key for the version of Windows being used, and have connectivity to port 1688 at kms.core.windows.net in order to activate successfully.
If you are using site-to-site VPN with forced tunneling, please see Use Azure custom routes to enable KMS activation with forced tunneling.
If you are using ExpressRoute with a default route published, please see Azure VM may fail to activate over ExpressRoute.
If your Azure VM experiences Windows activation failures, please try the following steps to resolve the issue. An example of an error message you may see is:
Error(s): Activating Windows(R), ServerDatacenter edition
Error: 0xC004F074 The Software Licensing Service reported that the computer could not be activated. No Key Management Service (KMS) could be contacted. Please see the Application Event Log for additional information.
Note that when the grace period has expired and Windows is still not activated, Windows Server 2008 R2 and later versions of Windows will show additional notifications about activating, the desktop wallpaper remains black, and Windows Update will install security and critical updates only, but not optional updates. See also the Notifications section at the bottom of the Licensing Conditions TechNet page.
Steps to Troubleshoot Activation
If you are still unable to activate after attempting the above steps, let us know in the comments or contact Azure support.
Anonymous
December 23, 2014
The comment has been removed
Anonymous
December 24, 2014
HI Dave,
With a vanilla environment, it doesn't sound like you have ExpressRoute configured, but if you do, make sure you have public peering enabled if you are advertising a default route. I've updated the blog post with that information.
Otherwise, since the VMs are 2012 R2 Datacenter, you can run these commands to use the AVMA key:
iex "$env:windirsystem32cscript.exe $env:windirsystem32slmgr.vbs /ipk Y4TGP-NPTV9-HTC2H-7MGQ3-DV4TW"
iex "$env:windirsystem32cscript.exe $env:windirsystem32slmgr.vbs /ato"
Or to run them from elevated CMD instead of PowerShell:
%windir%system32cscript.exe %windir%system32slmgr.vbs /ipk "Y4TGP-NPTV9-HTC2H-7MGQ3-DV4TW"
%windir%system32cscript.exe %windir%system32slmgr.vbs /ato
Also, the step to loop the activation attempt multiple times has worked for many customers when a single manual activation attempt, and Windows own automatic attempts every 2 hours - did not work. So make sure you have tried that. We continue to investigate the issue internally, since activation should be automatic and should not require a manual attempt, let alone multiple manual attempts.
1..12 | % { iex "$env:windirsystem32cscript.exe $env:windirsystem32slmgr.vbs /ato" ; start-sleep 5 }
Thanks,
Craig
Anonymous
December 24, 2014
I did let that other script run 12 times as specified, but it failed each time. I did it a few times on multiple VMs, vNets, Cloud Services and Geographies and they all had the same issue.
Fortunately, the AVMA key worked as you described and I can move forward with confidence that I won't have to redo this work. Thanks for taking the time to answer.
Anonymous
December 24, 2014
HI Dave,
We did make a change just yesterday to address this issue of unexpected activation failures, so I suspect if you had retried the normal method today (slmgr.vbs /ato), it would have worked.
Sorry for the frustrating experience, but glad you got it working and hope you have a good holiday.
Thanks,
Craig
Anonymous
December 28, 2014
I too am having the same problem with my VM. However, msinfo reports that the OS is Windows Server 2012 Datacenter, but NOT R2. Could that be why the product key above isn't working like it did for Dave?
Nathan
Anonymous
December 28, 2014
The comment has been removed
Anonymous
December 29, 2014
The comment has been removed
Anonymous
December 29, 2014
Step 6 speaks to Windows Server 2012 R2. What are the steps for 2012 R1 as I am running into that issue on R1?
Also to Brian Rota's point why do you need to pay for support to spin up a server?
Anonymous
December 29, 2014
What we apparently need is the Azure key to vanilla Windows Server 2012 datacenter. So how about it support team?
Anonymous
December 29, 2014
MS confirmed KMS issues going on. No work around at this time. I have suggested they add the KMS Server to their Services Dashboard given everything looks green and yet they have issues going on at least a week.
Anonymous
December 30, 2014
The comment has been removed
Anonymous
December 30, 2014
for
Windows Server 2012 Datacenter use in CMD
%windir%system32cscript.exe %windir%system32slmgr.vbs /ipk "48HP8-DN98B-MYWDG-T2DCC-8W83P"
Anonymous
December 30, 2014
Found that key already on TechNet and used it. Still getting Key Server not located.
Anonymous
December 30, 2014
To be clear, expected behavior for Azure VMs regardless of Windows version is that they will automatically activate and do not require a product key be manually entered.
The product key method, which has been suggested only as a troubleshooting step due to the current issue with KMS activation, only works for 2012 R2. It does not work for 2012 or 2008 R2. That is because it is using the Automation Virtual Machine Activation (AVMA) feature that is 2012 R2-only.
The PowerShell command was suggested as an easy way to retry activation quickly multiple times, which we have seen work for the current issue that is being investigated. But it is no different than running cscript.exe %windir%system32slmgr.vbs /ato several times in a row.
We apologize for the delay in getting this issue fully resolved so that all Windows versions automatically activate.
Azure technical support options are detailed on the following page:
azure.microsoft.com/.../options
Anonymous
January 28, 2015
Hello, I signed up with Azure Portal and provided my credit card info. After half an hour, i got an email saying that the system refused my application. Please help me with this. What do i need to do to open an Aruze account of Microsoft ? Thanks ( TraceyN2015@hotmail.com )
Anonymous
February 01, 2015
Hi Tracy,
This page outlines the Azure support options.
azure.microsoft.com/.../options
Thanks,
Craig
Anonymous
August 13, 2015
MSDN Windows 10 Enterprise RTM gallery images won't activate. Any help is appreciated. Was unable to use the support portal since I don't have the information that it is asking for to link to MSDN.
Anonymous
December 16, 2015
If you just created a new Windows 2012 R2 Azure VM and you are bugged by the fact that it says " Windows is not activated" - then just activate with the Datacenter Key used in this post : "W3GGN-FT8W3-Y4M27-J84CP-Q3VJ9". Issue resolved! If you are using "forced Tunneling" including the use of express routes - then clearly there are more ongoing issues as stated above.
Please sign in to use this experience.
Sign in