fairfax Availability tablesEndpoints Sign-in errorsGitHubPyPI

fairfax / Sign-in errors / AADSTS90038

AADSTS90038: NationalCloudTenantRedirection

The tenant you're signing in to belongs to a different national cloud from the sign-in host you used, and the two clouds don't federate. Typical cause: a GCC High, DoD or Azure Government tenant reached through login.microsoftonline.com, or the other way round.

How to fix it

Send the request to the sign-in host of the tenant's own cloud.

Your tenant or subscriptionSign-in host
Commercial Microsoft 365 and Azure, and GCC tenantslogin.microsoftonline.com
GCC High and DoD tenants, and Azure Governmentlogin.microsoftonline.us

What Microsoft says

“AADSTS90038 | NationalCloudTenantRedirection - The specified tenant 'Y' belongs to the National Cloud 'X'. Current cloud instance 'Z' does not federate with X. A cloud redirect error is returned.”

Source: Microsoft Entra authentication and authorization error codes, page updated 2026-06-15, checked 2026-10-12.

Decode it from the command line

pip install fairfax
fairfax explain AADSTS90038 --tenant gcchigh      # or paste the whole error message

To find the commercial sign-in host in your code before it fails, run fairfax scan src/ --tenant gcchigh --azure government.

Other cross-cloud sign-in errors