Issue:

  • We are missing Sites.Selected permissions for a specified webUrl in the greenlist.

Resolution:

These steps require being either a tenant administrator, or a site administrator of the associated site collection.

  • Open a PowerShell session. Note these steps may also require you to install Sharepoint PowerShell.
Connect-PnPOnline -Url $SITE_COLLECTION_URL
Grant-PnpAzureADAppSitePermission -AppId '$CLIENT_ID' -Site $SITE_COLLECTION_URL -Permissions FullControl

For client secret-based setup (deprecated)

Grant-PnpAzureADAppSitePermission -AppId '$CLIENT_ID' -Site $SITE_COLLECTION_URL -Permissions FullControl

You should expect the output to include

Id    : <id>
Roles : {fullcontrol}
Apps  : {$DISPLAY_NAME, $CLIENT_ID_FOR_SETUP}

For additional assistance, please contact Glean Support at https://support.glean.com