Uploading a custom VHD to Azure with PowerShell and adding it to your VMs

Sure, it’s fun to go into Azure and see all of the cool supported operating system images you can have running in mere minutes.  But it is even cooler to take your own internal server or data image and upload that to Azure to use in your VMs.  It is even cooler to do it all with PowerShell!  If the demo gets a bit technical, be sure to skip to the end for my concluding notes.

If you don’t have your Azure account accessible from the command line, first of all you should install the Windows Azure PowerShell pack available http://www.windowsazure.com/en-us/downloads/.  Launch an Azure PowerShell prompt and then run Add-AzureAccount and login

What a nifty interface, I’d love to steal–er–aggressively borrow this UI element for my own PowerShell tools!


The Demonstration

For this example, let’s pretend we have a VHD with important customer data we’ll need to access in our worker VMs from within Azure.  Go to Disk management and get our VHD made.  For the sake of data transit, we’ll make a small VHD and load it up with important customer data! Continue reading