An Azure service that provides an integrated environment for bot development.
Hi Julien Ward,
Thanks for the detailed write-up — it really helps narrow this down.
From what you’ve described, your configuration and testing approach look solid. The behavior you’re seeing is consistent with a known limitation in the current preview integration between Azure AI Foundry agents and Copilot Studio when responses are surfaced through channels like Microsoft Teams and M365 Copilot.
What’s happening
In short:
- The Foundry agent is returning a valid response (confirmed by logs and Test environment)
However, in Teams/M365 channels, that raw response is passed through directly and fails at the client rendering layer, resulting in the SystemError
This explains why:
- It works in Copilot Studio Test
- It fails only in Teams/M365 UI
The orchestrator assumes the response was delivered (since backend succeeded)
Recommended approach
Since the issue is related to how responses are rendered in the channel, the most reliable workaround today is to avoid sending raw Foundry output directly to Teams and instead ensure it is always transformed into a channel-safe format.
Force response transformation in the orchestrator
Update your Copilot Studio instructions so that:
Any response received from an external (Foundry) agent must be reformatted or summarized before being returned to the user.
This ensures:
- Only plain text / simplified output is sent to Teams
Avoids unsupported payload structures that trigger SystemError
Introduce a “child agent” as a formatting layer
Instead of connecting the orchestrator directly to the Foundry agent:
Orchestrator → Child Agent → Foundry Agent
The child agent can:
Normalize the response
Strip unsupported structure
Return clean, channel-compatible output
This gives you more control than the current direct external agent connection (which is still in preview).
Additional best practices
- Keep responses concise and text-based (avoid complex JSON or rich structures)
- Limit overly large payloads
If using JSON, ensure it is **flattened and minimal
**Important note
At this time, this behavior is not caused by a misconfiguration, but rather by:
- Preview limitations of the external agent connection
Channel-specific rendering constraints in Teams/M365
Conclusion
The most effective way to stabilize your scenario today is to ensure all Foundry responses are reformatted by the orchestrator (or an intermediate agent) before being sent to Teams/M365.
This approach avoids the rendering issue and provides consistent behavior across channels, even with the current preview limitations.
Microsoft documentation
- SystemError behavior in Teams channel: https://learn.microsoft.com/en-us/microsoft-copilot-studio/publication-add-bot-to-microsoft-teams#systemerror-after-publishing-or-republishing-an-agent
- Copilot Studio channel publishing guidance: https://learn.microsoft.com/en-us/microsoft-copilot-studio/publication-add-bot-to-channels
- Azure AI Foundry + Copilot integration overview (preview): https://techcommunity.microsoft.com/blog/azure-ai-foundry-blog/integrate-custom-azure-ai-agents-with-copilot-studio-and-m365-copilot/4405070
Hope this helps. If you have any follow-up questions, please let me know. I would be happy to help.
Please do not forget to "Accept Answer" and "up-vote" wherever the information provided helps you, as this can be beneficial to other community members.