Error : Could not retrieve Global Service Principal ID Error: Error: {} when Approve the requested Microsoft Graph permissions

Binu Thomas 171 Reputation points
2022-11-01T12:33:03.067+00:00

Hi All,

I am creating my first SPFX application using Microsoft Graph Api

I followed this link https://learn.microsoft.com/en-us/sharepoint/dev/spfx/web-parts/get-started/using-microsoft-graph-apis

But when it reached to the step to Approve the requested Microsoft Graph permissions

I get below error and my page is empty256104-image.png

what could be the issue, I tired to search for this error and couldn't find much help.

Microsoft 365 and Office | SharePoint | For business | Windows
Microsoft Security | Microsoft Graph
0 comments No comments
{count} votes

Accepted answer
  1. Rob Windsor 2,001 Reputation points
    2022-11-01T16:17:02.257+00:00

    There was a bug at one point that caused this error but, as far as I know, it was fixed some time ago. Please see this blog post to see if it helps: SharePoint Online- Bad service principal breaks SharePoint Admin API Access “Global Service Principal ID Error: Error: {}” Resolved

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Binu Thomas 171 Reputation points
    2022-11-02T06:38:18.15+00:00

    I found the issue, As i was doing it for the first time, i had to run the below command. Now that error is gone.

    Enable-SPOTenantServicePrincipal

    Thank you

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.