How to Change the Default Azure RM subscription

Mikee picture Mikee · Dec 5, 2016 · Viewed 48.8k times · Source

ASM had the ability to change the default subscription with the -Default (and now deprecated) parameter

Select-AzureSubscription -Default

but the ARM version

Select-AzureRMSubscription 

does not have the -Default parameter.

How can I change the default ARM subscription? It is very annoying that my default is a subscription that I never use.

Edit for clarification: When I say change default subscription I mean the default subscription that you are connected to with each new PowerShell session.

Answer

Clavin Fernandes picture Clavin Fernandes · May 23, 2017

Step 1: Get-AzureRmSubscription

It will List all your subscriptions.

Step 2: Select-AzureRmSubscription -SubscriptionId xxxxx-xxxxx-xxxxxx-xxxx

The SubscriptionID can be found in the output of the Get-AzureRmSubscription. You can also use the SubscriptionName.

Step 3: (Get-AzureRmContext).Subscription

Confirm that you have selected the right subscription.