AADSTS90002 Tenant not found. Check to make sure you have the correct tenant ID and are signing into the correct cloudCheck with your subscription administrator, this may happen if there are no active subscriptions for the tenant

Sayr 1 Reputation point
2021-11-22T08:38:39.19+00:00

I'm trying to add authentication to the .NET core angular template project with the help of msal documentation in below url. However I'm getting the error as "AADSTS90002: Tenant 'xxxxx.onmicrosoft.com' not found. Check to make sure you have the correct tenant ID and are signing into the correct cloud. Check with your subscription administrator, this may happen if there are no active subscriptions for the tenant.

https://dev.to/theaswanson/adding-authentication-with-azure-ad-to-a-net-angular-web-app-with-msal-11a5.

I have used the above documentation which perfectly suits my requirement of using angular and WEB API as a single project

Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
19,455 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Shashi Shailaj 7,581 Reputation points Microsoft Employee
    2021-11-22T14:47:11.573+00:00

    @Sayr

    You may get this error if you have registered the application in a one azure AD cloud instance while you are trying to obtain the auth token from a different one. Azure AD is a service present in multiple different clouds on Azure . We have a public azure instance and non-public azure instance which are called National clouds . These are physically isolated instances of Azure. The national clouds were mainly designed to provide isolated data residency, sovereignty, and compliance requirements

    Azure AD authentication Endpoints and Microsoft Graph endpoints are different for national clouds. Please check the linked documents .

    You will need to check and update the appsettings.json file . Make sure you are setting up the correct Azure AD Instance URLs as per the ones listed in the documents above.

    "AzureAd": {  
        "Instance": "https://login.microsoftonline.com/",  
        "ClientId": "ENTER_CLIENT_ID_GUID_HERE",  
        "TenantId": "ENTER_TENANT_ID_GUID_HERE",  
        "Audience": "ENTER_CLIENT_ID_GUID_HERE"  
    }  
    

    Please take a look at JS sample for national clouds here . The authority value needs to be the one where you have registered your app service in this instance. Hope this will help fix your issue. Somewhere in your code you may have wrong values or you are parsing the tenant information by using email domain of the user which is not correct . This is the only reason for this specific error code . If the information is helpful please do accept the post as answer for the benefit of the community . Should this not help please let us know and we will be happy to help further.

    ----------------------------------------------------------------------------------------------------------------------------------------------------------

    • Please don't forget to click on 130616-image.png or upvote 130671-image.png button whenever the information provided helps you. Original posters help the community find answers faster by identifying the correct answer. Here is how
    • Want a reminder to come back and check responses? Here is how to subscribe to a notification
    • If you are interested in joining the VM program and help shape the future of Q&A: Here is how you can be part of Q&A Volunteer Moderators
    0 comments No comments