Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Anonymous
Not applicable

Power BI Embedded RLS - How do I get it to work?

Hi,

I am having issues testing out a solution for a client, who needs RLS. I followed GuyInACube's documentation, but when running the sample app (App owns data) all I get is 401 Unauthorized. As you can see, I have intentionally coded the username below to match a specific ID.

 

var generateTokenRequestParameters = new GenerateTokenRequest(accessLevel: "View",
                    identities: new List<EffectiveIdentity> { new EffectiveIdentity(username: "411FF129-8FFF-452B-AD1F-9DEDD336EA62", roles: new List<string> { "Test" },
                    datasets: new List<string> { "5e6881e9-e4bb-4eda-868f-2db80699f71c/datasets/744b301e-9140-4b8d-9310-0094c4dcd0ca" }) });

According to error prompt, I get an error on line 84:

var tokenResponse = await client.Reports.GenerateTokenInGroupAsync("groupId", "reportId", generateTokenRequestParameters);

Changing the line to this

var tokenResponse = await client.Reports.GenerateTokenInGroupAsync(GroupId, report.Id, generateTokenRequestParameters);

Gives me error prompt "Bad Request".

 

I am currently testing this out without Premium, locally. Does this have anything to do with it - is Premium required to test RLS?

 

Thanks

1 ACCEPTED SOLUTION
Anonymous
Not applicable

You are using this datasetId:

"5e6881e9-e4bb-4eda-868f-2db80699f71c/datasets/744b301e-9140-4b8d-9310-0094c4dcd0ca"

Try using just:

"744b301e-9140-4b8d-9310-0094c4dcd0ca"

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

You are using this datasetId:

"5e6881e9-e4bb-4eda-868f-2db80699f71c/datasets/744b301e-9140-4b8d-9310-0094c4dcd0ca"

Try using just:

"744b301e-9140-4b8d-9310-0094c4dcd0ca"
Anonymous
Not applicable

Thanks, I didn't see that one! How typical 🙂

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.