How to set the default subscription in the Windows Azure Portal?

24.5k views Asked by At

When I log into the Windows Azure Portal it sets my default subscription to a friend's account that I no longer have access to. I would like to set the account to my account as the default.

If I click on the Subscriptions icon it has a list "Filter By Directory", it lists all my subscriptions. The one I no longer have access to is listed as the "Default Directory". How do I change this.

When I log in the URL directs me to something like: https://manage.windowsazure.com/@[SomeAccount]hotmail.onmicrosoft.com

where [SomeAccount] is the name of the subscription I no longer want. Any idea why this is showing up as the default when I login? Is there a way to get rid of this, or set my own subscription as the default when I login.

enter image description here

9

There are 9 answers

4
Yossi Dahan On

The dropdown shows all directories which list you as an administrator and I believe they are simply listed alphabetically.

I don't think you can permanently filter the dropdown list and so you have two options -

  1. Make sure you are no-longer an administrator of any subscription you don't intend to use
  2. Bookmark a link that goes directly to the directory you wish to use. this will be windowsazure.com/@
0
Louis Teo On

[UPDATE 2021] You can change the default Azure Directory by first going to your own Azure Portal. https://portal.azure.com/yourdirectoryname.onmicrosoft.com

Click on your profile name at the top right of Azure Portal and click "Switch Directory".

You will be able to see: Current directory : "current directory" Startup directory : "current directory" (change)

Image of Azure Portal Settings - Directory

Click on "Change" and scroll down to "Startup Views", under "Select a directory" button, select the correct directory and click "Apply".

Image of Azure Portal Settings - Appearance + startup views

0
grbonk On

I used the CLI from a windows command prompt.

C:\Users\gbonk>azure account list
info:    Executing command account list
data:    Name           Id                                    Current  State
data:    -------------  ------------------------------------  -------  --------
data:    Free Trial     ********-****-****-****-************  false    Disabled
data:    Pay-As-You-Go  ********-****-****-****-************  true     Enabled
info:    account list command OK

Looking at the 'account show' you can see that the Pay account is NOT currently the default.

C:\Users\gbonk>azure account show Pay-As-You-Go
info:    Executing command account show
data:    Name                        : Pay-As-You-Go
data:    ID                          : ********-****-****-****-************
data:    State                       : Enabled
data:    Tenant ID                   : ********-****-****-****-************
data:    Is Default                  : false
data:    Environment                 : AzureCloud
data:    Has Certificate             : No
data:    Has Access Token            : Yes
data:    User name                   : gbonk
data:
info:    account show command OK

After executing the following command the Pay subscription became my default

C:\Users\gbonk>azure account set Pay-As-You-Go
info:    Executing command account set
info:    Setting subscription to "Pay-As-You-Go" with id "********-****-****-****-************".
info:    Changes saved
info:    account set command OK

The Pay subscription is now my default

C:\Users\gbonk>azure account show Pay-As-You-Go
info:    Executing command account show
data:    Name                        : Pay-As-You-Go
data:    ID                          : ********-****-****-****-************
data:    State                       : Enabled
data:    Tenant ID                   : ********-****-****-****-************
data:    Is Default                  : true
data:    Environment                 : AzureCloud
data:    Has Certificate             : No
data:    Has Access Token            : Yes
data:    User name                   : gbonk
data:
info:    account show command OK

You can also check this in ~/.azure/azureProfile.json

1
n8thanael On

I disabled an unwanted subscription, but the dashboard still showed this disabled subscription as the default.

To set the default to my desired subscription, I did this:

  1. https://portal.azure.com/#settings/directory
  2. Toggle "Advanced Filters" slider to "on" (top right)
  3. Go to "Advanced Filters" sidebar (left)
  4. Push " + Create a filter " link/button
  5. Filter Type Dropdown: "Subscription name"
  6. Value Dropdown: [X] Your Subscription

More information can be found here: https://learn.microsoft.com/en-us/azure/azure-portal/set-preferences#subscription-filters

0
Murray Foxcroft On

This worked for me in PowerShell with the Azure commands installed:

   1)  Add-AzureAccount;
   2)  Get-AzureSubscription;
   3)  Select-AzureSubscription -SubscriptionName <YourSubscriptionName> 
0
Ahmed Khashaba On

at the time of writing this, azure team did't fix this problem yet

but here's two ways to work around, both of them works for me:

  1. Include the directory name as part of the URL, for example: https://portal.azure.com/directoryname.onmicrosoft.com

  2. Go to the old portal. https://manage.windowsazure.com and then select Subscriptions at the top of the screen and from FILTER BY DIRECTORY make sure you're selecting you own subscription -the one you're the admin of it, not a co admin- then select Manage subscriptions/directory. choose your main subscription and press EDIT DIRECTORY link in the task bar (bottom of screen) and Change the directory field to the directory you want to default to.

0
Blue Clouds On

Latest 2020 Jan: we can do this. in portal->subscriptions->(top left)

"Showing subscriptions in <company>. Don't see a subscription?
Switch directories "

This 'Switch directories' will help you switch to the default

0
Alex Monkey On

The default subscriptions can be set in Azure Portal directly.

  1. Click the gear icon in the top-right corner.
  2. Click the "Default subscription filter" dropdown.
  3. Deselect everything.
  4. Tick the subscription(s) you want to be included by default.

Done enter image description here

1
BitSchupser On

Using Azure CLI you can set it easily:

az account set -s <id>

Do get the <id> you can list all the available subscriptions with

az account list

and copy the corresponding id property.