Forum Discussion
Dynamic Data Source based on dynamic parameter from login user session
- 7 years agoHi there
Please find below a link on how to use it with Power BI Embedded
https://docs.microsoft.com/en-us/power-bi/developer/embedded-row-level-security
2. It could work with DirectQuery if you are passing it down to a data source which supports single Sign On
3. Currently if a user is a member of an App Workspace RLS does not apply.
Ok, that's not our case because our custom application users are not added in App Workspace. Thank you for clarificaton.
I have also implemented your suggested solution and it seems working fine. Just one last point, if we pass Roles information under GenerateToken Request for a dashboard that doesn't enabled RLS, then this throw error
Exception Details: Microsoft.Rest.HttpOperationException: Operation returned an invalid status code 'BadRequest'
Source Error:
Line 81: generateTokenRequestParameters = new GenerateTokenRequest("View", null, identities: new List<EffectiveIdentity> { new EffectiveIdentity(username: rlfUserId, roles: new List<string> { "RLS" }, datasets: new List<string> { datasetId }) });
Line 82:
Line 83: var token = await client.Reports.GenerateTokenInGroupAsync(wsId, repId, generateTokenRequestParameters); |
So does it mean we can only pass "identities" if dashboard has enabled RLS? If yes then is there any better way to find this, before loading dashboard? We can used hard-coded dashboard names in condition at our side which have RLS enabled and then create token but it will become problem to update application everytime whenever we will have new RLS based dashbord. So is there any (automatic) bettter & professional way?
Thank you
I am not sure how it would be passed through from your custom application. Unfortunately I do not have the experience with power BI embedded.
Hopefully this document will assist you: https://docs.microsoft.com/en-us/power-bi/developer/embedded-row-level-security