Having followed the instructions at https://docs.microsoft.com/en-us/sharepoint/dev/spfx/use-aad-tutorial#DeploymentAndPermissionsGrant, my SharePoint web part experiences an error when I try to retrieve anything more than the basic fields.
For example, this call works:
https://graph.microsoft.com/v1.0/users?$select=displayName,mail,userPrincipalName
However, this call results in a 501 Not Implemented
exception` stating, "This operation target is not yet supported."
https://graph.microsoft.com/v1.0/users?$select=displayName,mail,userPrincipalName,hireDate
In my package-solution.json:
"webApiPermissionRequests": [
{
"resource": "Microsoft Graph",
"scope": "User.Read.All"
}
]
The calling script is very simple i.e.:
this.context.msGraphClientFactory
.getClient()
.then((client: MSGraphClient): void => {
// From https://github.com/microsoftgraph/msgraph-sdk-javascript sample
client
.api("users")
.version("v1.0")
.select("displayName,mail,userPrincipalName,hireDate")
I have already approved the access via the /_layouts/15/online/AdminHome.aspx#/webApiPermissionManagement
page:
Update: I also tried updating my "package-solution.json to use the value Microsoft.Azure.AgregatorService rather than Microsoft Graph" but when attempting to approve the permission on the API management page (screenshot above), I get this error:
[HTTP]:400 - [CorrelationId]:5134e69e-f000-8000-b901-2a4b8bab60b8 [Version]:16.0.0.8929 - A service principal with the name Microsoft.Azure.AgregatorService could not be found. Parameter name: resourceName
I am also not seeing the permissions I've approved under SharePoint Online Client Extensibility - Permissions in the Azure Portal (not sure if I am supposed to, but I just wanted to mention it!).
This is my request-id
if it helps someone from Microsoft figure out what might be going on!
ed3ff30c-d552-462e-be70-c69a19275049