Forum Discussion

alexrp02's avatar
alexrp02
New Member
9 months ago
Solved

401 Unauthorized error in querydata request when embedding dashboard with RLS

Hi, we are embedding a dashboard whose reports are associated to a dataset with RLS in our web. For generating the embed token, we have to set the identities. Embedding those reports works totally f...
  • v-karpurapud's avatar
    9 months ago

    Hi alexrp02 

    Thank you for contacting the Microsoft Fabric Community Forum.


     The 401 Unauthorized error on the querydata request usually occurs because the dashboard embed token does not include permissions for all underlying datasets referenced by the tiles. While the dashboard itself renders with the token, tile-level queries require explicit dataset access and correct RLS identity mapping.

    To resolve this issue, ensure that all dataset IDs used by the dashboard tiles are included in the datasets property when generating the embed token. Additionally, define the appropriate identities for each dataset to correctly enforce RLS. It is also important to verify that the token’s scope is set to accessLevel: View and that its lifetime remains valid while the tiles are loading. Lastly, confirm that your embedding page is served over HTTPS and that your domain is listed under the allowed origins in the Power BI tenant settings.

    For further details, please consult the official Microsoft documentation on
    https://learn.microsoft.com/en-us/power-bi/developer/embedded/embed-sample-for-customers?tabs=net-core
    https://learn.microsoft.com/en-us/rest/api/power-bi/embed-token/generate-token
    https://learn.microsoft.com/en-us/power-bi/developer/embedded/embedded-row-level-security

     

    I hope this information is helpful. If you have any further questions, please let us know. we can assist you further.

     

    Regards,

    Microsoft Fabric Community Support Team.