Forum Discussion
Power BI Embedded and user security (RLS?)
Hi experts,
I am working on a project which entails embedding the PBI report in web portal. The users access the portal using their own ID and password.
I have been searching, reading, watching videos, going through documentation regarding how this is to be implemented and I am somewhat confused.
for example: this documentation from Microsoft states the process, but at the end it also states the following:
Token-based Identity limitations
- You can use RLS only if you have a dedicated capacity.
- RLS doesn't work with SQL Server on-premises.
Does this mean that you cannot have secure access if the dataset is on an on premise SQL Server ? (which is actually my scenario). Does this mean we would have to migrate the dataset to cloud services?
Can anyone point me in the direction fo an adequate resource with a step-by-step process of how this is implemented and how the admin for new users/unsubscribed users?
Very much appreciate it!
5 Replies
- AnonymousNot applicable
Hi PaulDBrown
My understanding was that RLS is compatible with on-premises SQL Server: https://docs.microsoft.com/en-us/power-bi/admin/service-admin-rls - Are you using Direct Query with this DB - or using Power BI import mode?
The statement "You can use RLS only if you have a dedicated capacity." only relates to the section on Token Based Identity - where an Azure AAD token is passed to the Azure SQL DB instead of a more generic identity object. The token contains the details of the user account, which Azure SQL DB can parse/understand.
Passing through a UserName and Roles (as shown here) should work with direct query.
As you are embedding into a web portal, you will need a dedicated capacity regardless of the use of RLS in your data model. This also assumes the 'App owns Data' type of embedding is being used - where your end users do not have a Power BI licence and are logging in via a custom auth process.
Can you elaborate what you mean by 'admin for new users/subscribed users' ?
I have done lots of embedding projects - but not used RLS with Direct Query on an on-premises DB yet - so I am not sure if there is a step-by-step for achieving this.
Hope this helps.- PaulDBrownCommunity Champion
Thanks, Anonymous , that was indeed helpful.
Please bear with me since this first PBI Embedding project, so I'm trying to understand the implications...
"As you are embedding into a web portal, you will need a dedicated capacity regardless of the use of RLS in your data model. This also assumes the 'App owns Data' type of embedding is being used - where your end users do not have a Power BI licence and are logging in via a custom auth process".
This is exactly my scenario.
We are aiming for an data import, as opposed to Direct Query.
BTW, the document I was referring to (which I failed to link to) is this:
https://docs.microsoft.com/en-us/power-bi/developer/embedded/embedded-row-level-security
And from this video (from 2018 so things may well have changed...) I infer that maintenance on users must be done both in the actual PBI report file (RLS structure using dim table with USERNAME) and within the code used in the embedding process (minute 21:30 onwards):
(If so, then the maintenance sounds pretty complex and not user friendly)
BTW, is the Gateway configuration the same as a regular Power BI report?
As I say, I've been searching around trying to find a simple, comprehensive step-by-step explanation but have not been too succesful.
Any help or reading recommendations are more than welcome, and thank you for your time in helping me understand this topic
- AnonymousNot applicable
Applying RLS rules by using USERNAME() is achievable in an in memory model, but whether you need to go that far is dependent on the granularity of the security model you are trying to achieve.
When using 'App owns data' - you can specify any Username and combination of Roles at the point of generating an embed token.
If you can configure the required security into a set of roles (Admin/User/Public/Private.... and so on) then your application can be responsible for applying a suitable role when a token is fetched. This way, you won't need to store any usernames or do any lookups.
If your reports are reliant on knowing the exact user (by username) - then you would likely need to create a table within your model that will hold the user details - with an RLS rule defining what a match to USERNAME() will do to restrict/filter the data.
I have worked with both scenarios in the past, so can confirm that both work well.
The difficult part is if your source database does not contain the required user details.
Are you building a multi-tenant model similar to the channel-9 video?