Azure Hybrid Benefit for Red Hat Enterprise Linux (RHEL) and SUSE Linux Enterprise Server (SLES) virtual machines
What is Azure Hybrid Benefit?
Azure Hybrid Benefit (AHB) for Linux lets you easily switch the software subscription model for your VM. You can remove licensing cost by bringing your Red Hat and SUSE Linux subscriptions directly to Azure, or utilize a model where you pay for subscriptions as you use them. This article defines 'BYOS' and 'PAYG' licensing models, compares the benefits of each model, and shows how you can use the Azure Hybrid Benefit to switch between the two at any point. This process applies to Virtual Machine Scale Sets, Spot Virtual Machines, and custom images. It allows for seamless bi-directional conversions between the two models.
Customers may see savings estimated to up to 76% with Azure Hybrid Benefit for Linux. Savings estimates are based on one standard D2s v3 Azure VM with RHEL or SLES subscription in the East US region running at a pay-as-you-go rate vs a reduced rate for a 3-year reserved instance plan. Based on Azure pricing as of October 2022. Prices subject to change. Actual savings may vary based on location, instance type, or usage.
Defining Pay-as-you-go (PAYG) and Bring-your-own-subscription (BYOS)
In Azure, there are two main licensing pricing options: 'pay-as-you-go' (PAYG) and 'bring-your-own-subscription' (BYOS). 'PAYG' is a pricing option where you pay for the resources you use on an hourly or monthly basis. You only pay for what you use and can scale up or down as needed. On the other hand, 'BYOS' is a licensing option where you can use your existing licenses for certain software, in this case RHEL and SLES, on Azure virtual machines. You can use your existing licenses and don't have to purchase new ones for use in Azure.
Note
Virtual machines deployed from PAYG images or VMs converted from BYOS models incur both an infrastructure fee and a software fee. If you have your own license, use Azure Hybrid Benefit to convers from a PAYG to BYOS model.
You can use Azure Hybrid Benefit to switch back to pay-as-you-go billing at any time.
Which Linux virtual machines qualify for Azure Hybrid Benefit?
Azure dedicated host instances and SQL hybrid benefits aren't eligible for Azure Hybrid Benefit if you already use Azure Hybrid Benefit with Linux virtual machines.
Getting started with Azure Hybrid Benefit
Azure Hybrid Benefit for converting PAYG virtual machines to BYOS for RHEL is available to Red Hat customers who meet the following criteria:
- Have active or unused RHEL subscriptions that are eligible for use in Azure
- Have correctly enabled one or more of their subscriptions for use in Azure with the Red Hat Cloud Access program
Bring your own subscription to Red Hat:
Enable one or more of your eligible RHEL subscriptions for use in Azure using the Red Hat Cloud Access customer interface.The Azure subscriptions that you provide during the Red Hat Cloud Access enablement process then have access to Azure Hybrid Benefit
Apply Azure Hybrid Benefit to any RHEL pay-as-you-go virtual machines that you deploy in Azure Marketplace pay-as-you-go images. You can use the Azure portal or the Azure CLI to enable Azure Hybrid Benefit.
Follow the recommended next steps to configure update sources for your RHEL virtual machines and for RHEL subscription compliance guidelines.
Enable AHB in the Azure portal
In the Azure portal, you can enable Azure Hybrid Benefit on existing virtual machines or on new virtual machines at the time that you create them.
Convert to BYOS on an existing virtual machine in the Azure portal
To enable Azure Hybrid Benefit on an existing virtual machine:
- Go to the Azure portal.
- Open the virtual machine page on which you want to apply the conversion.
- Go to Configuration > Licensing. To enable the Azure Hybrid Benefit conversion, select Yes, and then select the confirmation checkbox.

Convert to BYOS in the Azure portal
To enable Azure Hybrid Benefit when you create a virtual machine, use the following procedure. (The SUSE workflow is the same as the RHEL example shown here.)
Go to the Azure portal.
Go to Create a virtual machine.

In the Licensing section, select the checkbox that asks if you want to use an existing RHEL subscription and the checkbox to confirm that your subscription is eligible.

Create a virtual machine by following the next set of instructions.
On the Configuration pane, confirm that the option is enabled.

