You’ve signed up for a Microsoft Azure account and you’ve installed the Azure Resource Manager PowerShell cmdlets on your computer.
Install-Module -Name AzureRM -Force
You login to Azure from PowerShell. You’ll normally see most people use
that command is an alias (Login isn’t an approved verb).
Get-Alias -Definition Add-AzureRmAccount
Login to Azure and provide the account login information when prompted:
Several of the cmdlets in the Azure Resource Manager PowerShell module require a location (a region) to be specified when creating things. To me, showing the regions in the PowerShell console, figuring out which region I want, and then storing it in a variable is a bit haphazard.
I’ve found that using
Out-GridView makes the process simpler:
$Region = ( Get-AzureRmLocation | Sort-Object -Property Location | Select-Object -Property Location, Displayname | Out-GridView -OutputMode Single -Title 'Select an Azure Region' ).Location
Now the region that I selected is stored in a variable that I can use when creating items in Azure:
Out-GridView cmdlet existed in PowerShell version 2.0, you’ll need PowerShell version
3.0 to use it as shown in this blog article. The
OutputMode parameter of
Out-GridView which is
used in this blog article was added in PowerShell version 3.0. Also,
Out-GridView can only be used
on operating systems with a GUI (it cannot be used on server core).
As far as I know, there’s no way to set a default region in Azure like there is with the AWS
Initialize-AWSDefaultConfiguration cmdlet. I guess if you really wanted to set a default, you
could always use
to set a default value for the
Location parameter for the cmdlets that require it.