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.


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


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


There is no Azure API that will allow you to change this at deploy time. You will need to do it after deployment using tools like DSC, or Script. You can bake this into an ARM template so it happens right after your VM deploys using either the DSC or Custom Script extension.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.