Azure virtual machine licensing question

Johan Groenewald 126 Reputation points
2022-11-08T19:09:47.107+00:00

Need some helping answering a licensing question please.

I prepared a virtual machine vhd using Hyper-V. I then upload the image to Azure blob storage.
Once uploaded I create an OS disk using said vhd file.

If I use my Azure hybrid benefit the license shows as much after creation. Even shows 49% saving.
If I change the license type to "Windows Server" and "Would you like to use an existing license to NO", the license type shows nothing.

Once I refresh the page the license type shows nothing.
I then go back in to configuration, set license to Windows Server, change use an existing license to NO, save, refresh, license again still shows nothing.
I then use Get-AzVM -ResourceGroup "myResourceGroup" -Name "myVM" and -LicenseType is set to None.

If I use the marketplace to create a VM, the Licensetype in the config page is gone. You just see 2 options. "Would you like to use an existing license Yes/NO ".
If you select yes and refresh it shows as such. If you select No and refresh, it shows as such.

258373-before-refresh.png258431-after-refresh.png

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
7,953 questions
{count} vote

Accepted answer
  1. kobulloc-MSFT 26,341 Reputation points Microsoft Employee
    2022-11-08T23:50:57.323+00:00

    Hello, @Johan Groenewald !

    Why am I not seeing the Azure Hybrid Benefit?
    If you said "no" to using an existing license then you would be declining the Azure Hybrid Benefit and your LicenseType would show as none (which you might want to do if you are leaving your license on-premises). Let me know if you still have questions after my explanation below, but from what you described it sounds like the LicenseType was set to none on creation and needs to be converted if you want to use the Azure Hybrid Benefit (which can be done quickly and easily using the portal, PowerShell, or the CLI).

    How do I use (or switch) the Azure Hybrid Benefit for Windows Server on my VM?
    The Azure Hybrid Benefit allows you to use your existing on-premises Windows Server and SQL Server licenses with active Software Assurance or subscriptions to Azure and save up to 85% compared to standard pay-as-you-go-rates.

    In order to have this benefit on your VM, it needs to be set on creation or you need to convert an existing VM:
    https://learn.microsoft.com/en-us/azure/virtual-machines/windows/hybrid-use-benefit-licensing#ways-to-use-azure-hybrid-benefit-for-windows-server

    Example of creating a VM with the Azure Hybrid Benefit using the CLI:

    az vm create \  
        --resource-group myResourceGroup \  
        --name myVM \  
        --location eastus \  
        --license-type Windows_Server  
    

    If you don't set the Azure Hybrid Benefit on creation, then you'll need to convert the VM after the fact:
    https://learn.microsoft.com/en-us/azure/virtual-machines/windows/hybrid-use-benefit-licensing#convert-an-existing-vm-using-azure-hybrid-benefit-for-windows-server

    Example of converting a VM with to the Azure Hybrid Benefit using the CLI:

    az vm update --resource-group myResourceGroup --name myVM --set licenseType=Windows_Server  
    

1 additional answer

Sort by: Most helpful
  1. Luke Murray 11,091 Reputation points MVP
    2022-11-09T06:29:50.057+00:00

    Its been a while, since I used a custom image - but if the LicenseType is: None - then it should already be PAYG.

    https://learn.microsoft.com/en-us/azure/virtual-machines/windows/hybrid-use-benefit-licensing?WT.mc_id=AZ-MVP-5004796#powershell-1

    Try this, from an elevated command prompt run: cscript c:\windows\system32\slmgr.vbs /dlv

    Does it list the Azure KMS server?

    Take a look at this: https://learn.microsoft.com/en-us/troubleshoot/azure/virtual-machines/troubleshoot-activation-problems#step-2-verify-the-connectivity-between-the-vm-and-azure-kms-service - which is the command to point to the Azure KMS server.

    You can find KMS keys here: https://learn.microsoft.com/en-us/windows-server/get-started/kms-client-activation-keys

    Make sure you monitor the event logs after the change (and have a backup of the server and current state) - to make sure license activation continues.

    1 person found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.