Teams error AADSTS90002: Tenant not found
Last verified against Microsoft Learn - Status codes from bot conversational APIs
InvalidTenantName - The tenant name wasn't found in the data store. Check to make sure you have the correct tenant ID.What error AADSTS90002 means
The token request went to a tenant Microsoft Entra doesn't know. The reference describes AADSTS90002 as "InvalidTenantName - The tenant name wasn't found in the data store. Check to make sure you have the correct tenant ID," and adds the two usual stories: "a cross-cloud app was used against the wrong cloud, or the developer attempted to sign in to a tenant derived from an email address, but the domain isn't registered."
For a Teams bot, the tenant appears in the token URL. Single-tenant bots request tokens from https://login.microsoftonline.com/{tenant}/oauth2/v2.0/token, with the tenant taken from MicrosoftAppTenantId. If that value has a typo, contains a domain that isn't a verified domain of the directory, or holds a placeholder from a sample, Entra can't resolve it and fails before looking at your app ID or secret.
The cross-cloud case matters for government and sovereign deployments. A tenant that lives in another Microsoft cloud isn't found by the public cloud's login endpoint, so check which cloud the tenant belongs to before debugging anything else. Once the tenant resolves, any remaining app or secret problem surfaces as its own code, such as AADSTS700016.
What it looks like
POST https://login.microsoftonline.com/{tenant}/oauth2/v2.0/token
{
"error_description": "AADSTS90002: Tenant '...' not found. ...",
"error_codes": [90002]
}Why it happens
- A typo or truncated GUID in MicrosoftAppTenantId.
- A domain name used instead of the tenant ID, where the domain isn't verified in that directory.
- A placeholder or sample tenant value left in configuration.
- The tenant belongs to a different Microsoft cloud than the login endpoint you are calling.
How to fix Teams error AADSTS90002
- 1Copy the Directory (tenant) ID from the app registration's Overview page and paste it into MicrosoftAppTenantId.
- 2Prefer the tenant GUID over a domain name in bot configuration.
- 3Confirm which cloud the tenant is in and use that cloud's login and Bot Framework endpoints.
- 4Request a token manually against the corrected tenant URL and confirm it succeeds before redeploying.
How to stop it recurring
Store tenant ID, app ID, and app type together with the secret, and validate the tenant GUID format at startup. For bots deployed to more than one cloud, keep endpoints per environment in configuration rather than in code. A post-deploy token check against the configured authority catches a bad tenant value before users do.
Official reference: Microsoft Learn - Status codes from bot conversational APIs. See all Teams error codes or the Teams limits and quotas.
Related codes
- 401 Unauthorized (tenant mismatch): Single-tenant vs multi-tenant mismatchAADSTS700016: The application wasn't found in the directory/tenant.
- AADSTS7000218: Client secret missing from token requestThe request body must contain the following parameter: 'client_assertion' or…
- 401 Unauthorized (invalid app ID / password): Invalid Microsoft App ID or passwordAADSTS7000215: Invalid client secret provided.
- 403 InvalidBotApiHost: InvalidBotApiHost - wrong cloud endpoint (GCC)Invalid agent api host. For GCC tenants, call…
Error AADSTS90002 - quick answers
What does Teams error AADSTS90002 mean?
The token request went to a tenant Microsoft Entra doesn't know. The reference describes AADSTS90002 as "InvalidTenantName - The tenant name wasn't found in the data store.
How do I fix Teams error AADSTS90002?
1. Copy the Directory (tenant) ID from the app registration's Overview page and paste it into MicrosoftAppTenantId. 2. Prefer the tenant GUID over a domain name in bot configuration. 3. Confirm which cloud the tenant is in and use that cloud's login and Bot Framework endpoints. 4. Request a token manually against the corrected tenant URL and confirm it succeeds before redeploying.
Stop debugging Teams by hand
Connect the channel through Conferbot: tokens, webhooks and retries are handled, failures show as readable status.