Azure: deployment using templates

The goal here is to get from an Azure subscription with no VMs etc, to a working VM to which we can immediately RDP and use.

Repeating some of the steps taking you from a bare (Windows) client machine to the working VM

  • Install-Module AzureRM (Windows client)
  • Login-AzureRmAccount (logs you in to your Azure account) 
  • Set-AzureRmContext (vital for me as I have 2 subscriptions),
    e.g. Set-AzureRmContext -SubscriptionName “Visual Studio Ultimate with MSDN”

Find this file (temp/templates / ref2.json) on Github and save it to your working location. It will be referenced in the next command. (I know it all needs tidying up)

Create a resource group by executing this command in a PowerShell admin prompt (altering Name and Location as you wish).

New-AzureRmResourceGroup -Name DWRG -Location "UK South"

CredSet05

Execute this command in a PowerShell admin prompt, which will generate your VM (with an assumption that [ref2.json] is in the current folder), and the supporting structure. It will still prompt for the admin password for the VM(s). Note that the storageAccountName value must be lower case.

New-AzureRmResourceGroupDeployment -Name DWDeploy -ResourceGroupName
DWRG -TemplateFile .\ref2.json -storageAccountName "dwstorage" 
-virtualNetworkName "DWVnn" -networkInterfaceName "DWNin" 
 -adminUsername "TheAdmin" -vmName "DWVm"

And this is the kind of output you can expect:

CredSet03.PNG

And finally proof I can jump onto that Windows Server 2012.

CredSet04

I intend to reduce the content of the ref2.json file to the bare minimum to get a set of VMs. I have already removed the load balancer references (this is just for functional testing purposes), and will remove the availability set references once I work out the dependencies.

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

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

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s