Forum Discussion

dungp's avatar
dungp
Regular Visitor
4 months ago
Solved

Fabric Pipeline fails to access user data function

Hello, I'm facing an issue with fabric pipeline access user data function. I'd appreciate your inputs on this issue. Thanks a lot   Context: I have a user data function called: config_utils (rec...
  • Tamanchu's avatar
    4 months ago

    Hi dungp,

    Based on the error, this does not look like a classic workspace permission issue.

    Your Service Principal may be Admin on the workspace and may even own the pipeline/UDF item, but the call is failing when notebookutils.udf.getFunctions() tries to retrieve the UDF metadata through the Fabric metadata API.

    According to the current User Data Functions limitations, accessing Fabric items or data sources using a Service Principal is not currently supported in some UDF scenarios. So the 401 is likely caused by the execution identity/context rather than by missing workspace permissions.

    A few things I would check :

    1. Test the same pipeline/notebook with an interactive user identity.
    2. Confirm whether the issue only happens when the pipeline runs under the Service Principal.
    3. If yes, this is probably a current product limitation rather than a misconfiguration.
    4. As a workaround, you may need to run the notebook/pipeline under a user identity, or move this logic outside the UDF call until SPN support is fully available for this execution path.

    Docs:
    - NotebookUtils UDF getFunctions : https://learn.microsoft.com/en-us/fabric/data-engineering/notebookutils/notebookutils-user-data-function 
    - User Data Functions limitations : https://learn.microsoft.com/en-us/fabric/data-engineering/user-data-functions/user-data-functions-service-limits 

     

    Hope this helps clarify the root cause.
    If this helped, please consider marking it as a solution so others can find it more easily.

  • dungp's avatar
    dungp
    4 months ago

    Thanks a lot for your answer Tamanchu. The pipeline runs without issue under my identity, so i believe the issue only happens when it runs under the Service Principle. I've reached out to Microsoft for the confirmation, if thats the issue then i will mark your answer as solution! 

     

    Regarding working around, i reverted changes back to using the %run maggic command with notebooks to load the logics instead of using UDF. I think using UDF is a proper and standard way to handle shared codes, but it seems we need to wait a bit before we can fully leverage this feature. 

     

    Thanks again!