Reputation: 6237
I try to make request for embed token using .NET client. For it I also pass GenerateTokenRequest with username
, datasets
and roles
var rls = new EffectiveIdentity(username, new List<string> { dataset.Id }, roles);
var generateTokenRequestParameters = new GenerateTokenRequest(accessLevel: "view", identities: new List<EffectiveIdentity> { rls });
tokenResponse = await client.Reports.GenerateTokenInGroupAsync(workSpaceId, report.Id, generateTokenRequestParameters);
In result I receive error "Operation returned an invalid status code 'BadRequest'"
{"error":{"code":"InvalidRequest","message":"Invalid role provided"}}
Does it mean I need to provide roles that only is counter on PowerBI platform? As I just select all roles of logged in user and passing them into request.
Upvotes: 2
Views: 584
Reputation: 13440
The roles are defined in your report (see Define roles and rules in Power BI Desktop section in Row-level security (RLS) with Power BI). It looks like you are passing a non-existent role in this list.
Upvotes: 3