Automated Provisioning of Azure Virtual Machines with PowerShell using Runbook
July 17, 2014 Leave a comment
Recently, I have been adding a lot of energy towards the latest additions of Azure family, like Automation API, Scheduler, Machine Learning (ML) on HDInsight, StorSimple (checking it from today itself in management portal). With my utmost curiosity researched & noted down a few points to be taken care of while writing custom IaaS PowerShell scripts to provision fresh Azure VM image using traditional Azure cmdlets.
$adminPassword = '[YOUR-PASSWORD]' $vmname = 'mytestvm1' New-AzureQuickVM -Windows -ServiceName $cloudSvcName -Name $vmname -ImageName $image -Password $adminPassword Most of us got familiar with these script while issue happens providing the $imagename , for Windows Server 2012 DataCenter , the command would be like this: $cloudSvcName = '[Your Cloud Service Name]' $vmname = '[Name of VM]' $availabilityset = '[Name of Availability set]' (Optional) $admin = '[Your Username]' $password = '[Your Password]' New-AzureQuickVM -Windows -ServiceName $cloudSvcName -AvailabilitySetName $availabilityset -Name $vmname -ImageName " bd507d3a70934695bc2128e3e5a255ba__RightImage-Windows-2012-x64-v22.214.171.124" -AdminUsername $admin –Password $password After provisioning , you would be able to see the default endpoints. The default configuration of VM would be (A1 1 core, 1.75 GB Memory) with Standard Tier in order to put multiple VMs on same load-balanced endpoint & ease autoscaling . In next article, I would travel around PowerShell automation scripts using Run book utilizing Azure VM, Storage & Cloud services.