{"id":1172,"date":"2021-02-24T23:58:58","date_gmt":"2021-02-24T23:58:58","guid":{"rendered":"https:\/\/regroove.ca\/stellark\/?p=1172"},"modified":"2023-02-24T17:16:16","modified_gmt":"2023-02-24T17:16:16","slug":"upload-a-vhd-to-azure-and-create-a-virtual-machine","status":"publish","type":"post","link":"https:\/\/regroove.ca\/stellark\/2021\/02\/24\/upload-a-vhd-to-azure-and-create-a-virtual-machine\/","title":{"rendered":"Upload a VHD to Azure and create a virtual machine"},"content":{"rendered":"\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-layout-1 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:100%\">\n<h4 class=\"wp-block-heading\">Scenario<\/h4>\n\n\n\n<p>You need to create a virtual machine from an existing device and host it in Azure.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Requirements<\/h4>\n\n\n\n<ul>\n<li>The latest version of <a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/storage\/common\/storage-use-azcopy-v10#download-and-install-azcopy\" data-type=\"URL\" data-id=\"https:\/\/docs.microsoft.com\/en-us\/azure\/storage\/common\/storage-use-azcopy-v10#download-and-install-azcopy\">AZCopy v10<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/azure\/install-Az-ps\">Install Azure PowerShell module<\/a><\/li>\n\n\n\n<li>An external drive (equal to or larger than the size of the devices disk)<\/li>\n<\/ul>\n\n\n\n<p><em>It is assumed in this post that you already have an Azure tenant and that you have a subscription which can be used to upload the VHD and create a virtual machine.<\/em><\/p>\n\n\n\n<p>This post is a compilation of information from many sources which I will reference throughout.  I am putting this together in the hopes of making this process &#8216;easier&#8217; to accomplish.  <\/p>\n<\/div>\n<\/div>\n\n\n\n<h4 class=\"wp-block-heading\">Ready, Set, Go!<\/h4>\n\n\n\n<h4 class=\"wp-block-heading\">Step &#8211; 1<\/h4>\n\n\n\n<p class=\"has-luminous-vivid-orange-color has-text-color\">Turn off Bitlocker on the device<\/p>\n\n\n\n<ul>\n<li>Backup the device recovery key from Azure (if previously joined) or from  the local device<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">Step &#8211; 2<\/h4>\n\n\n\n<p class=\"has-luminous-vivid-orange-color has-text-color\">Create a VHDX file using Hyper-V manager (you will need an External Drive for this step)<\/p>\n\n\n\n<div class=\"wp-block-group is-layout-flow wp-block-group-is-layout-flow\">\n<ul>\n<li>From the device you need to convert, install Hyper-V manager tools with Powershell<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>DISM&nbsp;\/Online&nbsp;\/Enable-Feature&nbsp;\/All&nbsp;\/FeatureName:Microsoft-Hyper-V<\/code><\/pre>\n\n\n\n<ul>\n<li>Open Hyper-V manager and create a &#8216;new&#8217; virtual disk from the devices physical disk<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"500\" height=\"349\" src=\"https:\/\/regroove.ca\/stellark\/wp-content\/uploads\/sites\/3\/2021\/02\/1.png\" alt=\"\" class=\"wp-image-1174\" srcset=\"https:\/\/regroove.ca\/stellark\/wp-content\/uploads\/sites\/3\/2021\/02\/1.png 500w, https:\/\/regroove.ca\/stellark\/wp-content\/uploads\/sites\/3\/2021\/02\/1-300x209.png 300w\" sizes=\"(max-width: 500px) 100vw, 500px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"504\" height=\"382\" src=\"https:\/\/regroove.ca\/stellark\/wp-content\/uploads\/sites\/3\/2021\/02\/2.png\" alt=\"\" class=\"wp-image-1175\" srcset=\"https:\/\/regroove.ca\/stellark\/wp-content\/uploads\/sites\/3\/2021\/02\/2.png 504w, https:\/\/regroove.ca\/stellark\/wp-content\/uploads\/sites\/3\/2021\/02\/2-300x227.png 300w\" sizes=\"(max-width: 504px) 100vw, 504px\" \/><\/figure>\n<\/div>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"504\" height=\"383\" src=\"https:\/\/regroove.ca\/stellark\/wp-content\/uploads\/sites\/3\/2021\/02\/3.png\" alt=\"\" class=\"wp-image-1176\" srcset=\"https:\/\/regroove.ca\/stellark\/wp-content\/uploads\/sites\/3\/2021\/02\/3.png 504w, https:\/\/regroove.ca\/stellark\/wp-content\/uploads\/sites\/3\/2021\/02\/3-300x228.png 300w\" sizes=\"(max-width: 504px) 100vw, 504px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"511\" height=\"234\" src=\"https:\/\/regroove.ca\/stellark\/wp-content\/uploads\/sites\/3\/2021\/02\/4.png\" alt=\"\" class=\"wp-image-1177\" srcset=\"https:\/\/regroove.ca\/stellark\/wp-content\/uploads\/sites\/3\/2021\/02\/4.png 511w, https:\/\/regroove.ca\/stellark\/wp-content\/uploads\/sites\/3\/2021\/02\/4-300x137.png 300w\" sizes=\"(max-width: 511px) 100vw, 511px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"511\" height=\"388\" src=\"https:\/\/regroove.ca\/stellark\/wp-content\/uploads\/sites\/3\/2021\/02\/5.png\" alt=\"\" class=\"wp-image-1178\" srcset=\"https:\/\/regroove.ca\/stellark\/wp-content\/uploads\/sites\/3\/2021\/02\/5.png 511w, https:\/\/regroove.ca\/stellark\/wp-content\/uploads\/sites\/3\/2021\/02\/5-300x228.png 300w\" sizes=\"(max-width: 511px) 100vw, 511px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"511\" height=\"391\" src=\"https:\/\/regroove.ca\/stellark\/wp-content\/uploads\/sites\/3\/2021\/02\/6.png\" alt=\"\" class=\"wp-image-1179\" srcset=\"https:\/\/regroove.ca\/stellark\/wp-content\/uploads\/sites\/3\/2021\/02\/6.png 511w, https:\/\/regroove.ca\/stellark\/wp-content\/uploads\/sites\/3\/2021\/02\/6-300x230.png 300w\" sizes=\"(max-width: 511px) 100vw, 511px\" \/><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\">Step &#8211; 3<\/h4>\n\n\n\n<p class=\"has-luminous-vivid-orange-color has-text-color\">Create a virtual machine in Hyper-V manager<\/p>\n\n\n\n<p>Choose Options:<\/p>\n\n\n\n<ul>\n<li>Gen 2<\/li>\n\n\n\n<li>Set memory and disable &#8216;dynamic&#8217;<\/li>\n\n\n\n<li>Choose &#8216;default switch&#8217; for network connection<\/li>\n\n\n\n<li>Choose &#8216;use an existing virtual hard disk&#8217; and select the disk created in Step &#8211; 2<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">Step &#8211; 4<\/h4>\n\n\n\n<p class=\"has-luminous-vivid-orange-color has-text-color\">Prepare the VM for Azure AD<\/p>\n\n\n\n<p>Reference:&nbsp; <a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/virtual-machines\/windows\/prepare-for-upload-vhd-image#:~:text=Azure%20supports%20both%20generation%201,t%20change%20a%20VM%27s%20generation.\">Prepare a Windows VHD to upload to Azure &#8211; Azure Virtual Machines | Microsoft Docs<\/a><\/p>\n\n\n\n<ul>\n<li>Set Coordinated Universal Time (UTC) time for Windows<\/li>\n\n\n\n<li>Set the power profile to high performance<\/li>\n\n\n\n<li>Enable Remote Desktop services with network level authentication<\/li>\n\n\n\n<li>Set FW rules<\/li>\n<\/ul>\n\n\n\n<div class=\"wp-block-group is-layout-flow wp-block-group-is-layout-flow\">\n<ul>\n<li>Restart VM and ensure you can connect via Hyper-V with no bootloader issues\n<ul>\n<li>Ensure you can connect to it via RDP<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/div>\n\n\n\n<ul>\n<li>Install the Azure Agent from an elevated command prompt : <a href=\"https:\/\/go.microsoft.com\/fwlink\/?linkid=394789&amp;clcid=0x409\">HERE<\/a><\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>msiexec.exe \/i c:\\tmp\\WindowsAzureVmAgent.2.7.41491.949_191001-1418.fre.msi \/L*v c:\\tmp\\msiexec.log  <\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"661\" height=\"424\" src=\"https:\/\/regroove.ca\/stellark\/wp-content\/uploads\/sites\/3\/2021\/02\/7.png\" alt=\"\" class=\"wp-image-1180\" srcset=\"https:\/\/regroove.ca\/stellark\/wp-content\/uploads\/sites\/3\/2021\/02\/7.png 661w, https:\/\/regroove.ca\/stellark\/wp-content\/uploads\/sites\/3\/2021\/02\/7-300x192.png 300w\" sizes=\"(max-width: 661px) 100vw, 661px\" \/><\/figure>\n\n\n\n<ul>\n<li>Restart the VM and connect with RDP\n<ul>\n<li>Verify it boots &#8216;ok&#8217; from Hyper-V manager<\/li>\n\n\n\n<li>Verify login &#8216;ok&#8217;<\/li>\n\n\n\n<li>Verify Azure VM agent installed<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<ul>\n<li>Shut the VM down and delete it<\/li>\n\n\n\n<li>Remove the .avhdx file from the external drive if present and restart the physical device<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">Step &#8211; 5<\/h4>\n\n\n\n<p class=\"has-luminous-vivid-orange-color has-text-color\">Convert the .VHDX file to VHD using PowerShell<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Convert-VHD&nbsp;-path&nbsp;D:\\DiskName.vhdx&nbsp;-DestinationPath&nbsp;D:\\DiskName.vhd<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Step &#8211; 6<\/h4>\n\n\n\n<p class=\"has-luminous-vivid-orange-color has-text-color\">Resize the VHD to 256G (or more depending on the size required)<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Resize-VHD&nbsp;-Path&nbsp;'PathtoYourFixedSized.VHD'&nbsp;-SizeBytes&nbsp;'274877906944'<\/code><\/pre>\n\n\n\n<p><em>Sizes accepted in Azure (example)<\/em>:  <a href=\"https:\/\/github.com\/MicrosoftDocs\/azure-docs\/issues\/48403\">https:\/\/github.com\/MicrosoftDocs\/azure-docs\/issues\/48403<\/a><\/p>\n\n\n\n<ul>\n<li>128 = 137438953472<\/li>\n\n\n\n<li>256 = 274877906944<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">Step &#8211; 7<\/h4>\n\n\n\n<p class=\"has-luminous-vivid-orange-color has-text-color\">Create managed disk in Azure<\/p>\n\n\n\n<p>Reference: <a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/virtual-machines\/windows\/disks-upload-vhd-to-managed-disk-powershell\">Upload a VHD to Azure or copy a disk across regions &#8211; Azure PowerShell &#8211; Azure Virtual Machines | Microsoft Docs<\/a><\/p>\n\n\n\n<div class=\"wp-block-group is-layout-flow wp-block-group-is-layout-flow\">\n<div class=\"wp-block-group is-layout-flow wp-block-group-is-layout-flow\">\n<pre class=\"wp-block-code\"><code>#Connect to Azure AZ\nConnect-AzAccount\n#Set&nbsp;variables\n$DiskName&nbsp;=&nbsp;'DiskName'\n$ResourceGroupName&nbsp;=&nbsp;'ResourceGroupName'\n#Set&nbsp;the&nbsp;correct&nbsp;subscription&nbsp;where&nbsp;the&nbsp;resource&nbsp;group&nbsp;is&nbsp;if&nbsp;you&nbsp;havemultiple&nbsp;subscriptions\nGet-azsubscription\nSet-AzContext&nbsp;-SubscriptionID&nbsp;\"944abcd7-1e40-41f6-b357-cfe980f26543\"\n#Use&nbsp;the&nbsp;file&nbsp;size&nbsp;amount&nbsp;from&nbsp;Get-VHD&nbsp;-Path&nbsp;'PathtoYourFixedSized.VHD'&nbsp;|&nbsp;Select-Object&nbsp;*&nbsp;to&nbsp;create&nbsp;your&nbsp;disk&nbsp;in&nbsp;Azure\n<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"335\" height=\"101\" src=\"https:\/\/regroove.ca\/stellark\/wp-content\/uploads\/sites\/3\/2021\/02\/8.png\" alt=\"\" class=\"wp-image-1181\" srcset=\"https:\/\/regroove.ca\/stellark\/wp-content\/uploads\/sites\/3\/2021\/02\/8.png 335w, https:\/\/regroove.ca\/stellark\/wp-content\/uploads\/sites\/3\/2021\/02\/8-300x90.png 300w\" sizes=\"(max-width: 335px) 100vw, 335px\" \/><\/figure>\n\n\n\n<pre class=\"wp-block-code\"><code>$diskconfig&nbsp;=&nbsp;New-AzDiskConfig&nbsp;-AccountType&nbsp;Standard_LRS&nbsp;-Location&nbsp;'Canada&nbsp;Central'&nbsp;-UploadSizeInBytes&nbsp;'274877907456'&nbsp;-OsType&nbsp;Windows&nbsp;-HyperVGeneration&nbsp;\"V2\"&nbsp;-CreateOption&nbsp;Upload\nNew-AzDisk&nbsp;-ResourceGroupName&nbsp;$ResourceGroupName&nbsp;-DiskName&nbsp;$DiskName&nbsp;-Disk&nbsp;$diskconfig<\/code><\/pre>\n\n\n\n<p>Status of new disk will show &#8216;Ready to Upload&#8217; once created<\/p>\n<\/div>\n<\/div>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"614\" height=\"99\" src=\"https:\/\/regroove.ca\/stellark\/wp-content\/uploads\/sites\/3\/2021\/02\/9.png\" alt=\"\" class=\"wp-image-1182\" srcset=\"https:\/\/regroove.ca\/stellark\/wp-content\/uploads\/sites\/3\/2021\/02\/9.png 614w, https:\/\/regroove.ca\/stellark\/wp-content\/uploads\/sites\/3\/2021\/02\/9-300x48.png 300w\" sizes=\"(max-width: 614px) 100vw, 614px\" \/><\/figure>\n\n\n\n<pre class=\"wp-block-code\"><code>#Generate&nbsp;SAS&nbsp;URL&nbsp;for&nbsp;the&nbsp;Azure&nbsp;empty&nbsp;disk\n$diskSas&nbsp;=&nbsp;Grant-AzDiskAccess&nbsp;-ResourceGroupName&nbsp;$ResourceGroupName&nbsp;-DiskName&nbsp;$DiskName&nbsp;-DurationInSecond&nbsp;86400&nbsp;-Access&nbsp;Write\n$disk&nbsp;=&nbsp;Get-AzDisk&nbsp;-ResourceGroupName&nbsp;$ResourceGroupName&nbsp;-DiskName&nbsp;$DiskName<\/code><\/pre>\n\n\n\n<p>Status will change to &#8216;Active Upload&#8217; once SAS URL is generated<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"542\" height=\"137\" src=\"https:\/\/regroove.ca\/stellark\/wp-content\/uploads\/sites\/3\/2021\/02\/10.png\" alt=\"\" class=\"wp-image-1183\" srcset=\"https:\/\/regroove.ca\/stellark\/wp-content\/uploads\/sites\/3\/2021\/02\/10.png 542w, https:\/\/regroove.ca\/stellark\/wp-content\/uploads\/sites\/3\/2021\/02\/10-300x76.png 300w\" sizes=\"(max-width: 542px) 100vw, 542px\" \/><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\">Step &#8211; 8<\/h4>\n\n\n\n<p class=\"has-luminous-vivid-orange-color has-text-color\">Download AzCopy : <a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/storage\/common\/storage-use-azcopy-v10\">Copy or move data to Azure Storage by using AzCopy v10 | Microsoft Docs<\/a><\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Step &#8211; 9<\/h4>\n\n\n\n<p class=\"has-luminous-vivid-orange-color has-text-color\">Upload the VHD to the Azure managed disk using Azcopy<\/p>\n\n\n\n<ul>\n<li>Add Azcopy to environment PATH<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>$userenv&nbsp;=&nbsp;&#91;System.Environment]::GetEnvironmentVariable(\"Path\",&nbsp;\"User\")\n&#91;System.Environment]::SetEnvironmentVariable(\"PATH\",&nbsp;$userenv&nbsp;+&nbsp;\";C:\\TOP\\AZCopy\\\",&nbsp;\"User\")<\/code><\/pre>\n\n\n\n<ul>\n<li>Login and execute the disk copy to Azure AD managed disk<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>Azcopy&nbsp;login<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"610\" height=\"109\" src=\"https:\/\/regroove.ca\/stellark\/wp-content\/uploads\/sites\/3\/2021\/02\/11.png\" alt=\"\" class=\"wp-image-1184\" srcset=\"https:\/\/regroove.ca\/stellark\/wp-content\/uploads\/sites\/3\/2021\/02\/11.png 610w, https:\/\/regroove.ca\/stellark\/wp-content\/uploads\/sites\/3\/2021\/02\/11-300x54.png 300w\" sizes=\"(max-width: 610px) 100vw, 610px\" \/><\/figure>\n\n\n\n<pre class=\"wp-block-code\"><code>azcopy&nbsp;c&nbsp;\"Path to .vhd\"&nbsp;$diskSas.AccessSAS&nbsp;--blob-type&nbsp;PageBlob<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"546\" height=\"242\" src=\"https:\/\/regroove.ca\/stellark\/wp-content\/uploads\/sites\/3\/2021\/02\/12.png\" alt=\"\" class=\"wp-image-1185\" srcset=\"https:\/\/regroove.ca\/stellark\/wp-content\/uploads\/sites\/3\/2021\/02\/12.png 546w, https:\/\/regroove.ca\/stellark\/wp-content\/uploads\/sites\/3\/2021\/02\/12-300x133.png 300w\" sizes=\"(max-width: 546px) 100vw, 546px\" \/><\/figure>\n\n\n\n<p>Wait until the job completes and you see the Final Job Status of Completed<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"411\" height=\"239\" src=\"https:\/\/regroove.ca\/stellark\/wp-content\/uploads\/sites\/3\/2021\/02\/13.png\" alt=\"\" class=\"wp-image-1186\" srcset=\"https:\/\/regroove.ca\/stellark\/wp-content\/uploads\/sites\/3\/2021\/02\/13.png 411w, https:\/\/regroove.ca\/stellark\/wp-content\/uploads\/sites\/3\/2021\/02\/13-300x174.png 300w\" sizes=\"(max-width: 411px) 100vw, 411px\" \/><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\">Step &#8211; 10<\/h4>\n\n\n\n<p class=\"has-luminous-vivid-orange-color has-text-color\">Confirm you see the disk in Azure AD by searching for &#8216;Disks&#8217;<\/p>\n\n\n\n<p>Disk will display as &#8216;unattached&#8217; and &#8216;Create VM&#8217; will be greyed out until you &#8216;revoke disk access&#8217;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#Revoke&nbsp;disk&nbsp;access&nbsp;once&nbsp;completed\nRevoke-AzDiskAccess&nbsp;-ResourceGroupName&nbsp;$ResourceGroupName&nbsp;-DiskName&nbsp;$DiskName<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Step &#8211; 11<\/h4>\n\n\n\n<p class=\"has-luminous-vivid-orange-color has-text-color\">Create VM from managed disk<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Step &#8211; 12<\/h4>\n\n\n\n<p class=\"has-luminous-vivid-orange-color has-text-color\">Once the VM has been created access the resource and perform post configuration steps <\/p>\n\n\n\n<ul>\n<li>Verify the expected settings are present for Azure Agent once VM has been provisioned<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"363\" height=\"356\" src=\"https:\/\/regroove.ca\/stellark\/wp-content\/uploads\/sites\/3\/2021\/02\/14.png\" alt=\"\" class=\"wp-image-1187\" srcset=\"https:\/\/regroove.ca\/stellark\/wp-content\/uploads\/sites\/3\/2021\/02\/14.png 363w, https:\/\/regroove.ca\/stellark\/wp-content\/uploads\/sites\/3\/2021\/02\/14-300x294.png 300w\" sizes=\"(max-width: 363px) 100vw, 363px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Done!<\/h2>\n\n\n\n<p>From here you could continue to perform such tasks as:<\/p>\n\n\n\n<ul>\n<li>Configure VM backup<\/li>\n\n\n\n<li>Test RDP<\/li>\n\n\n\n<li>Configure Alert notifications<\/li>\n\n\n\n<li>Set scheduled start\/stop times<\/li>\n<\/ul>\n\n\n\n<p>Hope this post helped make the process easier to accomplish&#8230; cheers!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Scenario You need to create a virtual machine from an existing device and host it in Azure. Requirements It is assumed in this post that you already have an Azure tenant and that you have a subscription which can be used to upload the VHD and create a virtual machine. This post is a compilation &hellip; <a href=\"https:\/\/regroove.ca\/stellark\/2021\/02\/24\/upload-a-vhd-to-azure-and-create-a-virtual-machine\/\"><\/a><\/p>\n","protected":false},"author":11,"featured_media":1191,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[1],"tags":[278,274,275,276,277],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v23.0 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Upload a VHD to Azure and create a virtual machine - Stephanie Kahlam<\/title>\n<meta name=\"description\" content=\"You need to create a virtual machine from an existing device and host it in Azure.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/regroove.ca\/stellark\/2021\/02\/24\/upload-a-vhd-to-azure-and-create-a-virtual-machine\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Upload a VHD to Azure and create a virtual machine - Stephanie Kahlam\" \/>\n<meta property=\"og:description\" content=\"You need to create a virtual machine from an existing device and host it in Azure.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/regroove.ca\/stellark\/2021\/02\/24\/upload-a-vhd-to-azure-and-create-a-virtual-machine\/\" \/>\n<meta property=\"og:site_name\" content=\"Stephanie Kahlam\" \/>\n<meta property=\"article:published_time\" content=\"2021-02-24T23:58:58+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-02-24T17:16:16+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/regroove.ca\/stellark\/wp-content\/uploads\/sites\/3\/2021\/02\/icon_1.0.1358.2031.png\" \/>\n\t<meta property=\"og:image:width\" content=\"300\" \/>\n\t<meta property=\"og:image:height\" content=\"300\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Stephanie Kahlam\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Stephanie Kahlam\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/regroove.ca\/stellark\/2021\/02\/24\/upload-a-vhd-to-azure-and-create-a-virtual-machine\/\",\"url\":\"https:\/\/regroove.ca\/stellark\/2021\/02\/24\/upload-a-vhd-to-azure-and-create-a-virtual-machine\/\",\"name\":\"Upload a VHD to Azure and create a virtual machine - Stephanie Kahlam\",\"isPartOf\":{\"@id\":\"https:\/\/regroove.ca\/stellark\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/regroove.ca\/stellark\/2021\/02\/24\/upload-a-vhd-to-azure-and-create-a-virtual-machine\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/regroove.ca\/stellark\/2021\/02\/24\/upload-a-vhd-to-azure-and-create-a-virtual-machine\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/regroove.ca\/stellark\/wp-content\/uploads\/sites\/3\/2021\/02\/icon_1.0.1358.2031.png\",\"datePublished\":\"2021-02-24T23:58:58+00:00\",\"dateModified\":\"2023-02-24T17:16:16+00:00\",\"author\":{\"@id\":\"https:\/\/regroove.ca\/stellark\/#\/schema\/person\/175e89cb69612178b2ac838c0bab6149\"},\"description\":\"You need to create a virtual machine from an existing device and host it in Azure.\",\"breadcrumb\":{\"@id\":\"https:\/\/regroove.ca\/stellark\/2021\/02\/24\/upload-a-vhd-to-azure-and-create-a-virtual-machine\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/regroove.ca\/stellark\/2021\/02\/24\/upload-a-vhd-to-azure-and-create-a-virtual-machine\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/regroove.ca\/stellark\/2021\/02\/24\/upload-a-vhd-to-azure-and-create-a-virtual-machine\/#primaryimage\",\"url\":\"https:\/\/regroove.ca\/stellark\/wp-content\/uploads\/sites\/3\/2021\/02\/icon_1.0.1358.2031.png\",\"contentUrl\":\"https:\/\/regroove.ca\/stellark\/wp-content\/uploads\/sites\/3\/2021\/02\/icon_1.0.1358.2031.png\",\"width\":300,\"height\":300},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/regroove.ca\/stellark\/2021\/02\/24\/upload-a-vhd-to-azure-and-create-a-virtual-machine\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Stellark Home\",\"item\":\"https:\/\/regroove.ca\/stellark\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Upload a VHD to Azure and create a virtual machine\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/regroove.ca\/stellark\/#website\",\"url\":\"https:\/\/regroove.ca\/stellark\/\",\"name\":\"Stephanie Kahlam\",\"description\":\"Microsoft 365 and SMB.\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/regroove.ca\/stellark\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/regroove.ca\/stellark\/#\/schema\/person\/175e89cb69612178b2ac838c0bab6149\",\"name\":\"Stephanie Kahlam\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/regroove.ca\/stellark\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/398b95e23dc9eaf37a780b86a239b485?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/398b95e23dc9eaf37a780b86a239b485?s=96&d=mm&r=g\",\"caption\":\"Stephanie Kahlam\"},\"url\":\"https:\/\/regroove.ca\/stellark\/author\/skahlam\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Upload a VHD to Azure and create a virtual machine - Stephanie Kahlam","description":"You need to create a virtual machine from an existing device and host it in Azure.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/regroove.ca\/stellark\/2021\/02\/24\/upload-a-vhd-to-azure-and-create-a-virtual-machine\/","og_locale":"en_US","og_type":"article","og_title":"Upload a VHD to Azure and create a virtual machine - Stephanie Kahlam","og_description":"You need to create a virtual machine from an existing device and host it in Azure.","og_url":"https:\/\/regroove.ca\/stellark\/2021\/02\/24\/upload-a-vhd-to-azure-and-create-a-virtual-machine\/","og_site_name":"Stephanie Kahlam","article_published_time":"2021-02-24T23:58:58+00:00","article_modified_time":"2023-02-24T17:16:16+00:00","og_image":[{"width":300,"height":300,"url":"https:\/\/regroove.ca\/stellark\/wp-content\/uploads\/sites\/3\/2021\/02\/icon_1.0.1358.2031.png","type":"image\/png"}],"author":"Stephanie Kahlam","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Stephanie Kahlam","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/regroove.ca\/stellark\/2021\/02\/24\/upload-a-vhd-to-azure-and-create-a-virtual-machine\/","url":"https:\/\/regroove.ca\/stellark\/2021\/02\/24\/upload-a-vhd-to-azure-and-create-a-virtual-machine\/","name":"Upload a VHD to Azure and create a virtual machine - Stephanie Kahlam","isPartOf":{"@id":"https:\/\/regroove.ca\/stellark\/#website"},"primaryImageOfPage":{"@id":"https:\/\/regroove.ca\/stellark\/2021\/02\/24\/upload-a-vhd-to-azure-and-create-a-virtual-machine\/#primaryimage"},"image":{"@id":"https:\/\/regroove.ca\/stellark\/2021\/02\/24\/upload-a-vhd-to-azure-and-create-a-virtual-machine\/#primaryimage"},"thumbnailUrl":"https:\/\/regroove.ca\/stellark\/wp-content\/uploads\/sites\/3\/2021\/02\/icon_1.0.1358.2031.png","datePublished":"2021-02-24T23:58:58+00:00","dateModified":"2023-02-24T17:16:16+00:00","author":{"@id":"https:\/\/regroove.ca\/stellark\/#\/schema\/person\/175e89cb69612178b2ac838c0bab6149"},"description":"You need to create a virtual machine from an existing device and host it in Azure.","breadcrumb":{"@id":"https:\/\/regroove.ca\/stellark\/2021\/02\/24\/upload-a-vhd-to-azure-and-create-a-virtual-machine\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/regroove.ca\/stellark\/2021\/02\/24\/upload-a-vhd-to-azure-and-create-a-virtual-machine\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/regroove.ca\/stellark\/2021\/02\/24\/upload-a-vhd-to-azure-and-create-a-virtual-machine\/#primaryimage","url":"https:\/\/regroove.ca\/stellark\/wp-content\/uploads\/sites\/3\/2021\/02\/icon_1.0.1358.2031.png","contentUrl":"https:\/\/regroove.ca\/stellark\/wp-content\/uploads\/sites\/3\/2021\/02\/icon_1.0.1358.2031.png","width":300,"height":300},{"@type":"BreadcrumbList","@id":"https:\/\/regroove.ca\/stellark\/2021\/02\/24\/upload-a-vhd-to-azure-and-create-a-virtual-machine\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Stellark Home","item":"https:\/\/regroove.ca\/stellark\/"},{"@type":"ListItem","position":2,"name":"Upload a VHD to Azure and create a virtual machine"}]},{"@type":"WebSite","@id":"https:\/\/regroove.ca\/stellark\/#website","url":"https:\/\/regroove.ca\/stellark\/","name":"Stephanie Kahlam","description":"Microsoft 365 and SMB.","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/regroove.ca\/stellark\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/regroove.ca\/stellark\/#\/schema\/person\/175e89cb69612178b2ac838c0bab6149","name":"Stephanie Kahlam","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/regroove.ca\/stellark\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/398b95e23dc9eaf37a780b86a239b485?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/398b95e23dc9eaf37a780b86a239b485?s=96&d=mm&r=g","caption":"Stephanie Kahlam"},"url":"https:\/\/regroove.ca\/stellark\/author\/skahlam\/"}]}},"_links":{"self":[{"href":"https:\/\/regroove.ca\/stellark\/wp-json\/wp\/v2\/posts\/1172"}],"collection":[{"href":"https:\/\/regroove.ca\/stellark\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/regroove.ca\/stellark\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/regroove.ca\/stellark\/wp-json\/wp\/v2\/users\/11"}],"replies":[{"embeddable":true,"href":"https:\/\/regroove.ca\/stellark\/wp-json\/wp\/v2\/comments?post=1172"}],"version-history":[{"count":6,"href":"https:\/\/regroove.ca\/stellark\/wp-json\/wp\/v2\/posts\/1172\/revisions"}],"predecessor-version":[{"id":1383,"href":"https:\/\/regroove.ca\/stellark\/wp-json\/wp\/v2\/posts\/1172\/revisions\/1383"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/regroove.ca\/stellark\/wp-json\/wp\/v2\/media\/1191"}],"wp:attachment":[{"href":"https:\/\/regroove.ca\/stellark\/wp-json\/wp\/v2\/media?parent=1172"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/regroove.ca\/stellark\/wp-json\/wp\/v2\/categories?post=1172"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/regroove.ca\/stellark\/wp-json\/wp\/v2\/tags?post=1172"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}