Forum Discussion

DavideBono97's avatar
DavideBono97
Helper I
3 years ago

RLS with dataset import

Hi

 

I have a report linked to a dataset via import schema

The dataset has RLS

I'm trying to embed this report like this 

 

var tokenRequest = new GenerateTokenRequestV2(reports: new List<GenerateTokenRequestV2Report>() { new GenerateTokenRequestV2Report(report.Item1) },
datasets: v2DatasetID.Select(datasetId => new GenerateTokenRequestV2Dataset(datasetId.ToString())).ToList(),
identities: v2rls,
targetWorkspaces: v2WsID
);

// Generate Embed token
var getToken = client.EmbedToken.GenerateToken(tokenRequest);

 My config client side is : 

 

var config = {
                    type: pbiType,
                    tokenType: pbiModels.TokenType.Embed,
   


//theme: { themeJson: getCurrentTheme() }, accessToken: options.TOKEN, datasetBinding: { datasetId: options.DATASETID, }, embedUrl: options.EMBEDURL, id: options.IDREPORT, layoutType: models.LayoutType.Custom, customLayout: { displayOption: models.DisplayOption.FitToPage }, permissions: pbiModels.Permissions.All, viewMode: pbiModels.ViewMode.View, settings: { panes: { filters: { visible: false }, pageNavigation: { visible: false } } }, };

 

Embed url generate is : https://app.powerbi.com/reportEmbed?reportId=9791f758-966c-4910-b394-3504eb9d9b9f&groupId=911bc871-5...

 

I received this error after one minute of loading :

 

PowerBI service client received error HTTP response. HttpStatus: 503. PowerBIErrorCode: OpenConnectionErrorOpenConnectionError: Failed to open the MSOLAP connection.

 

I tried then without RLS and everything works

Also a report linked to a dataset via DirectQuery with RLS also works

 

What can I do for dataset import with RLS ?

Thanks in advance

 

2 Replies