Forum Discussion
Power Bi embedded schema based multi tenancy
Hi lukaszp, thanks for your reply. The way you describe works indeed, but only when you use written out SQL statements in the data sources without typing the schema name. When a table or view is selected in the data source wizard, its schema name is also included in the data source. When I remove the schema from the source in the advanced editor and I save the report as a pbix file, the schema name seems to remain applied. I notice this in two ways:
When I publish the pbix file in a workspace with a sql user which has access to the specific schema (same tenant), it works. When I publish the pbix file in a wokspace with a sql user which has access to a different schema (another tenant), it doesn't.
The other way is when I open the pbix file in a text editor, I can see the schema name in a number of lines (between lots of unreadable characters).
RLS has nothing to do with this, the question is how can I design a schema independent report on a database with schema based tenant isolation, without using written out SQL statements?
- lukaszp9 years agoPower BI TeamThanks for clarifying. Let me see if I can track down an answer.
- Chandrachud9 years agoRegular Visitor
Hi All, We also are facing the same issue, as rightly said by TvB changing user credentials, removing schema definition from advanced query editor nothing works as of now.
Just a suggestion if this works for you (please check the secuity aspect) you can use sql level filtering on the basis of some parameters while designing the report to see data relevant to a tenant and then disable the filters and visualization options from JavaScript while rendering the embedded report.
- lukaszp9 years agoPower BI TeamI checked up on this - we don't support changing the schema the way you're trying to use it. You should use row level security. Please not that row level security allows you to set security filters in the App Token generated by your application. The application should create tokens in the backend (not in the JavaScript so that your keys stay secure). You should not use JavaScript filtering API as a security primitive - since it's client side someone could edit the filters supplied inflight to the server. The information stored in the App Token (username, collection of roles) is signed by your app's key so it cannot be tampered. You can read about App Tokens here: https://docs.microsoft.com/en-us/azure/power-bi-embedded/power-bi-embedded-app-token-flow