Store and retrieve custom key-value pairs on a web (site) using
the property bag.
| Requirement |
Description |
Reference |
| Site Owner role |
Required to set property bag values. Read access to view. |
SharePoint admin roles |
from office365.sharepoint.client_context import ClientContext
ctx = ClientContext("https://contoso.sharepoint.com/sites/team").with_client_secret(
"contoso.onmicrosoft.com", "client_id", "client_secret"
)
web = ctx.web.get().execute_query()
web.set_property("AllProperties", {"Custom_Config": "value"}).update().execute_query()