Forum Discussion
Call Fabric User Data Function from a custom visual
- 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.
Hi toresenneseth ,
Thanks for reaching out to the Microsoft Fabric Forum Community.
A 403 Forbidden error indicates that the server understands the request but refuses to authorize it. This error commonly occurs in API REST calls when the client does not have proper access rights to the resource, often due to authentication issues or invalid permissions in the server settings.
Verify that you are using the correct API key or authentication token.
Check user permissions and roles to ensure access to the resource is allowed.
Consult the API documentation to confirm you are using the correct endpoint and request method.
Contact the API provider to verify if your IP address is blocked and request whitelisting if necessary.
Also check weather you have configured your tenant administration settings to permit only certified visuals in Power BI Service.
Custom visuals cannot access user IDs or environment details unless this information is explicitly supplied as part of the data model.
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.