How to Enable Azure Hybrid Benefit for Windows Server via Azure Portal and Powershell
Articles,  Blog

How to Enable Azure Hybrid Benefit for Windows Server via Azure Portal and Powershell


Azure Hybrid Benefit for Windows server allows you to
use your on premises Windows server licenses and run Windows virtual machines in
Azure at a reduced cost. You can use your licenses
for Windows Server 2008 R2, Windows Server 2012, 2012 R2, and Windows Server 2016. The Azure Hybrid Benefit for Windows Server is applicable to Windows Server standard and data center additions as well as other versions obtained
via custom images.>>With Azure Hybrid benefit
for Windows Server, you can save up to
49% on Windows Server virtual machines by paying
only the base Compute Rates, adding value to
your software assurance investments and if you combine this benefit with Azure reserved instances you can save up to 80% percent in total. Azure Hybrid Benefit makes Azure the most cost effective
cloud destination for your Windows Server
virtual machines and this benefit is available
across all Azure regions.>>In this video, we’ll
look at how to use the Azure portal to enable
the Azure Hybrid Benefit for Windows Server on new and existing Azure virtual machines and then we’ll look at how to use PowerShell to enable Azure Hybrid Benefits across multiple virtual
machines at once. So, let’s take a look at
how to use the Azure portal to enable Azure Hybrid Benefit
on a new virtual machine. I go through
the normal process of creating a Windows
virtual machine. I’m going to use Windows Server
2016 but again it can be any version from 2008 R2. When I start to create
that virtual machine I fill out the fields and
you’ll notice there’s a section here at the bottom that asks you if you already
have a Windows license. Go ahead and say yes
confirm it and that’s it. As you complete creating
the virtual machine it will automatically add that Azure Hybrid Benefits
to the virtual machine. That’s the process for enabling
Azure Hybrid Benefits on a new virtual machine from
the Azure marketplace. Now, let’s say you’ve brought a virtual machine from on prem
or from another provider. The process for enabling Azure Hybrid Benefit
is very much the same. Let’s go to my set of images now. I’ve already uploaded
an image from my on premises servers into Azure virtual machine image
and now I want to create a new virtual
machine in Azure from that image but I want to still use the Azure
Hybrid Benefit. I find the image in the list of images and I say I want to
create a VM from this image. And again the system
will come up in the with the create
virtual machine wizard or fill out the forms
and it will also have the sections here that says do I already have a windows license. I say yes. I tell it what my Windows server or
Windows client and that will enable Azure
Hybrid Benefit on that new virtual machine that you’ve brought
from on premises. You can also use
the Azure portal to enable Azure Hybrid Benefits on VMs that you already
have running in Azure. In this screen, I have a list of virtual machines
in this subscription. I want to find out
which virtual machines have Azure Hybrid Benefit
enabled and which do not. Lets edit the columns that are visible and lets expose
the azure hybrid benefit column. That allows me to quickly see that
none of the windows virtual machines in
this subscription have Azure Hybrid Benefit
applied to them. Let’s go ahead and turn it on on one of these virtual machines. I’m going to click to see
the details on one of my virtual machines and go
to the configuration tab. The configuration tab
has the option to enable Azure Hybrid Benefit for
that particular virtual machine. I’ll say yes, confirm that I have the appropriate
licenses available through my software
assurance and hit save. Once the system has successfully enabled Azure Hybrid Benefit, I should be able to go back to my list and see that indeed yes Azure Hybrid Benefit has been applied to that virtual machine. We used the Azure
portal to enable Azure Hybrid Benefit on virtual
machines individually but it’s helpful to use
something like PowerShell or some other scripting
language to enable Azure Hybrid Benefit across many virtual machines at once. I’m going to open
the Azure Cloud Shell. Now, the Azure Cloud
Shell opens up a PowerShell or
bass session inside the Azure portal but of course you can also use your local
PowerShell session as well. We’re first going
to tell PowerShell which subscription we
want to do work on. Let’s see how we use
PowerShell to see which virtual machines have Azure Hybrid Benefit
enabled and which do not. This command says for
this subscription, let’s look at all the
virtual machines where the operating system is windows and the license type
is not Windows Server, it does not have
the Azure Hybrid Benefit applied and you’ll see it
came back and say here are the four virtual machines and this subscription that do not and of course that matches
what we see in the portal. Now that we see which virtual machines do not have Azure Hybrid
Benefit applied, we can write a script to enable it on
all those virtual machines. This bit of PowerShall here says, for each virtual
machine that does not have Azure
Hybrid Benefit applied, go ahead and set
the license type to Windows Server and update the virtual machine to apply it. There we go. Once that command is completed you’ll see that the Azure Hybrid Benefit has been applied to all the
applicable machines in that subscription and of course we can refresh the Azure portal and see the changes have been
applied there as well. Visit this URL to learn more about Azure
Hybrid Benefit for Windows Server and how to enable it in your subscription.
Thank you.

Leave a Reply

Your email address will not be published. Required fields are marked *