web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Pages / CSP and inbuilt templates
Power Pages
Unanswered

CSP and inbuilt templates

(0) ShareShare
ReportReport
Posted on by 125

Hi,

 

I am looking for help with enabling the CSP policies.  I am using a portal and I find that even when I have out of the box component these are not being allowed due to the inline styling in many of microsoft's templates?  When i have a basic form in a page this also brings up error due to inline styling in the forms.  How can I ivercome this.  I cannot even find how to get access to out if the box form code to remove the CSS and place externally?

 

Is this correct?  How can we set up CSP if even the OOB functionality doesn't comply? or am I confused?

 

Thanks

Categories:
I have the same question (0)
  • kirra Profile Picture
    16 on at

    I've been working on this very challenge today (although I dont have any forms in my portal), but I was able to achieve some level of success by allowing inline styles for specific domains (I know this isnt the solution you are asking for, but is as close as I could get).

     

    The MS doco is here https://learn.microsoft.com/en-us/power-apps/maker/portals/configure/manage-content-security-policy

     

    And I ended up with the following CSP for my Starter Portal (which uses Azure B2C, application insights and the PWA mobile app setting):

     

     

    script-src 'self' 'unsafe-inline' content.powerapps.com 'nonce' js.monitor.azure.com storage.googleapis.com; style-src 'self' 'unsafe-inline' content.powerapps.com 'unsafe-inline'; img-src 'self'; connect-src 'self' js.monitor.azure.com content.powerapps.com storage.googleapis.com australiaeast-1.in.applicationinsights.azure.com; font-src 'self' content.powerapps.com static2.sharepointonline.com; prefetch-src js.monitor.azure.com;

     

     

    I determined which domains to include while building my CSP by reading the javascript console errors visible in the chrome developer tools javascript console.

     

    The 'unsafe-inline' in the segment below is what allowed my own and the MS inline styling to work (by permitting inline styling for the specified domains, even though CSP recommends you dont do this)

     

    style-src 'self' 'unsafe-inline' content.powerapps.com 'unsafe-inline';

     

     

    Hope this helps someone, and agree it would be nice if OOB was CSP compliant.

  • MH-02091453-0 Profile Picture
    125 on at

    Yes thanks.  I have already added the unsafe-inline while developing to overcome this but in production I don't really want to have this attribute set to this for security reasons.

     

    Thanks

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Pages

#1
Mohsin Ali Profile Picture

Mohsin Ali 33

#2
sannavajjala87 Profile Picture

sannavajjala87 28 Super User 2026 Season 2

#3
Fubar Profile Picture

Fubar 22 Super User 2026 Season 1

Last 30 days Overall leaderboard