How to upload VHDX\VHD to Azure and use it for an Azure VM


  • You need to have the HyperV Role installed on the server if you want to convert VHDX -> VHD , Azure only support VHD
  • You need to create a storage account in Azure : $storageaccount
  • You need to create a container in that storage account $containername
  • Azure Resource Group : $resourceGroup
  • VHD to VHDX should be stored at $localPath e.g. C:\Temp\VHD.VHD – this should be the C drive of the computer including System Reserve partition


  1. Connect to Azure


2. Select Azure Subscription

Select-AzureSubscription -Current -SubscriptionName $AzureSubscriptionName

# Upload the VHD
$urlOfUploadedImageVhd = (‘https://$’ + $containername + ‘/’ + $vhdName)
Add-AzVhd -ResourceGroupName $resourceGroup -Destination $urlOfUploadedImageVhd -LocalFilePath $localPath

This will try and convert the VHDX file to VHD

To be compatible with Azure, Add-AzVhd will automatically try to convert VHDX files to VHD, and resize VHD files to N * Mib using Hyper-V Platform, a Windows naitive virtualization product.
For more information visit

MD5 hash is being calculated for the file \\XXXX\f$\TEMP\XXXX.VHD.
MD5 hash calculation is completed.
Elapsed time for the operation: 00:16:32
Creating new page blob of size 68719477248…
Detecting the empty data blocks in the local file.
Detecting the empty data blocks completed.
Elapsed time for upload: 00:32:37

LocalFilePath DestinationUri
————- ————–
\\vbr01\f$\TEMP\XXXX.VHD https://$$containername/XXXX.VHD

You will have the new Blob URL for the VHD, now you need to make a managed disk from it –

Once you have a managed disk you can then create a VM from that Managed Disk

GD Star Rating
GD Star Rating

Tags: Azure, disk, upload, VHD, vhdx, vm

Trackback from your site.