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
Error : Could not retrieve Global Service Principal ID Error: Error: {} when Approve the requested Microsoft Graph permissions

Binu Thomas
126
Reputation points
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 empty
what could be the issue, I tired to search for this error and couldn't find much help.
Accepted answer
1 additional answer
Sort by: Most helpful
-
Binu Thomas 126 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