'VMCustomization' is not enabled for the Subscription. Error trying to create vm from command line

Copper Contributor

I'm trying to setup my first Linux VM following: https://docs.microsoft.com/en-us/azure/virtual-machines/linux/quick-create-cli?toc=/azure/virtual-ma...

 

I first ran: az vm create --resource-group <ResourceName> --name <VM Name> --image <ImageName> admin-username <AdminUsername> --generate-ssh-keys

 

This got me: "'VMCustomization' is not enabled for the Subscription. Please register the Subscription for 'Microsoft.Compute/VMCustomizationPreview' to use the feature."

 

I added: --public-ip-sku Standard

 

and get the same error. I signed up for the Private Preview of VM Customization Feature and still get the same error.

3 Replies

@hiddenjinchuriki I found that you can't generate SSH using the sandbox. You'll need to remove the "--generate-ssh-keys" cmdlet and just provide a password when prompted, it should work (did for me). This will also be a reoccurring issue in future modules in AZ-104.

@hiddenjinchuriki I have the same error too and it happens not only in the sandbox but on my actual Azure subscription. Any ideas?

 

This is now resolved for MS Learn Module

One your Active Sandbox Try Running

Install-Module -Name Az.Compute -RequiredVersion 4.24.1

OR

Install-Module -Name Az.Compute -RequiredVersion 4.25

Then

Pwsh

That starts a new powershell session

New-AzVm -ResourceGroupName learn-d2a8d1e3-0259-4d64-a7ec-8348a719b240 -Name "testvm-eus-01" -Credential (Get-Credential) -Location "East US" -Image UbuntuLTS -OpenPorts 22 -PublicIpAddressName "testvm-01"

will work successfully now!