Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hello!
Using the Sample at:
https://docs.microsoft.com/en-us/azure/power-bi-embedded/power-bi-embedded-get-started-sample
And following the article at:
https://docs.microsoft.com/en-us/azure/power-bi-embedded/power-bi-embedded-rls
I am unable to get RLS working on an embedded report. The error received is as below:
The Report works fine with RLS removed, but allowing user based RLS will be cricual to our business.
The Sample Embed token has been changed to:
IEnumerable<string> UserRoles = new List<string>() {"provider"}; var embedToken = PowerBIToken.CreateReportEmbedToken(this.workspaceCollection, this.workspaceId, report.Id, "10005", UserRoles);
The Role is called "provider", and has the following filter:
[provider_ID_INT] = USERNAME() || [provider_ID_INT] = "-1"
When testing this in power bi desktop with "10005" entered into other user, the RLS works perfectly.
The Report contains 3 data sets, one with a list of distinct providers, which links to two data tables based on a ID.
The list of distinct providers has the Role applied to it.
The data sets are imported, direct query is not used.
I have seen similar forum posts but none with a solution.
Has anyone found an answer to this,
Or might anyone know what i am doing wrong.
Thank You!
Solved! Go to Solution.
Hello Eric,
Thanks so much for your help, as it really narrowed down where the problem was.
It looks like the issue was with one of the packages, which was not working with RLS corectly - but would work without it. I must have taken a version from before RLS was implemented.
After updating all packages with NuGet to the latest working versions it now works with RLS correctly.
Hopefully this is of help to anyone with the same problem.
The token actually works for me when My pbix just contains one table. Do you mind uploading the pbix? I'd like to check the RLS setting in your case.
var embedToken = PowerBIToken.CreateReportEmbedToken(this.workspaceCollection, this.workspaceId, report.Id,"10005",new string[] { "provider"});
Check the simple pbix in my test.
I also tried recreating my embedded workspaces/starting the sample from scratch again.
Still with the same issue.
@rsb_powerbi wrote:
I also tried recreating my embedded workspaces/starting the sample from scratch again.
Still with the same issue.
Would you mind share your application? You can share me a github link or a zipped folder.
Hello Eric,
I have Messaged you a link for the zipped application file
@rsb_powerbi wrote:
Hello Eric,
I have Messaged you a link for the zipped application file
@rsb_powerbi
Thanks for sharing the application. However it works just fine in my test. I just open it in Visual studio 2015 without changing any code. Can you double check the uploaded test?
If the problem persists, please upload a fiddler trace file of the network traffic when loading the report.
Hello Eric,
Thanks so much for your help, as it really narrowed down where the problem was.
It looks like the issue was with one of the packages, which was not working with RLS corectly - but would work without it. I must have taken a version from before RLS was implemented.
After updating all packages with NuGet to the latest working versions it now works with RLS correctly.
Hopefully this is of help to anyone with the same problem.
Hi RSB
Do you remember what version you upgraded your package to and from?
Also, what package did you have to upgrade?
Was it Microsoft.PowerBI.Core?
Thanks
Christian
Hello Eric,
I tried uploading your power BI File and i received the same error as with my powerbi file.
However, if i remove the RLS from your file and then upload it it works fine.
User | Count |
---|---|
15 | |
2 | |
1 | |
1 | |
1 |
User | Count |
---|---|
18 | |
11 | |
5 | |
4 | |
3 |