A unified Azure platform for creating and managing AI models, agents, and applications with built‑in enterprise security, monitoring, and governance
Hi Viktoriia,
Both things you're seeing — the publish-time HTTP 400 "obtaining user token" and the silent bot with no Foundry trace — come from a single root cause: the Foundry publish flow provisions a SingleTenant Azure Bot whose MicrosoftAppTenantId is your home tenant, and a SingleTenant bot's token validation is bound to that one tenant.
- Why it's silent in Teams: a message from the other tenant arrives with a token issued by that tenant. The bot's auth layer validates the JWT issuer/audience against its home tenant, so the activity is rejected before it reaches your agent endpoint — which is exactly why no new run shows up in Foundry Traces and you see no error.
- Why publish 400s: the publish pipeline's user-token exchange is operating against the home-tenant SingleTenant identity while you're targeting a different tenant, so obtaining the user token fails. The Bot/channel resources still get created (that's just ARM), but the cross-tenant auth wiring never gets established.
So, to answer your questions directly:
- Cross-tenant sideloading of a Foundry-created SingleTenant bot isn't a supported scenario. The one-click Publish-to-Teams flow assumes the agent, project, Azure Bot, and Teams usage all live in the same tenant (the publish scopes "Just you" / "People in your organization" are tenant-scoped). There's no documented cross-tenant distribution path. It's also worth noting new multi-tenant bot creation was deprecated after July 31, 2025, which is why the flow builds SingleTenant bots and why cross-tenant is genuinely hard here.
- Extra steps exist but are manual, partial, and unsupported. The only real levers are at the app-registration level (not the bot's
msaAppType): set Supported account types → "Accounts in any organizational directory," grant admin consent in the target tenant via the adminconsent URL (client_id=bot app id,redirect_uri=https://token.botframework.com/.auth/web/redirect), and sideload/approve the Teams app in that tenant. A closely matching community case got cross-tenant working this way — but their final fix required correctCloudAdapterinitialization in their own bot code, which the Foundry-hosted relay abstracts away from you. So steps above are worth trying, but the hosted relay may still not validate cross-tenant tokens. - Diagnostics are limited: enable Application Insights on the Azure Bot and look for inbound Teams activities and 401/Unauthorized at the auth layer. If you see no inbound activity at all, that confirms the rejection is happening at the token/channel layer (matching the missing Foundry trace). Detailed token-exchange diagnostics beyond that are a known gap today.
My recommendation: if the agent needs to serve users in another org, the supported approach is to provision the Foundry project + agent + Azure Bot in that tenant (same-tenant publish), rather than cross-tenant sideloading the home-tenant bot. If cross-tenant is a hard requirement, treat the app-registration + admin-consent steps as best-effort and validate via App Insights — but as of today, first-class cross-tenant distribution of a Foundry agent to Teams isn't a shipped capability.
Kindly let us know if the above helps or you need further assistance on this issue.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".