The following forum(s) are migrating to a new home on Microsoft Q&A (Preview): Azure Active Directory!

Ask new questions on Microsoft Q&A (Preview).
Interact with existing posts until December 13, 2019, after which content will be closed to all new and existing posts.

Learn More

 none
Get-AzureSubscription : Failed to refresh token. AADSTS90002: No service namespace named 'bad7c7c0-6e29-4835-a9d0-ca9abb92cc00' was found in the data store. RRS feed

  • Question

  • I am getting the following error where executing a Get-AzureSubscription command in PowerShell:

    Get-AzureSubscription : Failed to refresh token. AADSTS90002: No service namespace named
    'bad7c7c0-6e29-4835-a9d0-ca9abb92cc00' was found in the data store.
    Trace ID: 63faded1-eba4-4db8-940b-45e03507f8b3
    Correlation ID: 2a2407a5-f376-444f-aede-155246d351e5
    Timestamp: 2015-02-15 20:34:14Z: The remote server returned an error: (400) Bad Request.
    At line:1 char:1
    + Get-AzureSubscription
    + ~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : CloseError: (:) [Get-AzureSubscription], AadAuthenticationFailedException
        + FullyQualifiedErrorId : Microsoft.WindowsAzure.Commands.Profile.GetAzureSubscriptionCommand

    I have multiple subscriptions against the single account. It looks like there is a tenant that might be associated to that account locally, but doesn't exists when the REST call is made.  The results of the previous Add-AzureAccount look like:

    Id                             Type       Subscriptions                          Tenants
    --                             ----       -------------                          -------
    a@b.com                        User       7840d2da-7eb0-4caa-a8af-e69f387c3557   4ac2c945-49d5-4b59-8a70-a08dffe43dba
                                              93e37971-8b27-417e-ba9a-5616146d8459   1eb918d4-f729-42a4-a9a1-fba273056efc
                                                                                     b6e3c4ef-d100-4f2c-87b5-388fcf293435
                                                                                     bad7c7c0-6e29-4835-a9d0-ca9abb92cc00

    I did delete an AD domain from the management portal earlier, but by all accounts everything was successful.  I am not sure how that orphan tenant (bad7c7c0-6e29-4835-a9d0-ca9abb92cc00) is still around.  I am not sure if there is something wrong with my AD instance or if it is something on my end that can be cleaned up.

    Monday, February 16, 2015 1:45 PM

Answers

  • Hi,

    I could run the command with no issue.

    Please try to delete the content of the folder C:\Users\\AppData\Roaming\Windows Azure Powershell

    After which again run Add-AzureAccount to get the fresh one to check the result.

    Regards.


    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com

    • Marked as answer by JacobsRJ Tuesday, February 17, 2015 2:24 PM
    Tuesday, February 17, 2015 9:43 AM

All replies

  • Hi,

    I could run the command with no issue.

    Please try to delete the content of the folder C:\Users\\AppData\Roaming\Windows Azure Powershell

    After which again run Add-AzureAccount to get the fresh one to check the result.

    Regards.


    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com

    • Marked as answer by JacobsRJ Tuesday, February 17, 2015 2:24 PM
    Tuesday, February 17, 2015 9:43 AM
  • Hi Vivian,

    I tried the above solution but still i see that the orphan tenantid is associated after doing the Add-AzureAccount and I am getting the same error on Get-AzureSubscription.

    Is there any other configuration i need to fix in azure management portal?


    -Thanks TJ

    Monday, June 1, 2015 8:34 PM
  • If following the solution from Vivian the problem does not resolve as it happened in my case, close all the powershell running consoles and just delete the "Windows Azure Powershell" folder  under

    C:\Users\{{username}\AppData\Roaming\Windows Azure Powershell

    and run the Add-AzureAccount again. This worked for me.

    Thanks TJ


    -Thanks TJ

    Monday, June 1, 2015 10:07 PM