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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
jheising
New Member

"Could not load Edit mode: insufficient Permissions" editing Report with Service Principal Account

Hello! I'm trying to enable the ability to create and edit Power BI reports in an "App owns Data" scenario using a Service Principal account.

 

I don't seem to have any problem generating an embed token with the Reports GenerateTokenForCreateInGroup REST API Endpoint. My end user can create a report and save it just fine. I've checked in the Power BI portal and the Service Principal account seems to own the new report.

 

The problem comes when I try to allow that same user to come back and edit that report in the future. I'm calling the Reports GenerateTokenInGroup API endpoint with the following POST body:

 

 

 

{
    accessLevel: "Edit",
    allowSaveAs: true,
    datasetId: datasetID
}

 

 

 

When I go to use the resulting token in the powerbi-client javascript library using:

 

 

 

powerbi.embed(reportContainer, {
    type: "report",
    id: myReportID,
    accessToken: myEmbedToken,
    tokenType: powerBILib.models.TokenType.Embed,
    embedUrl: "https://embedded.powerbi.com/ReportEmbed",
    viewMode: powerBILib.models.ViewMode.Edit
});

 

 

 

I get an error that says "Could not load Edit mode: insufficient Permissions".

 

My App Registration permissions in the Azure portal are as follows:

 

Screen Shot 2020-09-15 at 3.14.50 PM.png

 

Any ideas why I would be able to create a report with a Service Principal account but not edit it? Any help would be greatly appreciated!

 
 
 
 
1 ACCEPTED SOLUTION
jheising
New Member

Figured it out. Apparently you have to set the permissions setting on the embed function on the client.

 

 

powerbi.embed(reportContainer, {
    type: "report",
    id: myReportID,
    accessToken: myEmbedToken,
    tokenType: powerBILib.models.TokenType.Embed,
    embedUrl: "https://embedded.powerbi.com/ReportEmbed",
    permissions: powerBILib.models.Permissions.All, // Must be included
    viewMode: powerBILib.models.ViewMode.Edit
});

 

View solution in original post

2 REPLIES 2
jheising
New Member

Figured it out. Apparently you have to set the permissions setting on the embed function on the client.

 

 

powerbi.embed(reportContainer, {
    type: "report",
    id: myReportID,
    accessToken: myEmbedToken,
    tokenType: powerBILib.models.TokenType.Embed,
    embedUrl: "https://embedded.powerbi.com/ReportEmbed",
    permissions: powerBILib.models.Permissions.All, // Must be included
    viewMode: powerBILib.models.ViewMode.Edit
});

 

Greg_Deckler
Community Champion
Community Champion

@dm-p 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.