S2SUnauthorized error while retrieving Microsoft 365 usage reports via MS Graph API

Ridhi Jain 1 Reputation point
2022-02-23T18:41:25.9+00:00

I have been trying to get usage reports via Graph API using MSGraphClient in SPFx. I have added Reports.Read.All permissions in my package-solution.config file. I am getting the error "S2SUnauthorized-Invalid permissions".

I have also granted limited administrative role to the user for accessing the reports data. I have granted admin consent by going to the Azure AD application

177322-image.png

As per this article https://learn.microsoft.com/en-us/sharepoint/dev/spfx/use-msgraph this is a known issue.

Can anyone please suggest an alternate way of exporting usage reports data programmatically?

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,000 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Vicky Kumar (Mindtree Consulting PVT LTD) 1,171 Reputation points Microsoft Employee
    2022-02-28T06:30:01.9+00:00

    Similar question - https://learn.microsoft.com/en-us/answers/questions/748213/index.html , please check comment on that questions.

    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.