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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
pmdci
Advocate V
Advocate V

Embedding Power BI reports: Forbidden error when trying to access one dataset. All others work fine.

Hello,

 

We are having a problem trying to embed Power BI reports residing in an specific Workspace (a O365 group).

 

We managed to successfuly embed reports from other workspaces without any issues. I had a look at the permissions of the workspace and I do not see anything different. In fact it has the same members as the other workspaces, and the account used to authenticate the application is the admin for all those workspaces.

 

The error we get is the following:

 

2017-10-12 16:07:44 +00:00 [Error] 0HL8HHCUA5TUI-Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware: An unhandled exception has occurred: Operation returned an invalid status code 'Forbidden'

Microsoft.Rest.HttpOperationException: Operation returned an invalid status code 'Forbidden'

   at Microsoft.PowerBI.Api.V2.Reports.<GenerateTokenInGroupWithHttpMessagesAsync>d__16.MoveNext()

--- End of stack trace from previous location where exception was thrown ---

   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)

   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

   at Microsoft.PowerBI.Api.V2.ReportsExtensions.<GenerateTokenInGroupAsync>d__23.MoveNext()

--- End of stack trace from previous location where exception was thrown ---

   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)

   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

   at Microsoft.PowerBI.Api.V2.ReportsExtensions.GenerateTokenInGroup(IReports operations, String groupId, String reportKey, GenerateTokenRequest requestParameters)

 

Any ideas on what the problem might be?

 

Regards,

P.

2 REPLIES 2
Eric_Zhang
Microsoft Employee
Microsoft Employee

@pmdci

  • What's going on if calling GenerateToken in POSTMAN.
  • Is the same client_id used whem embedding reports from the specific workspace? If not, ensure the registered app has the sufficient permission.
  • Is the embedding capacity disable for that specific workspace? You can find the information by clicking "Admin portal"->"Tenant settings"->"Developer settings"(scroll to bottom).
  • Try to add try..catch block to the code to get more specific forbidden information.
    try
                    {
                        //generatetoken code here
                    }
    catch (HttpOperationException ex)
                   { 
                        //Bad Request
                        var content = ex.Response.Content;
                        Console.WriteLine(content); 
                    }

Hi @Eric_Zhang

 

I will get our engineers to look the points you have raised.

 

As for the admin portal settings, it is all set to the defaults.

 

2017-10-16_11-11-46.png

 

Regards,

P.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.