Hi Handinata Tanudjaja ,
First, shut down the VM
Navigate to Azure Portal, find the virtual machine you want to create an image from, and stop it. Make sure it reaches the “Stopped (deallocated)” state — this is important before you can capture the image.
- Double-check that the OS disk isn’t being used
Once the VM is fully deallocated, the OS disk detaches from any running state, so your good to go.
• Go back to the VM overview page in the portal
• Click “Capture” from the top menu
• Give your image a clear name so it’s easy to identify later
• You’ll see a checkbox that says “Automatically delete this VM after image creation.” Uncheck it if you plan to reuse or restart the VM later
• Choose the right resource group and region where you want the image to be stored
• Click “Review + create,” then click “Create”.
- Ensure encryption settings are properly configured.
If your VM’s OS disk is encrypted using Azure Disk Encryption (ADE) with a Key Vault, those settings will carry over to the image. Just make sure the Key Vault and its permissions are still in place and accessible. If a Disk Encryption Set (DES) was used, make note of it for future reference.
Once it’s created, go to the “Images” section in the Azure Portal. Your new image should appear there with the type listed as “Specialized.”
How do I properly create a VM from that specialized image then?
- Create a VM from a specialized image by accessing your images in the Azure Portal.
- Navigate to the Images section and click on the specialized image you created earlier. Start the VM creation process
- Once inside the image page, click “Create VM.”
Fill in the VM details
Pick a name and region
Choose the VM size that fits your workload
Set up the admin username and password (if your image doesn’t already have them preconfigured)
- Set up networking attach the VM to a virtual network that allows you to connect — either through public IP with RDP enabled or using a private IP with VPN/Bastion access
- Create the VM
Click “Review + create,” and then click “Create.” Azure will provision a VM using the specialized image you selected.
Note: Since this is a specialized image, it’s a snapshot of the exact state your VM was in — including installed apps, settings, and (if not changed) credentials. This is different from a generalized image which resets everything.
Please refer the document:
https://learn.microsoft.com/en-us/azure/confidential-computing/create-confidential-vm-from-compute-gallery
https://learn.microsoft.com/en-us/azure/virtual-machines/image-version-encryption?tabs=portal
If the comment was helpful, please don't forget to click "Upvote".
Thank You.