Forum Discussion

KonradKolenda's avatar
KonradKolenda
Frequent Visitor
1 year ago
Solved

Embed Token Generation Successful, but 403 Forbidden on ExecuteQueries API

Hi everyone! I'm running into a frustrating issue with Power BI embed tokens and hoping someone here has encountered this before or can point me in the right direction.   What I'm trying to do I'...
  • v-veshwara-msft's avatar
    v-veshwara-msft
    1 year ago

    Hi KonradKolenda ,

    Thanks for sharing the additional details. You are correct that the guidance recommends using a service principal for production apps and that the documentation indicates arbitrary strings can be used for RLS when generating embed tokens.

     

    The executeQueries API examples are shown with Azure AD access tokens from a service principal or master user, and there does not seem to be a way to pass an arbitrary identity through that API call in the same way it is done when generating an embed token. This may explain why the combination of service principal, arbitrary usernames, and executeQueries is not working as expected.

     

    Based on research and documentation, the executeQueries endpoint does not appear to support supplying an effective identity in the request body. That option is described only in the context of token generation for embedding. If the main requirement is enforcing RLS with non-AD usernames, embedding reports or using embed tokens may still be the supported approach. For programmatic queries, alternatives like XMLA endpoints could be considered, but those require valid AAD identities and do not accept arbitrary strings.

     

    This seems to be a gap between the supported scenarios, and if this combination is critical for your use case it may be best to raise it through support ticket to confirm whether there is a way planned to enable it.

     

    Hope this helps. Please reach out for further assistance.

    Thank you.