Friday, May 8, 2015

Building a Virtual Lab in Azure

So I have had a to do for a while to create a new personal lab for my own use. I have lots of servers at work to play with but sometime I want to spin up a vm and test something that is not work related. My home desktop is OK for light testing but can only support 1 or 2 vms before everything starts to slow down. Luckily Microsoft Azure gives everyone a test run and is very easy to use. They have a very intuitive portal that can be used to manually setup a lab server and\or environment but I want to automate the process to allow me to quickly create a lab and remove it when I am done.

Step one 
The Azure Team has a great guide on how to install azure powershell.

http://azure.microsoft.com/en-us/documentation/articles/powershell-install-configure/

Once you have setup a subscription and installed azure powershell it is time to get started.
Open Azure Powershell as an Administrator
Before we get going update the help files just in case. The update-help command will download the latest version of the help files.

update-help 
Now we need to logon to Azure
Add-AzureAccount
This command will bring up an interactive logon process. Just follow along to logon.


Now that we are connected we will create the 1st part of the lab - The network
I use the info from http://blogs.technet.com/b/kevinremde/archive/2013/01/19/create-a-windows-azure-network-using-powershell-31-days-of-servers-in-the-cloud-part-19-of-31.aspx to get started on this step. But as this was part of another series some of the information did not apply. For example i am not setting up a vpn to my network. But the important thing i found was that if you do not have a network created, create one via the portal then use the Get-AzureVNetConfig command to create a config file that can be used to create a new network via the Set-AzureVNetConfig command.