windows_azure_powershellOn 23 November 2015, Microsoft announced the release of Azure PowerShell 1.0, and with it support for Azure Resource Manager. On 2 December 2015, Microsoft also announced the general availability of the Azure Portal which became the default portal for Azure.

The effects of these announcements are still being assessed, and one of the first observations is that Azure Powershell 0.9 and 1.0 will both continue to be supported. This means that the old way of accessing Azure is still available. However, Powershell 1.0 now provides support for Resource Manager/Groups which is a resource feature of the new Portal. Access to the Resource Manager/Groups is through new cmdlets that are easily identified as they have ‘AzureRM’ or ‘RM’ within the name.

There are significant benefits to using Powershell 1.0, and this post is intended to make it as easy as possible to get connect to a Microsoft Azure subscription using PowerShell 1.0.

Before you can manage your subscription, your machine will need to have Azure PowerShell installed. Depending on the machine OS, there maybe a few pre-requisites that need to be installed. For example, Windows 7 will need Windows PowerShell 3.0 or later installed, whereas Windows 10 does not require anything.

There are two ways to install Azure PowerShell: using the Microsoft Web Installer or the standalone msi.  The web installer can be found here, and the msi can be found here.

Once installed, start Azure PowerShell using Run as administrator.

  1. To connect to your subscription, enter Login-AzureRmAccount
  1. This will open an Azure authentication window where you enter your login details.

Azure authentication window

  1. Once authenticated, your subscription details are returned.

azure powershell authentication

N.B. For those that have multiple subscriptions it’s important to set one as the current subscription at the beginning of every PowerShell session.

  1. Type Get-AzureRmSubscription | sort SubscriptionName | Select SubscriptionName and Enter.
  1. Type Select-AzureRmSubscription -SubscriptionName “<SubscriptionName>” and Enter to nominate the subscription

azure powershell select subscription

 

With the correct subscription selected, any Azure commands executed will be specifically against those subscriptions resources.

To quickly see the available cmdlets related to Powershell 1.0 and Resource Manager, type either:

  • Get-Help *AzureRM*
  • Get-Command –Noun AzureRM*