Windows – Azure cloud VM change letter of temporary drive

azurecloudpagefilewindows

In azure cloud when you start a windows image the running vm will have a temporary drive D: where the page file is set.

Is any way I can call the api (powershel, az cli etc.) and be able to specify which letter to assign to the temporary drive ? I want for example to have the disk C: as OS and disk Z: for the temporary drive.

thanks,

ps: i know how to change it after the vm is running as per https://docs.microsoft.com/en-us/azure/virtual-machines/windows/change-drive-letter

Best Answer

You could run a DSC script using the Azure VM extension to do the drive letter change at deployment/start time. An example of how to do this is here: https://github.com/perktime/MoveAzureTempDrive

Related Topic