cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
pmdci Member
Member

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
Moderator Eric_Zhang
Moderator

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

@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); 
                    }
pmdci Member
Member

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

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.