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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
Anonymous
Not applicable

Power BI Embedded RLS won't 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);

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
Eric_Zhang
Microsoft Employee
Microsoft Employee


@Anonymous wrote:

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);

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

 

Thanks


@Anonymous

Please try

 

var generateTokenRequestParameters = new GenerateTokenRequest("View", null, identities: new List < EffectiveIdentity > {
                 new EffectiveIdentity(username: "411FF129-8FFF-452B-AD1F-9DEDD336EA62", roles: new List < string > {
                  "Test"
                 }, datasets: new List < string > {
                  "744b301e-9140-4b8d-9310-0094c4dcd0ca"
                 })
                });

var tokenResponse = await client.Reports.GenerateTokenInGroupAsync("5e6881e9-e4bb-4eda-868f-2db80699f71c", "{the actually embedded reportid here}", generateTokenRequestParameters);

View solution in original post

1 REPLY 1
Eric_Zhang
Microsoft Employee
Microsoft Employee


@Anonymous wrote:

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);

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

 

Thanks


@Anonymous

Please try

 

var generateTokenRequestParameters = new GenerateTokenRequest("View", null, identities: new List < EffectiveIdentity > {
                 new EffectiveIdentity(username: "411FF129-8FFF-452B-AD1F-9DEDD336EA62", roles: new List < string > {
                  "Test"
                 }, datasets: new List < string > {
                  "744b301e-9140-4b8d-9310-0094c4dcd0ca"
                 })
                });

var tokenResponse = await client.Reports.GenerateTokenInGroupAsync("5e6881e9-e4bb-4eda-868f-2db80699f71c", "{the actually embedded reportid here}", generateTokenRequestParameters);

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.