How to enable Azure Hybrid License to save 40% on your Windows License Cost...

Oct 18, 2018 | Tarun Arora

Azure Azure Hybrid Benefit Licensing

Are you using Windows virtual machines in Azure? Do you have any Windows Server Datacenter virtual machines on-premise? If the answer to the first two questions is a yes, readon as you could be eligible to save 40% in compute cost for your virtual machines in Azure! Enterprises starting their digital transformation journey find it hard to justify the ramp up in the cost during the swing period of migrating services to cloud. The Azure Hybrid Benefit helps you get more value from your Windows Server licenses and save up to 40 percent on virtual machines.

Work the numbers - How much can I save?

Let’s take the example of a D4 v2: 8 core, 28 GB Ram, 400 GB SSD.

  • A standrd Windows VM of this series used 730 hours/month will cost you £1300 per month.
  • The same VM with Azure Hybrid licensing will cost you £780 per month.
  • That’s an annual saving of £6,240!

Would you say No to that?

Azure Hybrid Benefits Savings Calculator

In this example we’ve only considered one virtual machine, but if you are doing anything enterprise you’re likely talking about 100’s of VM’s across multiple subscriptions. The cost savings could be substanial… This has helped us save hundred thousands in compute costs for customers doing Azure at scale…

Keep to create a business case…? I would encourage you to use the Azure Hybrid Benfit Savings Calculator

Who is eligible for this offer?

The Azure Hybrid Benefit is available if you own Windows Server Standard or Datacenter edition licenses with active Software Assurance or Windows Server Subscriptions. It is not restricted to any specific licensing program.

Datacenter Edition customers can use licenses both on-premises and in Azure. Standard Edition customers can convert the license; once you assign the Azure Hybrid Benefit to Azure, however, you cannot use the Standard Edition license on-premises.

One windows server datacenter edition license will cover the license cost of 2 virtual machines in the cloud! This means for every one existing license on-premise you can use three virtual machines (one on premise and two in the cloud)…

How to enable Azure Hybrid License on an existing VM?

You can enable Azure Hybrid License by default on existing VM’s during provisioing. Just be sure to mention the license type in your ARM template…

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21

"virtualMachineProfile": {
    "storageProfile": {
        "osDisk": {
            "createOption": "FromImage"
        },
        "imageReference": {
            "publisher": "MicrosoftWindowsServer",
            "offer": "WindowsServer",
            "sku": "2016-Datacenter",
            "version": "latest"
        }
    },
    // Specify the License Type...
    "licenseType": "Windows_Server",
    "osProfile": {
            "computerNamePrefix": "[parameters('vmssName')]",
            "adminUsername": "[parameters('adminUsername')]",
            "adminPassword": "[parameters('adminPassword')]"
    }

The license information for the operating system is persisted in the virtual machine configuration settings. Luckily it’s very easy to update the virtual machine configuration via PowerShell. So if you are looking to update Windows Hybrid Licensing at bulk across your estate use the following PowerShell script…

  • Connect to Azure
1
2
3
4
5
6
# Login to your azure subscription
login-azurermsubscription

# set the context to your azure subscription
set-azurermcontext -subscriptionName 'Production'

  • Get all that don’t use windows hybrid licensing
1
2
3
4
$vms = Get-AzureRMVM 
$vms | ?{$_.LicenseType -ne "Windows_Server"} | select ResourceGroupName, Name, LicenseType

  • Update License Type
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# Get all the resource groups in this subscription
$rgs = Get-AzureRmResourceGroup
 
foreach($rg in $rgs){
 
    # From the resource group, get the resource type virtual machines 
    $resoruces = Get-AzureRmResource 
                    ` -ResourceGroupName $rg.ResourceGroupName 
                    ` -ResourceType 'Microsoft.Compute/virtualMachines'
 
    foreach($res in $resoruces){
       
       # Get the VM object
        $vm = Get-AzureRmVM 
                ` -ResourceGroupName $rg.ResourceGroupName 
                ` -Name $res.Name
 
        # Assign the machine to use 'Windows_Server' license type
        # This license type applies Azure Hybrid Benefits
        $vm.LicenseType = 'Windows_Server'

        # Update the VM configuration
        Update-AzureRmVM -ResourceGroupName $rg.ResourceGroupName -VM $vm
    }
}

Azure Hybrid - Windows Server License

Next Steps…

Now if you are wondering how you make your Azure Virtual Machines run faster, then check out my post on Accelerated Networking on Azure….

Summary

This is a great differentiator from Microsoft… None of the other cloud providers are offering something compelling. If you are already using Windows, take benefit of this offer to accelerate your move to the Microsoft cloud.

Tarun

About author
Author Image
Tarun Arora
Tarun Arora is obsessed with high-quality working software, DevOps, Continuous Delivery and Agile. His core strengths are Azure, VSTS, PowerShell, SQL and WPF. He is a Microsoft MVP in Visual Studio Development Tools and the author of 'DevOps & ALM with TFS 2015'.
Comments