azureThis past week I have been working on building a student lab in Azure. The idea is that as students can work on a Windows Server labs with their own preconfigured lab and for free. The way to accomplish this is to have each student register for their own free 90 day trial and then copy over the pre created virtual servers.

While testing this I have found a few interesting things:

Azure storage is fast. To copy a 10gig server image from my storage to the students new account was always done in under 10 seconds! Wow, even my local servers aren’t near as fast. I just read today that Azure has the fastest and most stable cloud storage of all the major cloud providers. (Read about that here on Neowin.net)
Passwords Still Suck. Yesterday I was working on a new Windows Server 2008R2 machine that I provisioned in Azure for a student lab. I set the password to “P@ssw0rd”. This was to have it slightly complex but easy enough for students to remember. It only took about three minutes for my RDP session to log me out because someone else had logged in as administrator. I logged back in quickly and tried to change my password. I was quickly kicked out again and before I could log back in my password had been changed and my server was now owned by someone else. The moral of my story is use a complex uncommon password. There are scripts hitting RDP on port 3389 that try the Administrator account with a common password list. They will own your box in under 10 minutes.
The Cloud is Cool. The more I work with Azure IAAS the more I appreciate how awesome it is to have the public “Cloud” especially the free 90 day trial.
Setup is easy. It is easy to setup an environment like this. Below I will publish a step by step guide on how to accomplish this.

 

Building the Lab

The first thing to do is to build your servers for the Lab. For example if I were to build a lab on doing an in-place upgrade from Server 2008R2 to server 2012 on a domain controller the steps would be. 

Get your Free Trial Azure Free NOTE: When activating your FREE 90-Day Subscription for Windows Azure, you will be prompted for credit card information.  This information is used only to validate your identity and your credit card will not be charged, unless you explicitly convert your FREE Trial account to a paid subscription at a later point in time. Get your trial here: http://aka.ms/AzureFree
Management Portal:

(RDP to server by selecting Connect at the bottom of the screen and then opening the RDP file that downloads)

Login to your Azure account and provision a 2008R2 server.
https://manage.windowsazure.com/

Remember to use a non standard password. Smile

image

Configure you Servers In our example I will install Active Directory. Down the Server2012 ISO to this server. Lastly download a free tool to mount an ISO in Server 2008R2 and install it.
De-provision your server De-provision your server from the Azure Management Portal https://manage.windowsazure.com/

Delete the virtual server

Download the tools Now we need to copy the vhd file to the area that your students will copy it from. For this we need the Azure PowerShell command line tools. Download the Windows Azure PowerShell command line tools
http://go.microsoft.com/fwlink/p?LinkID=275464
Install the tools Run the MSI – the latest as of this writing is azuresdk-cli-v0.6.9.msi. Just follow a standard install.
Setup the security to your Azure environment.

Great! We now we have the Windows Azure PowerShell cmdlets installed, but we can’t use them yet because we need to setup a secure connection to our Azure account. To do this we will use a certificate.

  1. The first thing we need to do is start a PowerShell Command prompt with Admin privileges. From the Start Screen type “power” then right click on the “Windows Azure PowerShell “ Icon. Then left click on run as Administrator.
    image
  2. Now type in the command “Get-AzurePublishSettingsFile” <enter>. This will launch a browser window to Azure where you will download the published settings file. Save it to c:\temp.
    image image
  3. Now from the PowerShell commnad line run Import-AzurePublishSettingsFile to import the certificate and subscription information. “Import-AzurePublishSettingsfile c:\temp\your-filename.publishsettings”
    image
  4. That should do it. If you are having problems:
    – make sure your in an elevated PowerShell Prompt. (step 1)
    - You can try “Import-Module Azure” (this shouldn’t be needed)
    - You can try  “Set-ExecutionPolicy RemoteSigned”

You are now ready to manage your Azure Cloud Servers from PowerShell!

Create your copy command for the students to copy the vhd.

image
  Click to enlarge

From the Azure Command prompt:

  1. Type “azure vm image list
  2. Type “azure vm image show <your machine>
    replace <your machine> with the name of your server from the vm image list command.
  3. Note the link to the file location
    in my example it is  http://bjltest.blob.core.windows.net/vm-images/win8dev01.vhd
  4. Note the beginning of the file location bjltest is the storage account. We need the secret key to that account. To obtain the key enter:
    azure account storage keys list bjltest
  5. Now for the copy. Enter the command “azure vm disk upload” then use the url of the vhd file. Next put the url of your new machine. In the screenshot I just changed it from win8dev01.vhd to win8dev02.vhd. Lastly enter your secondary storage key.
    Example:
    ‘azure vm disk upload “http://bjltest.blob.core.windows.net/vm-images/win8dev01.vhd”http://bjltest.blob.core.windows.net/vm-images/win8dev02.vhd” <SECONDARYSTORAGEKEY>’

    Note: In the screenshot to the left you can see my secondary storage key is: 8Oh4fPYdU2+/Y/dPtcv3KwlA5w5if6hTTs67SwIe3m77mbZ2MPK6taz9WA This key was altered for this demo so don’t waste your time hacking my account :)

  Now you are ready for students to create their labs off of your work.
They just setup their azure trial and use the command line tools to copy your vhd to their storage. I will have a link posted to these instructions next week. Here http://mythoughtsonit.com/LinkTBD…