Vinay T V
Vinay T V

Reputation: 1

Refused to frame 'https://app.powerbi.com/' because an ancestor violates the following Content Security Policy directive: in ASP.net webforms

Refused to frame 'https://app.powerbi.com/' because an ancestor violates the following Content Security Policy directive: "frame-ancestors https://teams.powerbi.com https://teams.microsoft.com".

Gettign this error while adding the iframe URL in the Asp.net webforms by passing in the iframe src attribute.

Could anyone guide here , as I am facing issue when there is a paramter attached to it , if without paramter its working.

Upvotes: 0

Views: 3586

Answers (1)

pete the pagan-gerbil
pete the pagan-gerbil

Reputation: 3166

The PowerBI reports have a content security policy of their own to control on which pages they can be included as iframes - MS have instructions to edit this content security policy here: https://learn.microsoft.com/en-us/power-platform/admin/content-security-policy

To configure CSP, navigate to the Power Platform admin center -> Environments -> Settings -> Privacy + Security.

It's probably failing with the parameter because that is loading a specific report, and generating CSP headers based on that report's settings (hence blocking it being embedded on your page).

Upvotes: 0

Related Questions