I am writing bicep code that aims to script out an existing VM and recreate using bicep. It creates an Os disk, however the referenced Os disk is now deprecated. My question is this, how can I resolve the issue ?
param disks_mydeltavm001_osdisk_name string = ‘mydeltavm001-osdisk’
param diskEncryptionSets_des_delta_dev_001_externalid string = ‘/subscriptions/xxx/resourceGroups/my-rg/providers/Microsoft.Compute/diskEncryptionSets/des-delta-dev-001’
resource disks_mydeltavm001_osdisk_name_resource 'Microsoft.Compute/disks@2023-01-02' = {
name: disks_mydeltavm001_osdisk_name
location: 'uksouth'
sku: {
name: 'Standard_LRS'
tier: 'Standard'
}
properties: {
osType: 'Windows'
hyperVGeneration: 'V1'
supportsHibernation: true
supportedCapabilities: {
acceleratedNetwork: true
architecture: 'x64'
}
creationData: {
createOption: 'FromImage'
imageReference: {
id: '/Subscriptions/xxx/Providers/Microsoft.Compute/Locations/uksouth/Publishers/MicrosoftWindowsServer/ArtifactTypes/VMImage/Offers/WindowsServer/Skus/2019-Datacenter/Versions/17763.3650.221105'
}
}
diskSizeGB: 128
diskIOPSReadWrite: 500
diskMBpsReadWrite: 60
encryption: {
type: 'EncryptionAtRestWithCustomerKey'
diskEncryptionSetId: diskEncryptionSets_des_delta_dev_001_externalid
}
networkAccessPolicy: 'DenyAll'
publicNetworkAccess: 'Disabled'
diskState: 'Attached'
}
}
I have tried to be smart by changing the image Id tag to latest
`id: '/Subscriptions/xx/Providers/Microsoft.Compute/Locations/uksouth/Publishers/MicrosoftWindowsServer/ArtifactTypes/VMImage/Offers/WindowsServer/Skus/2019-Datacenter/Versions/latest'`
I am not convinced it works as when the VM builds, it doesnt get the OS name, and I do not know if that VM image exists in the location stated above, how can I navigate to see the image and perhaps create a new one ?