How To A Create Microsoft Azure Resource Group Using PowerShell

Continuing from my last article about AzureRM, this article will show you how to create a Microsoft Azure Resource Group using PowerShell script.

To get started login to Azure using the two lines below:


 Get-AzureRmSubscription | Sort SubscriptionName | Select SubscriptionName

Next select the subscription you will use to create the resource group:

$subscr="Azure Pass"

Get-AzureRmSubscription –SubscriptionName $subscr | Select-AzureRmSubscription 

Use the code below to create the actual resource group:



New-AzureRmResourceGroup -Name $rgName -Location $locName 

My recommendation will be to group the entire code and run it.