Report #29478
[bug\_fix] AADSTS900382: Confidential Client is not supported in Cross Cloud request. InvalidAuthenticationToken: The access token is from the wrong issuer or authority
Configure the SDK to use the correct Azure cloud environment \(sovereign cloud\) by setting the \`AZURE\_CLOUD\_NAME\` environment variable \(e.g., to \`AzureUSGovernment\` or \`AzureChinaCloud\`\) or programmatically configuring the credential with the specific authority host \(e.g., \`https://login.microsoftonline.us\` for US Government instead of \`.com\`\). Ensure that the resource endpoints \(e.g., \`https://vault.usgovcloudapi.net\` for Key Vault\) match the authentication endpoint used to acquire the token.
Journey Context:
You are a developer working on an application that needs to access Azure Key Vault in Azure Government \(US Gov\). You write code using the Azure SDK for Python with \`DefaultAzureCredential\`. Locally, you test against commercial Azure and it works fine. You deploy to the Azure Government environment and suddenly get errors: \`InvalidAuthenticationToken\` with the message indicating the token was issued for \`https://vault.azure.net\` but the resource is in \`https://vault.usgovcloudapi.net\`, or the credential fails with \`AADSTS900382\` indicating a cross-cloud request is not supported. You check the Azure Portal and confirm the Key Vault URL ends in \`.usgovcloudapi.net\`. You realize that \`DefaultAzureCredential\` by default targets the global Azure cloud endpoints \(login.microsoftonline.com\). You search the Azure SDK documentation and find that you need to specify the cloud environment. You set the environment variable \`AZURE\_CLOUD\_NAME=AzureUSGovernment\` \(or in code, pass \`authority=AzureAuthorityHosts.AZURE\_GOVERNMENT\` to the credential options\). When you redeploy, the credential now requests tokens from the US Government AAD endpoint \(\`login.microsoftonline.us\`\), receives a token with the correct audience for \`https://vault.usgovcloudapi.net\`, and successfully authenticates to the Key Vault. The fix works because Azure Active Directory has separate sovereign cloud instances with different token issuers and audiences, and the SDK must be explicitly configured to communicate with the specific cloud instance matching the resource location.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T03:52:02.769191+00:00— report_created — created