Wednesday, July 16, 2014

How to deploy Visual Studio "14" CTP 2 into an Azure VM using PowerShell




Title
How to deploy Visual Studio "14" CTP 2 into an Azure VM using PowerShell
Subtitle
Automated deployment using PowerShell and Azure
Keywords
Visual Studio "14", CTP 2, PowerShell , VM, Azure
Category
PowerShell
Audience
Azure subscribers that want to review Visual Studio "14" CTP 2
Purpose
This script will automate the deploying of Visual Studio "14" CTP 2 to an Azure VM so that you can review this new release without clobbering existing installed programs.
Credits
Thanks to Michael Collier for his original blog post on this.
Links

Summary
Quickly get a working copy of VS 14 CTP 2 running in Azure VM.
Notes
This script can easily be changed to install any Azure VM in the Azure Gallery.
Prerequisites
Building a VM in Windows Azure using PowerShell in a few quick steps


PS Code Image




# create_vm_vs14ctp2.ps1
[string]$service_name = "MyVS14CTP2"
[string]$label_name = "vs14ctp2"
[string]$user_name = "vsAdmin"
[string]$password = "#Preview14$"
[string]$DC = "West US"
[string]$size_vm = "Medium"
[string]$image_name = "*Visual Studio Professional 14 CTP 2*"
# Get the latest version of the Visual Studio 14 CTP 2 image
$images = Get-AzureVMImage `
| where { $_.Label -like $image_name } `
| where { $_.Location.Split(";") -contains $DC} `
| Sort-Object -Descending -Property PublishedDate
$images[0]
$myVM = New-AzureVMConfig -Name $service_name -InstanceSize $size_vm -ImageName $images[0].ImageName -DiskLabel $label_name `
| Add-AzureProvisioningConfig -Windows -Password $password -AdminUsername $user_name -DisableAutomaticUpdates
New-AzureVM -ServiceName $service_name -VMs $myVM -Location $DC -WaitForBoot

No comments:

Post a Comment