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
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
Employee
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
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.