cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
daveParso Frequent Visitor
Frequent Visitor

POST 403(forbidden) after dashboard has been embedded

I'm using an app owns data setup with power BI embedded and have added functionality for switching between and refreshing dashboards. However after the first embed of a dashboard i am confronted with 4 POST 403 errors in chrome console and after this any refresh or switch just leaves a blank dashboard. below is an image that is representative of what is in the console after the first embed:

To be clear the first embed works fine and the dashboard is visible as expected but any subsequent attempts to change or refresh leave me with a blank screen

1 ACCEPTED SOLUTION

Accepted Solutions
daveParso Frequent Visitor
Frequent Visitor

Re: POST 403(forbidden) after dashboard has been embedded

So its a little bit of a hack but i managed to get rid of the unauthorized errors by doing embedURL.replace("https://app", "https://msit") still unsure why requesting the url feeds back app but hey this got rid of the errors. However this hasnt actually changed the fact that running powerbi.embed again leaves me with a blank dashboard instead of refreshing like it does for reports. At this point I have given up on automatic refreshes for dashboards. switching between dashboards works now at the very least so I'm going to mark this as the solution unless anything better is posted.

View solution in original post

3 REPLIES 3
Moderator Eric_Zhang
Moderator

Re: POST 403(forbidden) after dashboard has been embedded


@daveParso wrote:

I'm using an app owns data setup with power BI embedded and have added functionality for switching between and refreshing dashboards. However after the first embed of a dashboard i am confronted with 4 POST 403 errors in chrome console and after this any refresh or switch just leaves a blank dashboard. below is an image that is representative of what is in the console after the first embed:

To be clear the first embed works fine and the dashboard is visible as expected but any subsequent attempts to change or refresh leave me with a blank screen


@daveParso

I'm not able to produce this issue. To exclude the cause from your code, could you try to embed with the attached html file? If the error still exists, please fiddler the network traffic when refreshing and submit a support ticket with the trace file.

daveParso Frequent Visitor
Frequent Visitor

Re: POST 403(forbidden) after dashboard has been embedded

So the embed worked fine in the attached html file. The one difference i noticed between the two was i was using https://app.powerbi.com/dashboardEmbed? in my embed url where as the html file you provided used https://msit.powerbi.com/dashboardEmbed? However if I modify my embed url to include msit instead of api I get "an invalid status code NotFound". Its also curious to me that my report embedding works just fine with app without throwing the error that dashboards are.

 

Edit:

After some more digging i have found that using dashboard.embedUrl in the controller is returning the https://app.powerbi.com link however if i replace this by hardcoding in the msit one it works fine. as far as im aware though i dont have any control over what that value is so is there some way for me to change this as obviously hardcoding in what dashboard is displayed is not suitbale for the overall product.

daveParso Frequent Visitor
Frequent Visitor

Re: POST 403(forbidden) after dashboard has been embedded

So its a little bit of a hack but i managed to get rid of the unauthorized errors by doing embedURL.replace("https://app", "https://msit") still unsure why requesting the url feeds back app but hey this got rid of the errors. However this hasnt actually changed the fact that running powerbi.embed again leaves me with a blank dashboard instead of refreshing like it does for reports. At this point I have given up on automatic refreshes for dashboards. switching between dashboards works now at the very least so I'm going to mark this as the solution unless anything better is posted.

View solution in original post

Helpful resources

Announcements
Can You Solve These Challenge

Challenge: Can You Solve These?

Find out how to participate in the first Power BI 'Can You Solve These?' challenge.

Community News & Announcements

Community News & Announcements

Get your latest community news and announcements.

Virtual Launch Event

Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

Community Kudopalooza

Win Power BI Swag with Community Kudopalooza!

Each week, complete activities and be qualified in the drawing for cool Power BI Swag.

Top Kudoed Authors
Users Online
Currently online: 335 members 3,398 guests
Please welcome our newest community members: