Setting PropertyBag Property without allowing custom scripts
We are setting Propery Bag values of a Sharepoint Online Web from an Azure Function using the Microsoft.SharePoint.Client (Microsoft.SharePointOnline.CSOM) Library with the SetPropertyBagValue.
For setting a Property Bag value the "Allow Custom script" property must be set to true otherwise a "Access denied" Exception is thrown.
Currently Microsoft is phasing out the "Allow Custom Scripts" setting. This means that by November 2024 the "Allow Custom Script" option will be reset after 24 hours.
I don't want to temporarily set the "Allow Script" property as i suspect that this will lead to timing issues.
Is there a way to still set a property bag value after november in a recommended and stable way?