How to configure access to SharePoint Online

A common "Promodag Reports Application" is now used to access Office 365 and SharePoint Online.

It does, however, require additional permissions to access SharePoint Online.

Prerequisites

The "Promodag Reports Application" must have been created and registered in Microsoft Entra ID, see Certificate-based authentication to Office 365.

Procedure

The assignment of the permission on the chosen SharePoint site is done through PnP PowerShell, a cross-platform PowerShell Module.

A. Install PnP PowerShell and create the PnP app in Microsoft Entra ID

B. Connect PnP PowerShell to your Office 365 tenant

Run PowerShell 7.x and enter this command: Connect-PnPOnline -Url https://<Office 365 tenant>.sharepoint.com/ -Interactive -ClientId <Application ID of the PnP app>

C. Grant permission to the Promodag SharePoint Application in SharePoint Online

Grant write permission on your root site

Run Windows PowerShell as and enter this command:

Grant-PnPAzureADAppSitePermission -AppId '<Application ID of the Promodag Application>' -DisplayName 'Promodag Reports RBAC Application' -Permissions Write

Grant write permissions on a sub-site

Run PowerShell 7.x as an administrator and enter this command:

Grant-PnPAzureADAppSitePermission -AppId '<Application ID of the Promodag Application>' -DisplayName 'Promodag Reports RBAC Application' -Site 'https://<Office 365 tenant>.sharepoint.com/sites/<sub-site> -Permissions Write