Forum Discussion

hiddenjinchuriki's avatar
hiddenjinchuriki
Copper Contributor
Feb 13, 2022

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

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-machines/linux/toc.json.

 

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.

  • vahabj's avatar
    vahabj
    Copper Contributor

    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.

  • hardikchudasama's avatar
    hardikchudasama
    Copper Contributor

    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!

Resources