A unified Azure platform for creating and managing AI models, agents, and applications with built‑in enterprise security, monitoring, and governance
The validation error indicates that the Fabric Data Agent cannot successfully validate the selected User Data Functions item or the functions inside it. Validation typically fails when the functions themselves are not correctly defined or published.
Use the following checks and fixes directly in the User Data Functions item, then retry adding it to the Data Agent:
- Confirm required imports and context
Open the User Data Functions item in the Fabric portal and verify that the code file contains both of these lines at the top:
These are required for the functions to work. If they are missing, add them and republish.import fabric.functions as fn udf = fn.UserDataFunctions() - Verify function decorators
Each function that should be callable by other Fabric items (including Data Agents) must be decorated with@udf.function():
If the functions use the default template but were modified, ensure the decorator is still present for every function that needs to be exposed.@udf.function() def yourFunctionName(parameter: type) -> return_type: # logic return result - Check parameter naming rules
Validation can fail if parameter names violate syntax rules. In the function signatures:- Use camelCase for parameter names (for example,
productName, notproduct_name). - Ensure parameters and defaults follow the syntax requirements and limitations for User Data Functions.
- Use camelCase for parameter names (for example,
- Validate default values and types
Incorrect or unsupported default values can cause publish/validation failures:- Use JSON-serializable defaults (strings, booleans, integers, floats).
- For date/time defaults, use ISO 8601 strings (for example,
2025-12-31T23:59:59Z). - Avoid mutable defaults for lists/dicts; use
Nonein the signature and set the default inside the function body. - Do not use sets or tuples as default values.
- Confirm libraries and environment
If the functions import additional libraries:- Ensure required libraries are added via Library Management for the User Data Functions item.
- Verify library versions are compatible with Python 3.11.
- Ensure functions are published and visible
In the User Data Functions editor:- Check the Functions explorer: functions that are ready to be invoked must appear there without the circle icon (circle indicates changes not yet published).
- Select Publish and wait for completion. If publishing fails, fix the reported issues, then publish again.
- Re-add the User Data Functions to the Data Agent
After the above fixes:- Return to the Fabric Data Agent configuration.
- Remove the previous User Data Functions reference if present.
- Add the User Data Functions item again and let the agent re-validate. With correctly defined and published functions, the validation step should succeed.
If validation still fails after these checks, focus on any function that recently changed or was added, as a single invalid function in the item can cause the overall validation to fail.
References:
- Create a Fabric User data functions item
- Create and run user data functions activity in pipelines
- Connect to data sources from your Fabric User data functions item
- Use the Functions activity to run Fabric user data functions or Azure Functions
- Copilot Studio Agent doesn't recognize the docs in the Knowledge Base. - Microsoft Q&A
- Microsoft Foundry publish to Teams Bot service error - Microsoft Q&A
- The Graph connector agent has failed to register due to insufficient permissions - Microsoft Q&A
- CQD PowerBI query (Teams Dashboard) - Microsoft Q&A
- Can someone please explain why Microsoft Foundry agents cannot take in pdfs and jsons as inputs when it says its allowed - Microsoft Q&A