Having Trouble Granting Permissions to Azure AD App for SharePoint
Asked by
TechSaver2023
I'm trying to give my Azure AD app permission to access a few SharePoint sites, but I'm hitting a snag that I can't seem to resolve. I've set up an Azure App Registration that has full control access to the SharePoint sites, and I use it frequently without issues. However, when I log into PnP PowerShell with this app registration and attempt to use the Grant-PnPAzureADAppSitePermission cmdlet, I receive an access denied error. The error reads: {"error":{"code":"accessDenied","message":"Access denied","innerError":{"date":"2025-07-07T15:25:50","request-id":"d6e54492-2f8f-4a7c-bf53-a836a09c07f0","client-request-id":"d6e54492-2f8f-4a7c-bf53-a836a09c07f0"}}}. I've confirmed that the PnP App registration has Sites.FullControl.All permissions, which I thought would prevent this type of error. Any help would be appreciated!
Answers
Have you tried allowing PnP PowerShell to generate its own client ID? Sometimes that can bypass issues with current registrations. It's worth a shot to see if the same error occurs!
Reply to this answer
Add your answer
Answers are reviewed before publication.
TechSaver2023: What do you mean by generating its own client? I'm not sure how to do that.