Error when adding a SharePoint Add-on in the root site collection of a SharePoint Online (O365) tenant

Solution

Workplace Builder, Workplace Governance

Product

All Provider Hosted Gimmal Apps

Product Version

(PH) All versions

Issue

When attempting to install a SharePoint Add-on in the root site collection of a SharePoint Online (O365) tenant, the add-on installation may fail.  If the add-on is a Gimmal add-on, the following exception may be logged in the add-on installation log.

Exception An unhandled error occurred during provisioning. Host Web Url: https://yourtenant.sharepoint.com/ App Web Url: https://yourtenant-appid.sharepoint.com/GimmalApp Client ID: clientidvalue Client Certificate: Properties: [Context URL]=https://yourtenant-appid.sharepoint.com/GimmalApp[Exception] TYPE: Gimmal.Common.CommonException MESSAGE: Failed to set property 'carbon.appprovisionstatus' to value '' in SharePoint site. STACK: at Microsoft.SharePoint.Client.WebExtensions.SetPropertyValue(Web web, String propertyName, String propertyValue, Boolean execute) at Gimmal.Common.SharePoint.Client.AppProvisioningActivator.AppInstalledActions(Web appWeb, String host) at Gimmal.Common.SharePoint.Client.AppEventReceiverBase.ProcessEvent(SPRemoteEventProperties properties)[Inner Exception] TYPE: Microsoft.SharePoint.Client.ServerUnauthorizedAccessException MESSAGE: Access denied. You do not have permission to perform this action or access this resource.

Root Cause

The root site collection in a SharePoint Online (O365) tenant disables script execution in this site by default, with the DenyAddAndCustomizePages property of the site set to true.  This prevents the installation of the SharePoint add-on in the root site collection, and throws the above exception.

Resolution

To enables script execution in the root site collection of a SharePoint Online (O365) tenant, set the DenyAddAndCustomizePages property of the site set to false by executing the following powershell commands after launching the SharePoint Online Management Shell and logging in to the SharePoint Online site.

Get-SPOSite [rootsiteURL] | Select-Object DenyAddAndCustomizePages 
Set-SPOSite [rootsiteURL] -DenyAddAndCustomizePages 0
Get-SPOSite [rootsiteURL] | Select-Object DenyAddAndCustomizePages  

 

 

Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.
Powered by Zendesk