I want to create a Linux virtual machine from a disk in azure using python. I found some links where it was suggested to do something with VHD, but it was not clearly explained how to do that. Can anyone explain the answer using python (not on CLI or powershell or in JSON).
I have referred this documentation :
VM_PARAMETERS = {
'location': LOCATION,
'os_profile': {
'computer_name': VM_NAME,
'admin_username': USERNAME,
'admin_password': PASSWORD
},
'hardware_profile': {
'vm_size': 'Basic_A0'
},
'storage_profile': {
'image_reference': {
'publisher': 'Canonical',
'offer': 'UbuntuServer',
'sku': '16.04.0-LTS',
'version': 'latest'
},
},
'network_profile': {
'network_interfaces': [{
'id': nic_id,
}]
},
}
compute_client.virtual_machines.create_or_update(GROUP_NAME, VM_NAME, VM_PARAMETERS)
Please help me with this.