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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
nd1022
Frequent Visitor

PowerBI Embedded Create Report based on Dataset

I am trying to create PowerBI report using PowerBI Embedded SDK , I have followed below github article.

 

https://github.com/Microsoft/PowerBI-JavaScript/wiki/Create%5CEdit-Report-in-Embed-View

 

Could you please elaborate on how to generate the access token?

 

Accesstoken generated using below code is not valid and it return 403 error on PowerBI.createreport function. 

 

using Microsoft.PowerBI.Security;

// rlsUsername and roles are optional
string scopes = "Dataset.Read Workspace.Report.Create";
PowerBIToken embedToken = PowerBIToken.CreateReportEmbedTokenForCreation(workspaceCollectionName, workspaceId, datasetId, null, null, scopes);

var token = embedToken.Generate("{access key}");

 

Also where to get the Access Key as show in last line of above code?

 

Thank You

0 REPLIES 0

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.