I am trying to follow this document in order to create OS Managed Disk (Ubuntu 18.04). However I cannot find suitable body example to create such disk. I tried to send this:
PUT https://management.azure.com/subscriptions/mysubscription/resourceGroups/myresourcegroup/providers/Microsoft.Compute/disks/mydisk?api-version=2018-09-30
{
"name": "mydisk",
"location": "westus2",
"properties": {
"osType": "Linux",
"diskSizeGB": 32,
"creationData": {
"createOption": "FromImage",
"imageReference": {
"id": "/subscriptions/mysubscription/Providers/Microsoft.Compute/Locations/westus2/Publishers/Microsoft/ArtifactTypes/VMImage/Offers/UbuntuServer"
}
}
}
}
but I got response:
{
"error": {
"code": "InvalidParameter",
"message": "The value of parameter imageReference is invalid.",
"target": "imageReference"
}
}
Is there a way to create such disk? Subscription id and resource group name were edited in my examples.
I am trying to create such disk this way because if I specify it during VM creation it will generate some name for OS Managed Disk. And then when I need to delete VM it will be hard to determine which OS Managed Disk to delete. So I want this disk to have specified name, not random.