Hello Ritesh Prasad Sah,
Welcome to the Microsoft Q&A and thank you for posting your questions here.
Problem
I understand that you are experiencing an error while updating the operating system image of an existing Azure Virtual Desktop VM. According to you, the VM is set to deprecate soon, and the you needs to update it to a newer OS version. You have also attempted to change the VM’s OS image using PowerShell commands but received a PropertyChangeNotAllowed
error.
Solution
From point of the error analysis, the PropertyChangeNotAllowed
, error indicates that changing the imageReference
property of an existing VM is not allowed. This property specifies the operating system image used to create the VM, and Azure doesn't support changing the OS image of an existing VM directly. To solve the problem of updating the operating system image of an Azure Virtual Desktop VM and addressing the encountered error, follow these best practices detailed steps. Also, kindly use the link provided as main sources of information and for more detail step by steps.
- Backup the VM Data by ensure you have a backup of any important data on your current VM (Data and setting). You can use Azure Backup or create snapshots of your disks. https://learn.microsoft.com/en-us/azure/backup/backup-azure-vms and https://learn.microsoft.com/en-us/azure/virtual-machines/windows/snapshot-copy-managed-disk
- Create a New VM with the Desired Image by using PowerShell to create a new VM with the desired OS image.
https://learn.microsoft.com/en-us/azure/virtual-machines/windows/quick-create-powershell# Define parameters $resourceGroupName = "YourResourceGroupName" $newVMName = "YourNewVMName" $location = "East US" $vmSize = "Standard_DS1_v2" # Choose the appropriate size for your VM $publisher = "MicrosoftWindowsDesktop" $offer = "Windows-10" $sku = "Win10-22h2-pro" $version = "19045.4529.240607" # Create the VM configuration $vmConfig = New-AzVMConfig -VMName $newVMName -VMSize $vmSize $vmConfig = Set-AzVMOperatingSystem -VM $vmConfig -Windows -ComputerName $newVMName -Credential (Get-Credential) $vmConfig = Set-AzVMSourceImage -VM $vmConfig -PublisherName $publisher -Offer $offer -Skus $sku -Version $version # Network settings (assuming you have a virtual network and subnet) $networkInterface = Get-AzNetworkInterface -ResourceGroupName $resourceGroupName -Name "YourNetworkInterfaceName" $vmConfig = Add-AzVMNetworkInterface -VM $vmConfig -Id $networkInterface.Id # Create the new VM New -AzVM -ResourceGroupName $resourceGroupName -Location $location -VM $vmConfig
- Migrate Data and Settings by transfer your data and configurations from the old VM to the new VM. You have options to use Azure File Share or Azure Blob Storage, Disk Snapshots, or Remote Desktop Protocol (RDP) to connect to both VMs via RDP and manually transfer files. https://learn.microsoft.com/en-us/azure/storage/files/storage-files-introduction and https://learn.microsoft.com/en-us/azure/virtual-machines/windows/attach-managed-disk
- Update DNS and IP Configurations (Optional), in case of any changes ensure your new VM is correctly configured in terms of DNS settings and IP addresses to match any existing dependencies or configurations. https://learn.microsoft.com/en-us/azure/virtual-network/virtual-network-ip-addresses-overview-arm and https://learn.microsoft.com/en-us/azure/dns/dns-zones-records
- Delete the Old VM (Optional), once you have confirmed that everything is working correctly on the new VM, you can decommission the old VM using PowerShell.
Remove-AzVM -ResourceGroupName "YourResourceGroupName" -Name "YourOldVMName" -Force
References
To read more about deprecated images, kindly use the link below and any others by the right side of this page.
Deprecate or restore a virtual machine offer from Azure Marketplace
Accept Answer
I hope this is helpful! Do not hesitate to let me know if you have any other questions.
** Please don't forget to close up the thread here by upvoting and accept it as an answer if it is helpful ** so that others in the community facing similar issues can easily find the solution.
Best Regards,
Sina Salam