An Azure service that provides an integrated environment for bot development.
Hi JDA,
This behavior usually happens because the agent is being called in a different way when it runs in Microsoft Teams compared to the Foundry chat interface.
When you test an agent in the Foundry chat or playground, Foundry automatically manages the conversation context for you. When the same agent is used through Teams, the request goes through Azure Bot Service first, and the conversation handling is stricter. If the conversation state is missing or expired, Teams returns a conversation not found error.
A few things are worth checking.
- Confirm that the agent is correctly published to Teams using Azure Bot Service. The agent must be connected to a Bot Service channel, and the Teams channel must be enabled. If the agent works in Foundry chat but fails in Teams, it usually means the Bot Service layer is involved rather than the model or agent itself.
- Verify that conversation state is being preserved correctly. Teams expects each message to belong to an active conversation. If the bot or agent loses that context, Teams cannot find the conversation and throws a conversation not found error. This often happens if the agent execution takes too long or if conversation identifiers are not reused correctly between messages.
- Check managed identity and permissions. Teams bots run under the published agent application identity, which is different from the identity used in the Foundry playground. If permissions were granted only at the project level and not to the published agent identity, the bot may fail only in Teams.
- Keep agent responses fast and simple. Teams has tighter time limits than the Foundry chat interface. If the agent response takes too long, Teams may drop the conversation and report it as missing. Reducing tool calls and keeping responses efficient often helps stabilize Teams behavior.
In summary, the agent itself is usually fine since it works in Foundry chat. The issue is typically related to conversation state handling, identity differences after publishing, or Teams timing constraints.
Official reference:
- Test in Web Chat: https://docs.microsoft.com/azure/bot-service/bot-service-quickstart?view=azure-bot-service-4.0#test-the-bot-1
- Connect a bot to channels: https://docs.microsoft.com/azure/bot-service/bot-service-manage-channels
- Copilot Chat Plugin Returning 500: https://supportability.visualstudio.com/Modern%20Workplace/_wiki/wikis/Modern%20Workplace/1411401
- Troubleshoot 500-series errors: https://docs.microsoft.com/azure/bot-service/bot-service-troubleshoot-500-errors?view=azure-bot-service-4.0
- https://dotnet.territoriali.olinfo.it/en-us/microsoftteams/platform/bots/how-to/conversations/conversation-basics
- https://dotnet.territoriali.olinfo.it/en-us/azure/bot-service/bot-service-overview
Do let me know if you have any further queries.
Thankyou!