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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
sjorg
Frequent Visitor

Create level Permission for Embedded Report causes 500 error

I'm embedding a report in an "App owns data" scenario.

 

In the below code, when I set the accessLevel to "View" or "Edit" it works, but "Create" throws a 500 error. 

 
        // Generate Embed Token.
        var generateTokenRequestParameters = new GenerateTokenRequest(accessLevel: "Edit");
        var tokenResponse = await client.Reports.GenerateTokenInGroupAsync(groupId, reportId, generateTokenRequestParameters);
 

(I am using this sample, with some edits that are irrelevant to this question - as I said View and Edit work just fine)

https://github.com/snobu/powerbi-embed-v2/blob/master/backend-as-func/run.csx

 

I have granted the "Content.Create" permission in the Azure app registration. My hunch is that Create is not a valid "Reports" object permission...I have to embed a "Content" object instead, based on this list

https://docs.microsoft.com/en-us/power-bi/developer/power-bi-permissions

 

How do I do that? My real end goal is to be able to programmatically create a new blank Report via API, and add data sources via Azure Tables to it. Then I want to return that ReportId to my client side & embed it, so the user can play with the data.

 

If you have any hints on that (is that even possible?), would be much appreciated.

1 ACCEPTED SOLUTION
v-ljerr-msft
Employee
Employee

Hi @sjorg,


How do I do that? My real end goal is to be able to programmatically create a new blank Report via API, and add data sources via Azure Tables to it. Then I want to return that ReportId to my client side & embed it, so the user can play with the data.

 

If you have any hints on that (is that even possible?), would be much appreciated.


Yes, you should be abe to create a new blank report via Power BI Rest API, and let the end users play with it.

 

And I just verified that the rest API still works fine for me, when I set the accessLevel to "Create". 

 

If the issue persists on your environment, I would suggest you reopen this issue or create a support ticket on Power BI Support page for better assistance. Smiley Happy

 

Regards

View solution in original post

1 REPLY 1
v-ljerr-msft
Employee
Employee

Hi @sjorg,


How do I do that? My real end goal is to be able to programmatically create a new blank Report via API, and add data sources via Azure Tables to it. Then I want to return that ReportId to my client side & embed it, so the user can play with the data.

 

If you have any hints on that (is that even possible?), would be much appreciated.


Yes, you should be abe to create a new blank report via Power BI Rest API, and let the end users play with it.

 

And I just verified that the rest API still works fine for me, when I set the accessLevel to "Create". 

 

If the issue persists on your environment, I would suggest you reopen this issue or create a support ticket on Power BI Support page for better assistance. Smiley Happy

 

Regards

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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