Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hello,
I have an embeded PowerBI report. I added a Power BI Paginated visual to the report. The visual is published in a workspace that has a capcity assigned to it. In the PowerBI severvice the report and paginated visual work fine. when we embed in a webpage, we get the following error:
"Cannot connect to dataset xxx with embed token because XMLA permissions are off"
Any suggestions?
Cheers!
Peter
Solved! Go to Solution.
Hi,
The isssue is probably related to the way you are generating the embed token.
Which endpoint are you using for generating the embed token? Did you include the report ID and dataset ID of the Power BI report, and also the ID of the Paginated report?
Do you have a Power BI dataset as a datasource of the Paginated report? Did you include it's ID as well, and with "xmlaPermissions": "ReadOnly" ?
Hi,
The isssue is probably related to the way you are generating the embed token.
Which endpoint are you using for generating the embed token? Did you include the report ID and dataset ID of the Power BI report, and also the ID of the Paginated report?
Do you have a Power BI dataset as a datasource of the Paginated report? Did you include it's ID as well, and with "xmlaPermissions": "ReadOnly" ?
Hi, @AmosHersch
I faced this error too when I try to embed a paginated report. The endpoint I used it
The workspace_id and report_id are got from URL. The dataset_id is got from endpoint GET https://api.powerbi.com/v1.0/myorg/groups/{groupId}/reports/{reportId}/datasources, the string in response of sobe_wowvirtualserver-<DatasetID> .
And my XMLA settings is read-only. What should I check further?
@tcliu1990 in the generate token request did you follow this example:
Embed Token - Generate Token - REST API (Power BI Power BI REST APIs) | Microsoft Learn
Specifically:
"datasets": [ { "id": "cfafbeb1-8037-4d0c-896e-a46fb27ff229", "xmlaPermissions": "ReadOnly" } ],
Asking because you wrote:
I send request body with {"datasets" :[{"id": "dataset_id"}], reports: [{"id": "report_id"}], "targetWorkspaces": [{"id": "workspace_id"}]}
Hi @AmosHersch Thanks a lot. I can get token after add "xmlaPermissions": "ReadOnly" parameter. However, when I use this token to my embed js code, I got 403 error https://wabi-canada-central-redirect.analysis.windows.net/explore/reports/report_Id/conceptualschema?userPreferredLocale=en-US
and 401 on https://wabi-canada-central-redirect.analysis.windows.net/explore/reports/report_id/modelsAndExplora...
My js code is copy from the playground
// Read embed application token
let accessToken = EMBED_ACCESS_TOKEN;
// Read embed URL
let embedUrl = EMBED_URL;
// Read paginated report Id
let embedReportId = REPORT_ID;
// Read embed type from radio
let tokenType = TOKEN_TYPE;
// Get models. models contains enums that can be used.
models = window['powerbi-client'].models;
// Se view permissions.
let permissions = models.Permissions.View;
// Create the embed configuration object for the paginated report
// For more information see https://go.microsoft.com/fwlink/?linkid=2153700
let config = {
type: 'report',
tokenType: tokenType == '0' ? models.TokenType.Aad : models.TokenType.Embed,
accessToken: accessToken,
embedUrl: embedUrl,
id: embedReportId,
permissions: permissions,
};
// Get a reference to the paginated embedded report HTML element
let embedContainer = $('#paginatedReportEmbedContainer')[0];
// Embed the paginated report and display it within the div container.
paginatedReport = powerbi.embed(embedContainer, config);
console.log("Loading Paginated Report.");
where my config is {"accessToken": "token", "embedUrl": "https://app.powerbi.com/rdlEmbed?reportId=report_id&config=config_id", "id": "report_id", "permissions": "View", "tokenType": 1, "type": "report"
}
Seems like permissions issue for your service principal. Does it have permissions to the dataset's workspace?
@AmosHersch Hi, I double check my service principal, it has access to the dataset. I can embed another normal report in the same dataset.
User | Count |
---|---|
14 | |
4 | |
2 | |
1 | |
1 |
User | Count |
---|---|
20 | |
3 | |
2 | |
2 | |
2 |