Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hi,
I've written the following code to try create a new report using Power BI Embedded:
authContext.acquireToken(window.config.endpoints.powerbiUri, function (error, token) {
let datasetId = $("#datasetId").val();
let embedContainer = $("#embedContainer").get(0);
let models = window['powerbi-client'].models;
let config = {
accessToken: token,
datasetId: datasetId,
embedUrl: "https://embedded.powerbi.com/appTokenReportEmbed"
};
let report = powerbi.createReport(embedContainer, config);
report.on("saved", function (event) {
let msg = `report saved ${JSON.stringify(event.detail, null, " ")} `;
alert(msg);
});
report.on("error", function (event) {
let msg = `error creating report saved ${JSON.stringify(event.detail, null, " ")} `;
console.log(msg);
});
});
Everytime the code runs, an NotAuthorized error is logged however. The account that I used to test my code has admin permissions on Power BI.
error creating report saved {
"message": "CreateReportFailed",
"detailedMessage": null,
"technicalDetails": {
"requestId": "4a909e2f-4552-0433-13ed-3e9a3d2346b2"
},
"errorCode": "NotAuthorized"
} What is wrong with my security ? I'm using the "User owns data" scenario btw...
Gunther
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |
| User | Count |
|---|---|
| 5 | |
| 4 | |
| 4 | |
| 2 | |
| 2 |