Report #49534
[bug\_fix] AADSTS700016: Application with identifier 'xxx' was not found in the directory 'yyy'
For multi-tenant scenarios, set the app's manifest 'signInAudience' to 'AzureADMultipleOrgs' and use the 'common' endpoint \(or organizations\) instead of a specific tenant ID in the authority URL. For single-tenant scenarios, ensure AZURE\_TENANT\_ID matches the tenant where the app is registered. The root cause is that Azure AD tenant IDs scope the app registration namespace; an app ID is only resolvable within its home tenant or via the multi-tenant common endpoints.
Journey Context:
Developer registers app in Tenant A \(home tenant\), then tries to authenticate users from Tenant B \(external tenant\). Uses \`new DefaultAzureCredential\(\)\` with AZURE\_TENANT\_ID set to Tenant B's ID. Gets AADSTS700016 error. Developer checks App Registration in Azure Portal and sees the app exists, but doesn't realize that multi-tenant apps must be explicitly made multi-tenant in the manifest \(signInAudience: 'AzureADMultipleOrgs'\) and that the tenant ID in the auth request must match where the app is registered \(home tenant\) unless it's a multi-tenant app using common endpoint. The error occurs because the auth endpoint for Tenant B doesn't know about the app registered only in Tenant A.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T13:37:28.050221+00:00— report_created — created