How to set my default Azure Subscription

When using the Azure PowerShell module with multiple Azure Subscriptions it can be a challenge to keep track of which subscription you are using. Luckily there is a cmdlet that lets you set the current subscription and even identify a default for all future sessions.

You will need the subscription name for use with the Select-AzureSubscription cmdlet. You can use the Get-AzureSubscription cmdlet to get a list of all your available subscriptions.  Now simply use the -Current and -Default switches with your desired subscription.
Select-AzureSubscription -SubscriptionName ContosoEngineering -Current
Select-AzureSubscription -SubscriptionName ContosoEngineering –Default
Note that I was never able to use both -Current and -Default at the same time. I had to issue two separate commands.

Pingbacks and trackbacks (2)+

Comments are closed