Azure AI Foundry Agent Works in Studio but Fails When Deployed to Microsoft Teams

Claire Sullivan 0 Reputation points
2026-10-15T01:44:46.2633333+00:00

I developed an agent in Microsoft Foundry that uses Logic Apps MCP tools to query and update data in a database. The agent works correctly in Foundry Studio, but after publishing to Microsoft Teams, it times out and fails with any prompt.

Observed behavior:

  • The agent is available to add in teams but times out and gives no response when prompted.

No Logic App runs are triggered when the agent is used in Teams.

No traces appear in Foundry for the Teams interactions.

  • The Microsoft 365 Agent Registry shows two entries for the agent. The Teams-published entry does not display any tools, while the underlying Foundry agent does. (assuming one entry is the web agent and another is the teams agent?)

User assignment controls are disabled for the underlying agent, despite having Owner and Foundry User roles.

Troubleshooting completed:

  • Confirmed both MCP tools work correctly in Foundry Studio.
  • Verified the Teams deployment appears in the Microsoft 365 Agent Registry.
  • Assigned the Foundry User role and reviewed resource permissions.
  • Checked Logic App run history and Foundry tracing.
  • Tested the agent in web through Bot Services settings, no issues.

Anyone else had this issue and resolved it?

Foundry Agent Service
Foundry Agent Service

A fully managed platform in Microsoft Foundry for hosting, scaling, and securing AI agents built with any supported framework or model

0 comments No comments

2 answers

Sort by: Most helpful
  1. AI answer

    2026-10-15T15:08:18.2066667+00:00

    Because Teams requests produce neither Foundry traces nor Logic App runs, first verify that the published Activity Protocol endpoint is being invoked; only troubleshoot the MCP identity after a Teams request reaches Foundry.

    1. Isolate the Teams invocation path

    1. Reset the Teams conversation by sending:
         /foundry_new_preview
      
      A tool error can lock a conversation so subsequent messages continue failing. This command creates a fresh session; the previous conversation cannot be restored.^1^
    2. Temporarily publish or route a version that can answer a simple prompt without invoking either MCP tool.
      • If that also creates no trace and times out, investigate endpoint authorization/networking below.
      • If it responds, but a tool-required prompt fails, proceed to the published identity and MCP checks.
    3. Confirm tracing is enabled for the project and that the connected Application Insights resource is accessible. Without that setup, an empty trace view does not prove that Teams never reached Foundry.^2^

    Teams invokes the published application through the Activity Protocol, not the Responses API used by direct application tests.^3^

    2. Check endpoint authorization

    Inspect the published agent endpoint’s authorization_schemes. If it contains BotServiceRbac, store visibility does not grant invocation permission.

    • For selected users, assign Foundry Agent Consumer at the agent or project scope—not merely Foundry User on the underlying development resource.
    • For tenant-wide access, publish with People in your organization, obtain Microsoft 365 administrator approval, and then replace BotServiceRbac with BotServiceTenant using the documented PATCH procedure.
    • Do not configure both Bot Service schemes.^4^

    For one selected user, the documented agent-scope assignment is:

    AGENT_SCOPE="/subscriptions/[Subscription ID] ID]/resourceGroups/[Resource Group] Group]/providers/Microsoft.CognitiveServices/accounts/<account-name>/projects/<project-name>/agents/<agent-name>"
    
    az role assignment create \
      --assignee-object-id "<user-object-id>" \
      --assignee-principal-type User \
      --role "eed3b665-ab3a-47b6-8f48-c9382fb1dad6" \
      --scope "$AGENT_SCOPE"
    

    Allow several minutes for propagation, then reset the Teams conversation and retest.^4^

    3. Check networking if public access is disabled

    If the Foundry project disables public network access, Teams traffic does not use Private Link. The REST publishing configuration must set:

    {
      "agent_endpoint": {
        "protocol_configuration": {
          "activity": {
            "enable_m365_public_endpoint": true
          }
        }
      }
    }
    

    Microsoft 365 and Teams use this source-IP-filtered public Activity Protocol route. A missing or false setting can produce 403 NetworkAccessDenied at the channel adapter.^5^

    4. After Teams reaches Foundry, validate the published identity

    Publishing creates a dedicated agent identity; permissions assigned to the project identity do not transfer automatically.^6^

    Retrieve the published application’s agentIdentityId, then grant that principal the downstream permissions required by the Logic Apps MCP connection. For an MCP server that triggers Logic Apps, Microsoft lists Logic Apps Standard Operator on the Logic App resource as the common role assignment.^6^

    Also check the Teams conversation for an MCP approval card. If approval was dismissed or missed, start a new conversation and approve the pending request.^1^

    The two registry entries and the Teams entry’s empty tool display do not, by themselves, establish whether tool discovery failed. The decisive evidence is the Activity Protocol request, endpoint authorization, and—once a trace exists—the MCP tool-discovery/tool-call result.

    5. Formatting fallback

    If traces eventually show successful execution and the direct endpoint works, but Teams still fails while rendering the answer, test plain-text output without Markdown tables, citation markup, or complex layouts. That resolved a similar Teams/Copilot case, but that case had successful endpoint execution and therefore does not explain the current no-trace symptom.^7^

    Published agents formally do not support streaming responses or citations.^5^


    References

    1. Troubleshoot publishing agents to Microsoft Copilot and Microsoft Teams
    2. Agent tracing overview - Microsoft Foundry | Microsoft Learn
    3. Publish your agent as an Agent Application
    4. Troubleshoot authorization errors for agents published to Microsoft Copilot and Teams
    5. Publish agents to Microsoft 365 and Teams by using the REST API ...
    6. Agent identity concepts in Microsoft Foundry
    7. Published Azure AI Foundry Agent not working in Teams when adding tools like AI Search - Microsoft Q&A
    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

  2. Rukshan edirisinghe 1,805 Reputation points
    2026-10-15T03:16:37.57+00:00

    Hi @Claire Sullivan

    "Works in the Foundry playground, fails after publishing" is a case Microsoft's troubleshooting page calls out directly. In Studio, the tools run with your permissions. Once the agent is published, it runs under its own agent identity, and that identity usually doesn't have access to the resources behind the tools yet. That also fits the second registry entry you see (the published agent application) and no Logic App runs being triggered.

    What I'd do:

    1. In Foundry, open the agent's publish/configuration details and note the agent identity it runs as. Also check that this identity is enabled, since a disabled one causes the same silent failure.
    2. Assign that identity the roles it needs on each Azure resource the tools touch: the Logic App(s) behind the MCP tools, and anything else they call with Azure auth.
    3. If your MCP tools are set to require approval, remember Teams has to show an approval card. If it was missed, the call never goes out.
    4. Start a fresh conversation in Teams by sending /foundry_new_preview. A conversation that hit a tool error can stay locked and keep failing even after you fix the cause.
    5. Test again and check the Logic App run history.

    On the disabled user assignment controls: published agents use the BotServiceRbac scheme for "just you" sharing and BotServiceTenant for org-wide sharing. The org-wide option needs Microsoft 365 admin approval, which could explain why those controls are greyed out for you.

    Which scope did you publish it with, just you or people in your organization?

    If this resolved your issue, please consider accepting it as the answer. If the Logic App still never fires after the roles are in place, let me know and I'll be happy to keep helping.

    Reference:

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.