Convert to BYOS using the Azure CLI
You can use the az vm update command to update existing virtual machines.
- For RHEL virtual machines, run the command with a
--license-typeparameter ofRHEL_BYOS.
# This will enable BYOS on a RHEL virtual machine using Azure Hybrid Benefit
az vm update -g myResourceGroup -n myVmName --license-type RHEL_BYOS
- For SLES virtual machines, run the command with a
--license-typeparameter ofSLES_BYOS.
# This will enable BYOS on a SLES virtual machine
az vm update -g myResourceGroup -n myVmName --license-type SLES_BYOS
Convert to PAYG using the Azure CLI
To return a VM to a PAYG model, use a --license-type value of None:
# This will enable PAYG on a virtual machine using Azure Hybrid Benefit
az vm update -g myResourceGroup -n myVmName --license-type None
Convert multiple VM license models simultaneously using the Azure CLI
To switch the licensing model on a large number of virtual machines, you can use the --ids parameter in the Azure CLI:
# This will enable BYOS on a RHEL virtual machine. In this example, ids.txt is an
# existing text file that contains a delimited list of resource IDs corresponding
# to the virtual machines using Azure Hybrid Benefit
az vm update -g myResourceGroup -n myVmName --license-type RHEL_BYOS --ids $(cat ids.txt)
The following examples show two methods of getting a list of resource IDs: one at the resource group level, and one at the subscription level.
# To get a list of all the resource IDs in a resource group:
$(az vm list -g MyResourceGroup --query "[].id" -o tsv)
# To get a list of all the resource IDs of virtual machines in a subscription:
az vm list -o json | jq '.[] | {Virtual MachineName: .name, ResourceID: .id}'
Use AHB when creating a new VM
In addition to applying Azure Hybrid Benefit to existing pay-as-you-go virtual machines, you can invoke it at the time of virtual machine creation. Benefits of doing so are threefold:
- You can provision both PAYG and BYOS virtual machines by using the same image and process.
- It enables future licensing mode changes. These changes aren't available with a BYOS-only image or if you bring your own virtual machine.
- The virtual machine is connected to Red Hat Update Infrastructure (RHUI) by default, to help keep it up to date and secure. You can change the updated mechanism after deployment at any time.
Check the licensing model of an AHB enabled VM
You can view the Azure Hybrid Benefit status of a virtual machine by using the Azure CLI or by using Azure Instance Metadata Service.
Check licensing model using the Azure CLI
You can use the az vm get-instance-view command to check the status. Look for a licenseType field in the response. If the licenseType field exists and the value is RHEL_BYOS or SLES_BYOS, your virtual machine has Azure Hybrid Benefit enabled.
az vm get-instance-view -g MyResourceGroup -n MyVm
Check the licensing model of an AHB enabled VM using Azure Instance Metadata Service
From within the virtual machine itself, you can query the attested metadata in Azure Instance Metadata Service to determine the virtual machine's licenseType value. A licenseType value of RHEL_BYOS or SLES_BYOS indicates that your virtual machine has Azure Hybrid Benefit enabled. Learn more about attested metadata.
AHB for reserved instance VMs
Azure reservations (Azure Reserved Virtual Machine Instances) help you save money by committing to one-year or three-year plans for multiple products. Azure Hybrid Benefit for pay-as-you-go virtual machines is available for reserved instances.
If you've purchased compute costs at a discounted rate by using reserved instances, you can apply Azure Hybrid Benefit on the licensing costs for RHEL and SUSE on top of it. The steps to apply Azure Hybrid Benefit for a reserved instance remain exactly same as they are for a regular virtual machine.

