19

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

gmetzker
  • 585
  • 1
  • 8
  • 22
  • 1
    I had the owner of the old account remove me as a co-admin and it remove this so it is no longer the default. It still would be nice to know how to switch the default manually. – gmetzker Dec 23 '13 at 20:05
  • As of Dec 2015, I'm yet to find an easy way to set a subscription as default (other than trying out the options suggested by @yossi-dahan). Though I was removed as a co-admin, it still shows up in the dropdown of my list of subscriptions in the new portal (although not in the old portal or via PS). Clicking on that subscription however correctly says I don't have access. Wish there is a convenient way to distinguish between subscriptions when there are multiple – mvark Dec 29 '15 at 07:23
  • This is an open issue for sometime now and only a lot of votes here can probably cause a change to happen - https://feedback.azure.com/forums/223579-azure-portal/suggestions/6239996-choose-default-directory – mvark Dec 29 '15 at 07:35
  • This is causing an issue with me trying to use Microsoft Learning, which wants to create temporary training sandbox, on my account which has multiple subscriptions, each with a different permission. :-( – djangofan Dec 22 '20 at 17:38

8 Answers8

7

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.

BitSchupser
  • 432
  • 3
  • 13
  • This solves the problem till the next login. Any chance we can permanently change the default subscription? – Rafs Nov 07 '22 at 12:00
4

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

n8thanael
  • 330
  • 3
  • 10
3

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/@
Yossi Dahan
  • 5,389
  • 2
  • 28
  • 50
  • 1
    For #1, I don't think I can remove myself from this subscription. I don't appear to have access to it (other than seeing it in the drop down). For #2, this will get me there the same as the changing the subscription in the drop down. But it seems like there should be some way of changing it so the correct account comes up by default. – gmetzker Dec 23 '13 at 18:38
  • If the subscription is in the dropdown and you can select it, then you should still have access to you. You can remove yourself as a co-admin from a subscription. – mcollier Dec 23 '13 at 19:04
  • ...as mcollier said :-). I appreciate this is not the answer you wanted to get, but I think that's all that is possible at this point. – Yossi Dahan Dec 24 '13 at 09:12
  • 3
    Well, there's definitely a way to make one the default and the others not -- for example, on the `Microsoft.WindowsAzure.Commands.Profile.Models.PSAzureSubscription` object (which is what PowerShell returns) there is an `IsDefault` property, that refelects the portal's behavior, but for the life of me, I can't figure out how to update the value and round trip it back to Azure so that it gets applied. – BrainSlugs83 Nov 22 '14 at 01:14
2

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

   1)  Add-AzureAccount;
   2)  Get-AzureSubscription;
   3)  Select-AzureSubscription -SubscriptionName <YourSubscriptionName> 
Murray Foxcroft
  • 12,785
  • 7
  • 58
  • 86
1

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.

Ahmed Khashaba
  • 788
  • 7
  • 14
1

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

grbonk
  • 609
  • 6
  • 22
1

[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

Louis Teo
  • 24
  • 6
0

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

Blue Clouds
  • 7,295
  • 4
  • 71
  • 112