SPOL : Access Denied when you upload a custom css on the Style Library

 In the modern SPOL, when you try to upload a custom css file, you end up getting an error like this. 



This is related to the No script setting in Modern Sites, you may need to use the below PS snippet to turnoff NoScript on the Modern Site.


Connect-SPOService -Url https://<tenantname>-admin.sharepoint.com
Set-SPOSite -Identity https://<SiteUrl> -DenyAddAndCustomizePages 0


One other way of doing this is to inject using one of the SPFX PnP widget - https://github.com/pnp/sp-dev-fx-webparts/tree/main/samples/react-add-js-css-ref


Comments

Popular posts from this blog

Linksys Wireless Connection Failure

The security validation for this page is invalid. Click Back in your Web

Power Apps toPower Automate Error - The input body for trigger 'manual' of type 'Request' did not match its schema definition , the input String does not validate against the date