Note
If you've already purchased reservations for RHEL or SUSE pay-as-you-go software on Azure Marketplace, please wait for the reservation tenure to finish before using Azure Hybrid Benefit for pay-as-you-go virtual machines.
Red Hat (RHEL) VMs with Azure Hybrid Benefit
To start using Azure Hybrid Benefit for Red Hat:
Install the
AHBForRHELextension on the virtual machine on which you want to apply the Azure Hybrid Benefit BYOS benefit. You can do this installation via the Azure CLI or PowerShell.Depending on the software updates that you want, change the license type to a relevant value. Here are the available license type values and the software updates associated with them:
License type Software updates Allowed virtual machines RHEL_BASE Installs Red Hat regular/base repositories on your virtual machine. RHEL BYOS virtual machines, RHEL custom image virtual machines RHEL_EUS Installs Red Hat Extended Update Support (EUS) repositories on your virtual machine. RHEL BYOS virtual machines, RHEL custom image virtual machines RHEL_SAPAPPS Installs RHEL for SAP Business Apps repositories on your virtual machine. RHEL BYOS virtual machines, RHEL custom image virtual machines RHEL_SAPHA Installs RHEL for SAP with High Availability (HA) repositories on your virtual machine. RHEL BYOS virtual machines, RHEL custom image virtual machines RHEL_BASESAPAPPS Installs RHEL regular/base SAP Business Apps repositories on your virtual machine. RHEL BYOS virtual machines, RHEL custom image virtual machines RHEL_BASESAPHA Installs regular/base RHEL for SAP with HA repositories on your virtual machine. RHEL BYOS virtual machines, RHEL custom image virtual machines Wait one hour for the extension to read the license type value and install the repositories.
Note
If the extension isn't running by itself, you can run it on demand.
You should now be connected to Azure Red Hat Update. The relevant repositories are installed on your machine.
If you want to switch back to the bring-your-own-subscription model, just change the license type to
Noneand run the extension. This action removes all Red Hat Update Infrastructure (RHUI) repositories from your virtual machine and stops the billing.
Note
In the unlikely event that the extension can't install repositories or there are any other issues, switch the license type back to empty and reach out to Microsoft support. This ensures that you don't get billed for software updates.
Converting a VM license model using the Azure CLI
Install the Azure Hybrid Benefit extension on a running virtual machine. You can use the Azure portal or use the following command via the Azure CLI:
az vm extension set -n AHBForRHEL --publisher Microsoft.Azure.AzureHybridBenefit --vm-name myVMName --resource-group myResourceGroupAfter the extension is installed successfully, change the license type based on what you need:
# This will enable Azure Hybrid Benefit to fetch software updates for RHEL base/regular repositories az vm update -g myResourceGroup -n myVmName --license-type RHEL_BASE # This will enable Azure Hybrid Benefit to fetch software updates for RHEL EUS repositories az vm update -g myResourceGroup -n myVmName --license-type RHEL_EUS # This will enable Azure Hybrid Benefit to fetch software updates for RHEL SAP APPS repositories az vm update -g myResourceGroup -n myVmName --license-type RHEL_SAPAPPS # This will enable Azure Hybrid Benefit to fetch software updates for RHEL SAP HA repositories az vm update -g myResourceGroup -n myVmName --license-type RHEL_SAPHA # This will enable Azure Hybrid Benefit to fetch software updates for RHEL BASE SAP APPS repositories az vm update -g myResourceGroup -n myVmName --license-type RHEL_BASESAPAPPS # This will enable Azure Hybrid Benefit to fetch software updates for RHEL BASE SAP HA repositories az vm update -g myResourceGroup -n myVmName --license-type RHEL_BASESAPHAWait five minutes for the extension to read the license type value and install the repositories.
You should now be connected to Red Hat Update Infrastructure. The relevant repositories are installed on your machine. You can validate the installation by running the following command on your virtual machine:
sudo yum repolistIf the extension isn't running by itself, you can try the following command on the virtual machine:
sudo systemctl start azure-hybrid-benefit.serviceYou can use the following command in your RHEL virtual machine to get the current status of the service:
sudo ahb-service -status
SUSE (SLES) VMs with Azure Hybrid Benefit
After you successfully install the AHBForSLES extension, you can use the az vm update command to update the existing license type on your running virtual machines. For SLES virtual machines, run the command and set the --license-type parameter to one of the following license types: SLES_STANDARD, SLES_SAP, or SLES_HPC.
Enable PAYG using the Azure CLI
Ensure that the Azure Hybrid Benefit extension is installed on your virtual machine.
To disable Azure Hybrid Benefit, use the following command:
# This will enable PAYG on a virtual machine az vm update -g myResourceGroup -n myVmName --license-type None
Check licensing model of a virtual machine
Ensure that the Azure Hybrid Benefit extension is installed.
In the Azure CLI or Azure Instance Metadata Service, run the following command:
az vm get-instance-view -g MyResourceGroup -n MyVmLook for a
licenseTypefield in the response. If thelicenseTypefield exists and the value is one of the following, your virtual machine has Azure Hybrid Benefit enabled:RHEL_BASE,RHEL_EUS,RHEL_BASESAPAPPS,RHEL_SAPHA,RHEL_BASESAPAPPS,RHEL_BASESAPHA,SLES,SLES_SAP,SLES_HPC
Compliance
Customers who use Azure Hybrid Benefit for pay-as-you-go RHEL virtual machines agree to the standard legal terms and privacy statement associated with the Azure Marketplace RHEL offers.
Customers who use Azure Hybrid Benefit for pay-as-you-go RHEL virtual machines have three options for providing software updates and patches to those virtual machines:
- Red Hat Update Infrastructure (default option)
- Red Hat Satellite Server
- Red Hat Subscription Manager
Customers can use RHUI as the main update source for Azure Hybrid Benefit for pay-as-you-go RHEL virtual machines without attaching subscriptions. Customers who choose the RHUI option are responsible for ensuring RHEL subscription compliance.
Customers who choose either Red Hat Satellite Server or Red Hat Subscription Manager should remove the RHUI configuration and then attach a cloud-access-enabled RHEL subscription to Azure Hybrid Benefit for PAYG RHEL virtual machines.
For more information about Red Hat subscription compliance, software updates, and sources for Azure Hybrid Benefit for pay-as-you-go RHEL virtual machines, see the Red Hat article about using RHEL subscriptions with Azure Hybrid Benefit.
Customers who use Azure Hybrid Benefit BYOS to PAYG capability for RHEL agree to the standard legal terms and privacy statement associated with the Azure Marketplace RHEL offerings.
Frequently asked questions
Q: Can I use a license type of RHEL_BYOS with a SLES image, or vice versa?
- A: No, you can't. Trying to enter a license type that incorrectly matches the distribution running on your virtual machine won't update any billing metadata. But if you accidentally enter the wrong license type, updating your virtual machine again to the correct license type still enables Azure Hybrid Benefit.
Q: I've registered with Red Hat Cloud Access but still can't enable Azure Hybrid Benefit on my RHEL virtual machines. What should I do?
- A: It might take some time for your Red Hat Cloud Access subscription registration to propagate from Red Hat to Azure. If you still see the error after one business day, contact Microsoft support.
Q: I've deployed a virtual machine by using a RHEL BYOS "golden image." Can I convert the billing on this image from BYOS to pay-as-you-go?
- A: Yes, you can use Azure Hybrid Benefit for BYOS virtual machines to do this. Learn more about this capability.
Q: I've uploaded my own RHEL or SLES image from on-premises (via Azure Migrate, Azure Site Recovery, or otherwise) to Azure. Can I convert the billing on these images from BYOS to pay-as-you-go?
- A: Yes, you can use Azure Hybrid Benefit for BYOS virtual machines to do this. Learn more about this capability.
Q: I've uploaded my own RHEL or SLES image from on-premises (via Azure Migrate, Azure Site Recovery, or otherwise) to Azure. Do I need to do anything to benefit from Azure Hybrid Benefit?
- A: No, you don't. RHEL or SLES images that you upload are already considered BYOS, and you're charged only for Azure infrastructure costs. You're responsible for RHEL subscription costs, just as you are for your on-premises environments.
Q: Can I use Azure Hybrid Benefit for pay-as-you-go virtual machines for Azure Marketplace RHEL and SLES SAP images?
- A: Yes. You can use the license type of RHEL_BYOS for RHEL virtual machines and SLES_BYOS for conversions of virtual machines deployed from Azure Marketplace RHEL and SLES SAP images.
Q: Can I use Azure Hybrid Benefit for pay-as-you-go virtual machines on Virtual Machine Scale Sets for RHEL and SLES?
- A: Yes. Azure Hybrid Benefit on Virtual Machine Scale Sets for RHEL and SLES is available to all users. Learn more about this benefit and how to use it.
Q: Can I use Azure Hybrid Benefit for pay-as-you-go virtual machines on reserved instances for RHEL and SLES?
- A: Yes. Azure Hybrid Benefit for pay-as-you-go virtual machines on reserved instances for RHEL and SLES is available to all users.
Q: Can I use Azure Hybrid Benefit for pay-as-you-go virtual machines on a virtual machine deployed for SQL Server on RHEL images?
- A: No, you can't. There's no plan for supporting these virtual machines.
Q: Can I use Azure Hybrid Benefit on my RHEL for Virtual Datacenters subscription?
- A: No. RHEL for Virtual Datacenters isn't supported on Azure at all, including Azure Hybrid Benefit.
Next steps
Feedback
Submit and view feedback for