Try Out the Latest TFS ALM Capabilities in the Cloud (And I’m Not Talking About

On Dec 6th, Brian Keller published an updated version of his very useful virtual machine and the corresponding hands-on-lab / demo scripts for Visual Studio 2012 Update 1.

This virtual machine includes existing (but upgraded) labs from 2010, as well as labs based on new features (see screenshot below).

I thought it would be nice to simply upload the VHD directly to Azure Blob Storage and provision an Azure PersistentVM based on it. This is surely the easiest way to try all the new ALM features.  And it almost worked! Except that the firewall on the virtual machine is turned on. As a result, I could not RDP into the Azure-based machine.

Initially I thought that the reason I cannot access the Azure-based machine is because the RDP service is turned off. So I added another VM to the cloud service, logged into it and tried to remotely start the RDP Service.

Of course, the firewall prevented any remote access.

So the only option was to download the VHD to my Windows 8 machine, boot into it using Hyper-v, modify the firewall to allow RDP traffic and update the VHD. The only thing left do now was to upload the new VHD to Azure and provision a machine.  Fortunately, a slight modification to Michael Washam’s script is all that is needed to upload the modified VHD and provision a VM based on it.

Pasted below [1] is the updated version of the script. Execution will take some time depending on your network bandwidth. Once the script has run successfully, logon to the Azure portal, start the machine and RDP into it. Now you are ready to try out the new ALM features and labs. Remember to delete the machine [2] when done. Once the VHD is available as a disk in Windows Azure recreating it is a lot easier [3]. Better yet, install our free app Azure Ticker to keep an eye on the Azure bill!

I hope that teams within Microsoft will follow the BizTalk team’s lead and release evaluation VHDs as platform images in Windows Azure.

Have fun with the new ALM features!

[1] Upload the VHD to Windows Azure and provision a VM based on it.

# Todo

# Update the following variables (Replace all occurrences of‘XXX’) based on your subscription details.

# Make sure that the certificate is available to the script and also uploaded to the portal.

# Make sure that the service name is available.

# Select the size of the instance size ( it is set to medium in this script )

$subscriptionName = 'XXX'

$storageAccountName = 'XXX'

$subscriptionId  = 'XXX'

$thumbPrint = 'XXX'

$myCert = Get-Item cert:\\CurrentUser\My\$thumbprint

# Specify the storage account location to store the newly created VH

Set-AzureSubscription -SubscriptionName $subscriptionName -CurrentStorageAccount   $storageAccountName -SubscriptionID $subscriptionId -Certificate $myCert

# Select the correct subscription (allows multiple subscription support)

Select-AzureSubscription -SubscriptionName $subscriptionName

# Retrieve with Get-AzureLocation

$location = 'East US'

# ExtraSmall, Small, Medium, Large, ExtraLarge

$instanceSize = 'Medium'

# Has to be a unique name. Verify with Test-AzureService

$serviceName = 'XXX'

# Server Name

$vmname1 = 'XXX'

# Source VHD

$sourceosvhd = 'XXX\BL_WS2008R2SP1x64Std.vhd'

# Target Upload Location

$destosvhd = 'http://' + $storageAccountName + ''

Add-AzureVhd -LocalFilePath $sourceosvhd -Destination $destosvhd

Add-AzureDisk -OS Windows -MediaLocation $destosvhd -DiskName 'AppServer1OSDisk'

$migratedVM = New-AzureVMConfig -Name $vmname1 -DiskName 'AppServer1OSDisk' -InstanceSize 'Medium' |

Add-AzureEndpoint -Name 'Remote Desktop' -LocalPort 3389 -Protocol tcp

New-AzureVM -ServiceName $serviceName -Location $location -VMs $migratedVM

[2] Remove the VM without deleting the VHD

Remove-AzureVM -Name $vmname1 -ServiceName $ServiceName

[3] Recreating the VM from an existing Windows Azure Disk

$migratedVM = New-AzureVMConfig -Name $vmname1 -DiskName 'AppServer1OSDisk' -InstanceSize 'Medium' |

Add-AzureEndpoint -Name ‘Remote Desktop’ -LocalPort 3389 -Protocol tcp

New-AzureVM -ServiceName $serviceName -Location $location -VMs $migratedVM