Thank you for reaching out to the Microsoft Q&A platform.
Unfortunately, there is no ready-to-use method available for this specific scenario. However, this doesn't sound practical to keep switching the disk type between standard and premium each time the VM is not in use. If this is to save costs and you have the backup of the VMs. You can use Azure PowerShell to automate the process of changing the disk type of your VMs. You can create a PowerShell script that turns off the VM, changes the disk type to Standard HDD, turns the VM back on, and then changes the disk type to Premium.
You can use the Stop-AzVM
and Start-AzVM
cmdlets to turn off and on the VM, respectively. You can use the Update-AzDisk
cmdlet to change the disk type.Ref: https://learn.microsoft.com/en-us/powershell/module/az.compute/update-azdisk?view=azps-12.1.0
https://learn.microsoft.com/en-us/powershell/module/az.compute/start-azvm?view=azps-12.1.0
If I have answered your query, please click "Accept as answer" as a token of appreciation