Share via

Grant-PnPAzureADAppSitePermission didnt't work

Nuno Magalhaes 21 Reputation points
2026-04-28T08:41:16.4266667+00:00

Hello.

First of all, thank you for your support.

I try to run the script bellow i have a follow error:

Grant-PnPAzureADAppSitePermission -AppId "XXXXXXXX" -DisplayName "XXXXX" -Site https://XXXXX.sharepoint.com/sites/xxxxx-Permissions FullControl

Resumoe the script is to give permission of app registration to have full control of site of sharepoint online

Grant-PnPAzureADAppSitePermission: {"error":{"code":"generalException","message":"General exception while processing","innerError":{"date":"2026-04-28T08:17:16","request-id":"xxxxxxx","client-request-id":"xxxxxxxx"}}}

Can anyone help me how to resolve this situation?

Thank you

Microsoft 365 and Office | SharePoint | Development
0 comments No comments

1 answer

Sort by: Most helpful
  1. Vasil Michev 126.1K Reputation points MVP Volunteer Moderator
    2026-04-28T09:28:55.03+00:00

    While the error does not indicate any permission-related issue, you should also double-check on that front. If running in the context of a user, make sure he's added as Site collection admin for the site in question. If running in the context of an app, verify that Files.ReadWrite.All is granted, as application permission, and consented to. Here's a recent thread where an issue with the same error was caused due to incorrect permissions: https://learn.microsoft.com/en-us/answers/questions/2261150/microsoft-graph-api-returns-generalexception-when

    0 comments No comments

Your answer

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