Task 02: Activate Windows Server Subscription
DOCUMENT CATEGORY: Runbook SCOPE: Activate Windows Server Subscription for Azure Local to enable automatic VM l... PURPOSE: Activate Windows Server Subscription for Azure Local to enable automatic VM licensing MASTER REFERENCE: Activate Windows Server VMs on Azure Local
Status: Active
Windows Server Subscription is NOT included by default. This is a paid add-on service that requires:
-
Active Azure subscription with billing enabled and valid payment method
-
Per-physical-core monthly billing - You will be charged per physical core, per month for the Windows Server subscription. See Azure Local Pricing for current rates.
-
One of the following licensing paths:
- Purchase directly through Azure - Billed monthly to your Azure subscription
- Azure Hybrid Benefit - If you have Windows Server Datacenter licenses with active Software Assurance, you can activate Windows Server Subscription at no additional cost through Azure Hybrid Benefit
- OEM License - Pre-installed license from OEM hardware vendor (Dell, HPE, Lenovo, etc.) that includes Windows Server guest licensing
⚠️ 60-Day Free Trial: If you enable Windows Server subscription within the first 60 days of registering your Azure Local cluster, you automatically receive a free trial during that period.
⚠️ Billing starts immediately upon activation and continues until you explicitly disable the subscription. You will be billed even if VMs are powered off.
Reference: Activate Windows Server VMs on Azure Local | Azure Local Pricing
Windows Server Subscription provides automatic licensing for Windows Server VMs running on Azure Local, eliminating the need for individual VM licenses.
Overview
Windows Server Subscription offers:
- Per-physical-core licensing model
- Automatic activation of Windows Server VMs
- Support for unlimited Windows Server VMs per host
- Simplified license management through Azure
Prerequisites
- Azure Local cluster registered with Azure Arc
- Owner or Contributor role on the cluster resource
- Valid Azure subscription with billing enabled
- Understanding of per-core pricing model
Values from infrastructure.yml
The values for this task come from infrastructure.yml (schema 5). Every key, with its type, default and example, is in the variables reference.
Execution Options
- Azure Portal
- Orchestrated Script
- Azure CLI
Steps
- Navigate to the Azure portal → Azure Arc → Azure Local
- Select your cluster resource
- Go to Settings → Configuration
- Locate Windows Server Subscription section
- Toggle Enable Windows Server Subscription to On
- Review the pricing information
- Click Save
Verification
- Return to the cluster Overview page
- Confirm Windows Server Subscription shows as Active
- Check Cost Management for subscription charges
PowerShell
When to use: Turn on the Windows Server subscription add-on of the instance from a management workstation, when
operations.licensing.windows_server_subscriptionistrue.
Script
| Script | What it does |
|---|---|
scripts/deploy/05-operational-foundations/phase-05-licensing-telemetry/task-02-activate-windows-server-subscription/powershell/Enable-WindowsServerSubscription.ps1 | Turns on the Windows Server subscription add-on of the Azure Local instance when operations.licensing.windows_server_subscription is true. Reads the instance with Get-AzStackHciCluster, does nothing when the add-on is already Enabled, otherwise runs Update-AzStackHciCluster -DesiredPropertyWindowsServerSubscription Enabled and reads the instance again. Supports -WhatIf. |
When the key is false or missing, the script does nothing and says so. It never turns the add-on off. It refuses scenario.connectivity disconnected (exit 2).
The script reads azure.tenant_id, azure.subscription_id, azure.resource_group, cluster.name, scenario.connectivity and operations.licensing.windows_server_subscription. It does not sign in and asks nothing: run Connect-AzAccount to the tenant of azure.tenant_id first, with Contributor or Owner on the instance. Exit codes: 0 Enabled (or not asked for); 1 an Azure call or a precondition failed; 2 a value in the file is missing or not usable.
Invoke-WindowsServerSubscription-Orchestrated.ps1 in the task folder is a placeholder (exit code 3). The Azure CLI tab has a script that does the same as Enable-WindowsServerSubscription.ps1 with az.
Requires: PowerShell 7; modules Az.Accounts, Az.StackHCI.
Run
Connect-AzAccount -Tenant 00000000-0000-0000-0000-000000000000
./Enable-WindowsServerSubscription.ps1 -InfrastructureFile ./infrastructure.yml -WhatIf
./Enable-WindowsServerSubscription.ps1 -InfrastructureFile ./infrastructure.yml
Azure CLI
When to use: Run the task from a host that has the Azure CLI and not the Az PowerShell modules. The script is PowerShell 7 that calls
az; it readsinfrastructure.ymland carries no values of its own.
Script
| Script | What it does |
|---|---|
scripts/deploy/05-operational-foundations/phase-05-licensing-telemetry/task-02-activate-windows-server-subscription/azurecli/Enable-WindowsServerSubscription.azcli.ps1 | Turns on the Windows Server subscription add-on for the Azure Local instance when operations.licensing.windows_server_subscription of infrastructure.yml is true, with the Azure CLI. Supports -WhatIf. |
Requires: PowerShell 7 and the Azure CLI, signed in with az login --tenant <azure.tenant_id>. Needs the Azure CLI extension stack-hci (az extension add --name stack-hci); the script does not install it.
The script never turns the add-on off and refuses scenario.connectivity disconnected (exit 2). It cannot see the machines: every machine of the instance must be online, registered to Azure and updated before you set the key. You need Contributor or Owner on the instance.
Run
./Enable-WindowsServerSubscription.azcli.ps1 -InfrastructureFile ./infrastructure.yml -WhatIf
./Enable-WindowsServerSubscription.azcli.ps1 -InfrastructureFile ./infrastructure.yml
VM Activation
Once Windows Server Subscription is enabled, VMs automatically activate using AVMA (Automatic Virtual Machine Activation):
# Check VM activation status from within a Windows Server VM
slmgr /dlv
# The VM should show:
# - License Status: Licensed
# - Activation ID: Automatic Virtual Machine Activation
Verification
After enabling Windows Server Subscription:
# On the cluster node
Get-AzStackHCI | Select-Object ClusterName, WindowsServerSubscription
# From management server
$cluster = Get-AzResource -ResourceId $ClusterResourceId
$cluster.Properties.windowsServerSubscription
# Check VM activation (from within a VM)
cscript //nologo C:\Windows\System32\slmgr.vbs /dlv
Cost Considerations
| Item | Details |
|---|---|
| Pricing Model | Per physical core, per month |
| Core Count | Sum of all physical cores across all nodes |
| VM Limit | Unlimited Windows Server VMs |
| Billing Start | Immediately upon enablement |
Windows Server Subscription billing begins immediately when enabled. Ensure budget approval before enabling in production.
Troubleshooting
| Issue | Resolution |
|---|---|
| VM not activating | Verify cluster connectivity to Azure |
| Subscription not showing | Wait up to 24 hours for sync |
| AVMA failed | Check VM has network access to host |
| Billing not appearing | Check Cost Management for Azure Local charges |
Related Documentation
- Windows Server Subscription for Azure Local
- Automatic Virtual Machine Activation (AVMA)
- Azure Local Pricing
Scripts for this task are located in the azurelocal-toolkit repository under scripts/deploy/ in the appropriate task folder.
Alternatives
The procedures in this task use the methods shown in the tabs above. The toolkit is PowerShell 7 only and has no Bash scripts. A few tasks that act on Azure also have an Azure CLI script written in PowerShell. The script status page of the toolkit lists which task has which script.
Navigation
| Previous | Up | Next |
|---|---|---|
| ← Task 01: Azure Hybrid Benefit | Phase 05: Licensing & Telemetry | Task 03: Enhanced Telemetry → |
| Version | Date | Author | Changes |
|---|---|---|---|
| 1.0.0 | 2026-03-24 | Azure Local Cloud | Initial release |
Version Control
| Version | Date | Author | Changes |
|---|---|---|---|
| 1.0.0 | 2025-03-25 | Azure Local Cloud | Initial release |