Changing the default subscription – Microsoft Azure PowerShell

I had a great day at Microsoft in London today learning a bit more about the potential of Microsoft Azure for IaaS, PaaS and SaaS. There is no better place to be if you hit a snag than with the experts themselves.

We were all stumped for a short while when confronted with being unable to get the details of our Azure VMs in my lab environment before realising that the problem was due to the fact that Azure did not have my correct subscription set as default. After much Googling and little answers, PowerShell ISE came to the rescue when we had resorted to looking through the available commands to try and locate the answer.

If you are in the position where you need to change the subscription that your PowerShell session is using as default here are the steps:

1. Get a list of all your subscriptions using Get-AzureSubscription | ft -Autosize

2. When you have the SubscriptionName for the subscription you want as your default, run the following command to set it:

Select-AzureSubscription -SubscriptionName #TheNameOfYourSubscription# -Default

Hopefully this help you if you are ever in this situation. If you have any Azure related questions, please get in contact in the comments section below.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s