I’ve been working with numerous customers on Windows Virtual Desktop (WVD) deployments since I started my position at Microsoft. During the process of manually* creating an image, it’s common to take snapshots. I especially recommend taking snapshots before sysprepping the image.
Once you sysprep an Azure VM, the VM itself is unusable; it won’t successfully boot anymore. So keeping the VM around is useless once you have the generalized image you need to set up WVD session hosts. However, you want to keep the pre-sysprep snapshot around. So the question arises, in order to keep the snapshot, do you need to keep the disk? Keep in mind that both the disk and snapshot are Azure resources and incur a charge.
Here’s an Azure CLI test script that will help you determine the answer to the original question for yourself. The script assumes you have the latest version of the CLI (2.17 at the time of writing) and that you have already logged in (
az login) and selected an appropriate subscription. You might for example run this script in Azure Cloud Shell.
Note: When you delete a VM, it doesn’t automatically delete associated Azure resources. Commonly, I see Azure administrators forgetting about the disk, the network interface card (NIC), and the public IP (if there is one). Be sure to clean up those orphaned resources!
*: I am a big fan of Azure Image Builder (AIB) and automating the image build process. However, AIB is still in preview and most customers also weren’t mature enough to attempt that approach.