Forum Discussion
How to implement Row Level Security in Power BI Embedded?
If you are using User-Owns-Data then there is much less work to do. When using App-Owns-Data you must programatically generate an embed code with the RLS roles inside. But with User-Owns-Data, all of RLS is configured external to your applation.
Here are the basic steps.
- Add RLS roles to your Power BI Desktop project
- Publish the Power BI Desktop project to an app workspace
- In the Power BI Service, configure the users and groups for each role.
- Use Power BI embedding using the Azure AD access token created for each user.
At this point, RLS should work and Power BI embedding should only display the data for each user based on the role(s) they are in. I think you should be able to accomplsh this without any changes to your current application.
TedPattison - What should be the solution for Apps Own Data Scenario? I'm also facing the similar problem with my embedded reports. Embedding works as expected but not the Row level security. Here is my scenario -
1. Data Source - SQL Server On-premise
2. Dynamic RLS is configued in Power BI Desktop
3. Published Reports to Premium Capacity, upgraded Workspace
4. Embedded Solution - Apps Own Data using JavaScript (used GenerateToken method)
5. Added EffectiveIdentity as below in the JavaScript GenerateToken Call.
{
"accessLevel": "View",
"identities": [
{
"username": "EffectiveIdentity",
"roles": [ "Role1", "Role2" ],
"customData": "MyCustomData",
"datasets": [ "fe0a1aeb-f6a4-4b27-a2d3-b5df3bb28bdc" ]
}
]
}
What am I missing here? Thank you!