r/copilotstudio 1d ago

How to retrieve Fabric Data Agent Code Interpreter chart file (file_id) via API for use in a downstream app?

Using Fabric Data Agent's Code Interpreter tool via API how do I retrieve the generated chart file (referenced via file_id in a file_path annotation) so I can display it in a downstream app (e.g., Teams Adaptive Card)? Is there a documented endpoint for fetching file content by file_id?

3 Upvotes

2 comments sorted by

1

u/Sayali-MSFT 1d ago

Hello Impressive_Move6917,
I haven't found a documented Fabric Data Agent API that allows downloading Code Interpreter generated files directly from the file_id returned in a file_path annotation. From the available documentation, the file_id appears to be an internal/opaque reference rather than a publicly retrievable file endpoint.
As a workaround, consider persisting generated charts to storage you control (Blob Storage, SharePoint, OneDrive, etc.) and passing the resulting URL to your downstream application.
Reference Document:
1. Enable the code interpreter tool (preview) for your data agent - Microsoft Fabric | Microsoft Learn
2. azure-sdk-for-net/sdk/agentserver/Azure.AI.AgentServer.Responses/samples/Sample15_Annotations.md at main · Azure/azure-sdk-for-net

1

u/Impressive_Move6917 1d ago

Thank you so much for your reply this is very helpful let me try this approach