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 or upvote 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