pnpframework icon indicating copy to clipboard operation
pnpframework copied to clipboard

Setting azure app site permissions causes invalid request error related to sharing links

Open EnderArchery opened this issue 9 months ago • 0 comments

I'm coming over here from the pnp powershell module.
I think it's likely that it's caused by some code in here that get's called by the cmdlet when trying to use Set-PnPAzureAppSetSitePermission. Grant-PnPAzureAppSetSitePermission -Permission Write seems to work, however after execution it an re-authenticating the application, it still doesn't have the permission to Read or Write.

So, I tried with the following:

Set-PnPAzureADAppSitePermission -Site "https://contoso.sharepoint.com/sites/hr" -PermissionId "<copied from api permissions section>" -Permissions FullControl

Which returned Set-PnPAzureADAppSitePermission: {"error":{"code":"invalidRequest","message":"Sites can not have sharing link permissions","innerError":{"date":"2025-03-17T10:24:12","request-id":"reqId","client-request-id":"cReqId

And seeing as even assigning read permissions doesn't work, I don't know what to do about it.

Does anybody else have experience with working around this problem? (No I can't just change sharing link permission for our tennant)

EnderArchery avatar Mar 17 '25 10:03 EnderArchery