[SPOStorageEntity]: Permissions issue and way to tackle it?
Description of the issue
The SPOStorageEntity resource is a bit difficult to address
- like any other resource, you must have some roles and permissions: OK but under some circumstances (TenantScope) you must
- grant Site Admin permission to the service principal on the AppCatalog Site
- Disable the Blockign of custom on that same site, which is valid only for 24 hrs when updating the resource
I only discovered (2) by searching the net and confirming through a case.
In the spirit of a DSC "define the state" approach, I would like to know what is the best approach to handle those challenges.
The first immediate step would be to amend the warning message https://github.com/microsoft/Microsoft365DSC/blob/6ba4de6905ce91ac780c6e8b3ec90e79079e2668/Modules/Microsoft365DSC/DSCResources/MSFT_SPOStorageEntity/MSFT_SPOStorageEntity.psm1#L264 to outline the block script issue
But in a second step, should code that temporarily flip a security setting be part of the resource?
- Should a property added to SPOSite for disabling the setting though composition
- Should a virtual SPOSiteSecuritySettings object created just to address that part of the site's settings in the same way that SPOTEnantSettings and SPOAccessControlSettings separate concerns but call the same cmdlets?
Microsoft 365 DSC Version
1.26.128.1 / DEV
Which workloads are affected
SharePoint Online
The DSC configuration
Verbose logs showing the problem
Environment Information + PowerShell Version
Tagging @NikCharlebois for his opinion.
@1Dimitri Where do I find the setting you mentioned that only works for 24h? I'm not a SharePoint guy, so a little guidance is needed. Thank you.
I'm not a Sharepoint specialist , but I got this confirmed with a Unified support case. You get the info:
- either by going into the in the interface
- or under https://learn.microsoft.com/en-us/sharepoint/allow-or-prevent-custom-script -"Changes to allow custom scripts are overridden to Not allowed within 24 hours."