Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us at FabCon Vienna from September 15-18, 2025, for the ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM. Get registered

Reply
Shiyao
Microsoft Employee
Microsoft Employee

Fabric data agent

I created a Fabric data agent and connected it as a knowledge source via Azure AI Foundry agent. I also developed a custom python application and run the Azure AI Foundry agent. But the run info of the agent only shows input and output (with some obfuscated tags like【92:0†source】) of the connected Fabric data agent, not the SQL query code it uses in response. Is it possible to fetch this SQL query Fabric data agent generates within agent run via Azure AI Projects Python SDK.

1 REPLY 1
v-agajavelly
Community Support
Community Support

Hi @Shiyao 

Based on the latest documentation and updates, the Fabric Data Agent Python SDK does allow for programmatic interaction with data agents, including evaluation and inspection of responses. However, it does not currently expose the raw SQL queries generated by the Fabric data agent during a run via the Azure AI Projects Python SDK.

The obfuscated tags like 【92:0†source】 are part of the internal referencing system used to trace back to the knowledge source, but they don’t reveal the actual SQL logic used behind the scenes.

You can, evaluate agent responses using structured test sets. Retrieve detailed logs and evaluation summaries and customize evaluation prompts to judge answer quality.

For official guidance, check out.

If you're aiming to debug or audit the SQL logic, your best bet might be to use a custom critic prompt during evaluation that asks the agent to explain its reasoning or inferred query logic.
------------------------------------------------------------------------------------------------------------------------------
If this solution works for you, please consider marking it as accepted so others facing a similar issue can benefit too.

Regards,
Akhil.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

May FBC25 Carousel

Fabric Monthly Update - May 2025

Check out the May 2025 Fabric update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.