Launching Ubuntu VM on Windows Azure in less than 1 Min.

Yeh, you all are using Amazon AWS…

But sometimes when you get the urge to try something new, maybe control your AWS operation from an other cloud providers cloud, maybe try Azure 🙂

Here is how to quickly Launch a Ubuntu (or basically any Linux) VM on Windows Azure in less than 1 Min.

Firstly, you may want to set-up this environment for better Azure usage

  1. Sign up at Azure (Free Trial here) + Special free offers and discounts for MSDN Subscribers here
  2. Install the Windows Powershell for Azure (and/or Python and/or Azure command-line interface – CMD) from this link: http://azure.microsoft.com/en-us/downloads/
  3. For Powershell: Use Add-AzureAccount command to add your Windows Azure credentials to your local Powershell install

Setting the Ubuntu VM:

Create the certificate for your new Ubuntu VM: (use Cygwin or any Linux):

openssl req -x509 -days 365 -newkey rsa:2048 -keyout myPrivateKey.key -out myCert.pem

More info: http://azure.microsoft.com/en-gb/documentation/articles/virtual-machines-linux-use-ssh-key/#generate-a-key-from-an-existing-openssh-compatible-key

Using the Azure Web Portal create a new Ubuntu or VM from the Azure templates and use the myCert.pem for the Azure new VM configuration

Prepare a Putty version of your Azure Cert for the VM:

openssl rsa -in ./myPrivateKey.key -out myPrivateKey_rsa

load myPrivateKey_rsa into puttygen and ask it to create a new private key of this
Use .ppk for the output of puttygen private key
Use the new .ppk file for putty ssh session to the Azure Linux VM

Power on the VM (at the Azure portal)

Use putty to login to the new VM (and now you can “sudo apt-get install awscli” or any other stuff you want to do on that Ubuntu VM)

Verifying VM Console & Logs:

Not simple…nothing yet like “aws ec2 get-console-output”

More info:

Simplifying Virtual Machine Troubleshooting using Azure Log Collector (March 2015) –  works for Windows VMs only!! Support for Linux VMs is on the works
Virtual machine console access (Jan 2015)

Verifying VM state in Powershell:

Use the command: Get-AzureVM

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s