If you need to use the D drive to store data, follow these instructions to use a different drive for the temporary disk. Never use the temporary disk to store data that you need to keep.
Before you begin, you'll need a data disk attached to the virtual machine so you can store the Windows page file (pagefile.sys) during this procedure. See How to attach a data disk to a Windows virtual machine if you don't have one. For instructions on how to find out what disks are attached, see "Find the disk" in How to detach a data disk from a Windows virtual machine.
If you want to use an existing data disk on the D drive, make sure you've also uploaded the VHD to the Storage account. For instructions, see steps 3 and 4 in Create and upload a Windows Server VHD to Azure.
If you resize a virtual machine and doing that moves the virtual machine to a different host, the temporary disk changes back to the D drive.
Log on to the virtual machine. For details, see How to log on to a virtual machine running Windows Server.
Move pagefile.sys from the D drive to another drive.
Restart the virtual machine.
Log on again and change the drive letter from D to E.
From the Azure portal, attach an existing data disk or an empty data disk.
Log on to the virtual machine again, initialize the disk, and assign D as the drive letter for the disk you just attached.
Verify that E is mapped to the temporary disk.
Move pagefile.sys from the other drive to the E drive.