Search code examples
azurevirtual-machineazure-cli

API version 2022-03-01 does not have operation group 'virtual_machine_images'


I run following command

az vm create --resource-group MyRG --name myVMName --image windows-11:win11–21h2-pro:22000.376.2112072052

This causes following error.

API version 2022-03-01 does not have operation group 'virtual_machine_images'

I assume this means --image no more support but what's the alternative? Couldn't find anything relevant in the Auzre cli documentation about this. My az cli version seems upto date

az --version                                                                                                                                        
azure-cli                         2.37.0
 
core                              2.37.0
telemetry                          1.0.6
 
Extensions:
azure-devops                      0.24.0
 
Dependencies:
msal                            1.18.0b1
azure-mgmt-resource               21.0.0
 
Python location '/usr/bin/python3'
Extensions directory '/home/kali/.azure/cliextensions'
Extensions system directory '/usr/lib/python3/dist-packages/azure-cli-extensions'
 
Python (Linux) 3.10.5 (main, Jun  8 2022, 09:26:22) [GCC 11.3.0]
 
Legal docs and information: aka.ms/AzureCliLegal
 
 
Your CLI is up-to-date.

Update: This error is not specific to windows-11, I am getting same error with other OS too. See image below for detailed error.

enter image description here


Solution

  • az vm create --resource-group MyRG --name myVMName --image windows-11:win11–21h2-pro:22000.376.2112072052

    The image version you are using in your cmdlet is not supported. I would suggest you use the below Azure Cli cmdlet to see the list of supported windows-11:win11-21h2-pro images to deploy a virtual machine.

    az vm image list --all --offer windows-11 --sku win11-21h2-pro -o table
    

    Below image shows when we ran the above cmdlet from Azure cloudshell:

    enter image description here

    Below image shows when we ran the above cmdlet from local AzureCLI:

    enter image description here

    Note: I have tested the above az vm image list cmdlet in local & Azure Cloudshell as well it is working fine,I am able to see the list of support images and their respective versions.

    I have ran the below cmdlet, am able to deploy the virtual machine using the image (MicrosoftWindowsDesktop:windows-11:win11-21h2-pro:22000.675.220507).You just need to use the image version that is shown in the above list

    az vm create --resource-group <resourcegroupName> --name <vmName> --image MicrosoftWindowsDesktop:windows-11:win11-21h2-pro:22000.675.220507
    

    enter image description here