I have a custom vhd which I have in my Azure VM. It's a linux machine. I need to use azure cli to create an Image from this vhd file. This image will then be used to create VMs which have a username and Password. I have successfully used the vhd to create an Image using the Portal and created a VM out of it. However, I am unable to create an image using cli commands. This is what I get when I run the command -
jenkins@Jenkins-vm:~/testFolder$ az image create -g myRG -n myImage --os-type Linux --source ./myCustom.vhd
usage: az image create [-h] [--verbose] [--debug] [--only-show-errors]
[--output {json,jsonc,yaml,yamlc,table,tsv,none}]
[--query JMESPATH] [--subscription _SUBSCRIPTION]
--resource-group RESOURCE_GROUP_NAME --name NAME
--source SOURCE [--os-type {Windows,Linux}]
[--data-disk-sources DATA_DISK_SOURCES [DATA_DISK_SOURCES ...]]
[--location LOCATION]
[--storage-sku {Standard_LRS,Premium_LRS,StandardSSD_LRS,UltraSSD_LRS}]
[--hyper-v-generation {V1,V2}]
[--os-disk-caching {None,ReadOnly,ReadWrite}]
[--data-disk-caching {None,ReadOnly,ReadWrite}]
[--tags [TAGS [TAGS ...]]]
[--zone-resilient [{true,false}]]
az image create: error: 'NoneType' object has no attribute 'os_disk'
I don't understand the meaning of the error displayed. I'm very new to Azure so feeling a little lost.