Task 01: Enable Azure Hybrid Benefit
Azure Hybrid Benefit is NOT included by default. This benefit requires the customer to have:
- Windows Server Datacenter licenses with active Software Assurance (SA), obtained through:
- Enterprise Agreement (EA) with active Software Assurance
- Cloud Solution Provider (CSP) subscription
- Microsoft Customer Agreement (MCA) with qualifying subscription
-
Sufficient core licenses - Each Windows Server core license entitles use on one physical core of Azure Local. You must allocate enough core licenses to cover all physical cores on all servers in the Azure Local cluster.
-
Ongoing compliance - Workloads using Azure Hybrid Benefit can run only during the Software Assurance or subscription license term. When the term approaches expiration, you must:
- Renew your agreement with Software Assurance or subscription license, OR
- Disable the Azure Hybrid Benefit functionality, OR
- Deprovision workloads using Azure Hybrid Benefit
⚠️ Microsoft reserves the right to audit customers at any time to verify eligibility for Azure Hybrid Benefit utilization.
Reference: Azure Hybrid Benefit for Windows Server | Azure Hybrid Benefit for Azure Local
Azure Hybrid Benefit allows you to use existing Windows Server licenses with Software Assurance to reduce costs for Windows VMs running on Azure Local.
Overview
Azure Hybrid Benefit provides:
- Up to 40% savings on Windows VM compute costs
- License mobility from on-premises to Azure Local
- Compliance with Microsoft licensing requirements
Prerequisites
- Windows Server licenses with active Software Assurance
- Azure Local cluster registered with Azure Arc
- Owner or Contributor role on the cluster resource
Variables from variables.yml
| Variable | Config Path | Example |
|---|---|---|
AZURE_SUBSCRIPTION_ID | azure.subscription.id | 00000000-0000-0000-0000-000000000000 |
AZURE_RESOURCE_GROUP | azure.resource_group.name | rg-azurelocal-prod-eus2 |
CLUSTER_NAME | cluster.name | azl-dal-cl01 |
Execution Options
- Azure Portal
- Direct Script (On Node)
- Orchestrated Script (Mgmt Server)
- Standalone Script
Steps
- Navigate to the Azure portal → Azure Arc → Azure Local
- Select your cluster resource
- Go to Settings → Configuration
- Locate Azure Hybrid Benefit section
- Toggle Enable Azure Hybrid Benefit to On
- Review the licensing attestation
- Click Save
Verification
- Return to the cluster Overview page
- Confirm Azure Hybrid Benefit shows as Enabled
Run this script directly on any Azure Local cluster node.
#Requires -RunAsAdministrator
#Requires -Modules Az.StackHCI
<#
.SYNOPSIS
Enables Azure Hybrid Benefit on the local Azure Local cluster.
.DESCRIPTION
This script enables Azure Hybrid Benefit to reduce Windows VM compute costs
by leveraging existing Windows Server licenses with Software Assurance.
#>
[CmdletBinding()]
param()
$ErrorActionPreference = 'Stop'
# Get cluster information
$clusterName = (Get-Cluster).Name
Write-Host "Enabling Azure Hybrid Benefit for cluster: $clusterName" -ForegroundColor Cyan
# Get the Azure Local registration
$registration = Get-AzStackHCI
if ($registration.ConnectionStatus -ne 'Connected') {
throw "Cluster is not connected to Azure. Current status: $($registration.ConnectionStatus)"
}
# Enable Azure Hybrid Benefit
# Note: This requires the cluster to be registered and connected
Set-AzStackHCI -EnableAzureHybridBenefit $true
Write-Host "Azure Hybrid Benefit enabled successfully" -ForegroundColor Green
# Verify the setting
$updatedRegistration = Get-AzStackHCI
Write-Host "Azure Hybrid Benefit Status: $($updatedRegistration.AzureHybridBenefit)" -ForegroundColor Cyan
Run this script from the management server to configure Azure Hybrid Benefit remotely.
#Requires -Modules Az.Accounts, Az.Resources, Az.StackHCI
<#
.SYNOPSIS
Enables Azure Hybrid Benefit on an Azure Local cluster from a management server.
.DESCRIPTION
This script connects to Azure and enables Azure Hybrid Benefit on the specified
Azure Local cluster resource.
.PARAMETER ClusterResourceId
The Azure Resource ID of the Azure Local cluster.
.PARAMETER SubscriptionId
The Azure subscription ID containing the cluster.
.PARAMETER ResourceGroupName
The resource group containing the cluster.
.PARAMETER ClusterName
The name of the Azure Local cluster resource.
#>
[CmdletBinding()]
param(
[Parameter(Mandatory = $false)]
[string]$ClusterResourceId,
[Parameter(Mandatory = $false)]
[string]$SubscriptionId,
[Parameter(Mandatory = $false)]
[string]$ResourceGroupName,
[Parameter(Mandatory = $false)]
[string]$ClusterName
)
$ErrorActionPreference = 'Stop'
# Connect to Azure if not already connected
$context = Get-AzContext
if (-not $context) {
Write-Host "Connecting to Azure..." -ForegroundColor Yellow
Connect-AzAccount
}
# Build resource ID if not provided
if (-not $ClusterResourceId) {
if (-not $SubscriptionId -or -not $ResourceGroupName -or -not $ClusterName) {
throw "Either ClusterResourceId or (SubscriptionId, ResourceGroupName, ClusterName) must be provided"
}
$ClusterResourceId = "/subscriptions/$SubscriptionId/resourceGroups/$ResourceGroupName/providers/Microsoft.AzureStackHCI/clusters/$ClusterName"
}
Write-Host "Enabling Azure Hybrid Benefit for: $ClusterResourceId" -ForegroundColor Cyan
# Get current cluster configuration
$cluster = Get-AzResource -ResourceId $ClusterResourceId
# Update with Azure Hybrid Benefit enabled
$cluster.Properties.softwareAssuranceProperties = @{
softwareAssuranceStatus = "Enabled"
softwareAssuranceIntent = "Enable"
}
$cluster | Set-AzResource -Force
Write-Host "Azure Hybrid Benefit enabled successfully" -ForegroundColor Green
# Verify
$updatedCluster = Get-AzResource -ResourceId $ClusterResourceId
Write-Host "Software Assurance Status: $($updatedCluster.Properties.softwareAssuranceProperties.softwareAssuranceStatus)" -ForegroundColor Cyan
Copy-paste ready script to enable Azure Hybrid Benefit — no config file, no helpers.
# ============================================================================
# Script: Enable-AzureHybridBenefit-Standalone.ps1
# Execution: Run anywhere with Az modules — fully self-contained
# Prerequisites: Az.Accounts, Az.Resources modules; authenticated to Azure
# ============================================================================
#Requires -Modules Az.Accounts, Az.Resources
#region CONFIGURATION
# ── Edit these values to match your environment ──────────────────────────────
$SubscriptionId = "00000000-0000-0000-0000-000000000000" # Azure subscription ID
$ResourceGroupName = "rg-azurelocal-prod" # Resource group with cluster
$ClusterName = "azl-cluster-01" # Azure Local cluster name
#endregion CONFIGURATION
$ErrorActionPreference = 'Stop'
# Connect to Azure
$ctx = Get-AzContext
if (-not $ctx) { Connect-AzAccount }
Set-AzContext -SubscriptionId $SubscriptionId | Out-Null
$ClusterResourceId = "/subscriptions/$SubscriptionId/resourceGroups/$ResourceGroupName/providers/Microsoft.AzureStackHCI/clusters/$ClusterName"
Write-Host "Enabling Azure Hybrid Benefit for: $ClusterName" -ForegroundColor Cyan
$cluster = Get-AzResource -ResourceId $ClusterResourceId
$cluster.Properties.softwareAssuranceProperties = @{
softwareAssuranceStatus = "Enabled"
softwareAssuranceIntent = "Enable"
}
$cluster | Set-AzResource -Force
Write-Host "✅ Azure Hybrid Benefit enabled" -ForegroundColor Green
# Verify
$updated = Get-AzResource -ResourceId $ClusterResourceId
Write-Host "Software Assurance Status: $($updated.Properties.softwareAssuranceProperties.softwareAssuranceStatus)" -ForegroundColor Cyan
This script is completely self-contained. Edit the values in the #region CONFIGURATION block and run. No variables.yml, no config-loader, no helpers required.
Verification
After enabling Azure Hybrid Benefit, verify the configuration:
# On the cluster node
Get-AzStackHCI | Select-Object ClusterName, AzureHybridBenefit
# From management server
$cluster = Get-AzResource -ResourceId $ClusterResourceId
$cluster.Properties.softwareAssuranceProperties
Troubleshooting
| Issue | Resolution |
|---|---|
| "Cluster not connected" | Verify Arc connection with Get-AzStackHCI |
| Permission denied | Ensure Owner or Contributor role on cluster resource |
| License attestation required | Review and accept the licensing terms in Azure Portal |
Related Documentation
Navigation
| Previous | Up | Next |
|---|---|---|
| ← Phase 04: Security & Governance | Phase 05: Licensing & Telemetry | Task 02: Windows Server Subscription → |
| Version | Date | Author | Changes |
|---|---|---|---|
| 1.0.0 | 2026-03-24 | Azure Local Cloudnology Team | Initial release |