Microsoft Sharepoint Graph troubleshooting

Microsoft Sharepoint Graph troubleshooting

A common pitfall when creating an application integration using Microsoft Graph is receiving error messages with no clear solutions. This article will describe potential solutions for some common errors so that you can still sync your Sharepoint data with Relatics. Some error messages may have multiple origins.

Failed to retrieve available sites. Please enter site information manually*

Problem: The API permissions of the app registration are set to specific sites only, but when creating an application integration, an error occurs: “Failed to retrieve available sites. Please enter site information manually.”.

Solution: After the error message is shown, close it and proceed by filling out the fields Sharepoint site and Sharepoint URL type.

General Exception while processing**

Problem: The API permissions are configured as ‘delegated’, which leads to the following error message while configuring the application integration: “General Exception while processing.”

Solution: With ‘delegated’ permission settings, Relatics cannot sync with a Graph API. To integrate your app registration with Relatics, make sure to set the permissions to ‘Application’.

Problem: The app registration API permissions are set to specific sites only, so you enter the site information manually. After manually entering the site information, an error occurs: “General Exception while processing.”

Solution: The site permissions need to be at least set to read in Sharepoint. With a Powershell script, it is possible to grant read permissions for specific sites in Sharepoint. At the time of writing, these steps can be followed to use Powershell to set the right permissions:

    1. Open powershell and make sure the module “Microsoft.Graph” is installed.
    2. Put the following code into a Powershell script, but change the parameters.
      >Import-Module Microsoft.Graph.Sites
      Connect-MgGraph -TenantId <TENANT_ID_HERE> -Scopes "Sites.FullControl.All" -NoWelcome
      $params = @{
          roles = @(
              "read"
          )
          grantedToIdentities = @(
              @{
                  application = @{
                      id = <APPLICATION_ID_HERE>
                      displayName = <APPLICATION_DISPLAY_NAME_HERE>
                  }
              }
          )
      }
      New-MgSitePermission -SiteId <SITE_ID_HERE> -BodyParameter $params

Notes:

  • Some solutions may differ as Microsoft updates may not be included in this version of the article.
  • A Powershell version of 5.1 or higher is required for this solution.
  • If you want to use the option of syncing the Relatics URL with Sharepoint, you will need to give the sites write permissions. Just replace the read part of the Powershell script with:
    roles = @(
        "write"
    )
* In the workspace, the user type of your user must be set to power user to use this feature.
** In Sharepoint, the administration role of your user must be set to Global administrator or Sharepoint administrator to enable this feature.