@Anders Lindberg (and adding @DustinShockley and @Joe Martin ),
Issue:
Using the New-AzVM
command results in the following VMCustomization error:
New-AzVM: 'VMCustomization' is not enabled for the Subscription. Please register the Subscription for 'Microsoft.Compute/VMCustomizationPreview' to use the feature.
Update: We are releasing a fix in Az.Compute version 4.24.1.
Solution:
Update the Az.Compute module to the current version on your local client (Azure Cloud Shell should be updated shortly):
Update-Module Az.Compute
If you are using the Azure Cloud Shell, use the following command and restart the Cloud Shell (by pressing the power button next to the "?"):
Install-Module Az.Compute -Force
Old/Alternate Workaround:
On your local PowerShell client you can install and revert back to Az.Compute version 4.23.0, which is unaffected by this issue:
- Check your current Az.Compute version number using either
Get-Module Az.Compute
(this will return nothing if the module hasn't been loaded) orGet-Module -ListAvailable -Name Az.Compute -Refresh
- Install
Az.Compute
version 4.23:Install-Module Az.Compute -RequiredVersion 4.23.0 -Force
- Switch to
Az.Compute
version 4.23:Import-Module Az.Compute -RequiredVersion 4.23.0
- You should now be able to use
New-AzVm
Details:
Using the New-AzVM
command results in the following VMCustomization error:
New-AzVM: 'VMCustomization' is not enabled for the Subscription. Please register the Subscription for 'Microsoft.Compute/VMCustomizationPreview' to use the feature.
It appears we're seeing the same issue now in Azure PowerShell that we saw in Azure CLI (Azure CLI is separate from Azure PowerShell but can also be run within PowerShell which causes some confusion--this documentation helps to clarify both the differences and similarities).
Cause:
This is unintended behavior with New-AzVM
. I will continue to update this thread as we learn more.
- This impacts Az.Compute version 4.24.0 (see workaround above)
- We are releasing a fix for version 4.24.1
- It appears this is related to the 7.2.0 release in February, 2022
- Both desktop and Azure Cloud Shell clients are affected
- Azure CLI (az vm create) is not affected outside of the known issue for 2.33.0
Out of Curiosity, What is VM Customization (Private Preview)?
For those who are curious, VM Customization is in private preview and is designed to provide customization for Hyperthreading and Constrained Cores:
https://aka.ms/vmcustomization
The VM Customization feature is designed to provide two important customization features to customers, Hyperthreading and Constrained Cores. Hyperthreading provides customers the ability to disable hyperthreading on their VMs at the time of creation and Constrained Cores allows customization of the “constrained core counts” which helps to optimize the database licensing cost customers pay for.