Forum Discussion

toresenneseth's avatar
toresenneseth
Frequent Visitor
1 year ago
Solved

Call Fabric User Data Function from a custom visual

Hi all,   Does anyone know how to call a Fabric User Data Function from a custom visual?   When I make the call, I get a 403 Forbidden response. The docs says that it's because the payload is too...
  • v-echaithra's avatar
    1 year ago

    Hi toresenneseth ,

    If it's not "https://analysis.windows.net/powerbi/api", then Power BI services will reject it with 403 or 401 errors.

    Since your custom visual is using the Power BI Authentication API, the access token it retrieves is scoped based on the AADAuthentication privilage. However, the token does not include the required audience (https://analysis.windows.net/powerbi/api), which is likely causing the 403 error when attempting to invoke the UDF.

    Power BI custom visuals may not yet fully support authenticated calls to Fabric UDFs, meaning this scenario might not be officially supported at the moment.


    The permission GraphQLApi.Execute.All is Application-level. However, Power BI service does not yet fully support GraphQL through service principals in all contexts, especially from within custom visuals.

    Additionally, even if the SP has the GraphQL permission, it must also have access to the workspace and semantic model associated with the UDF.
    The token is recognized but authorization fails typically because:

    1) The SP doesn’t have access to the workspace/data model.
    2) The custom visual isn’t authorized to invoke UDFs.
    3) The API being called isn't exposed to SPs in that context.

     

    If this helped, please mark the response as the accepted solution and give it a thumbs-up so others can benefit too.

    Best regards,
    Chaithra E.