Add-PnPApp fails with access denied when connected using a tenant global administrator account.
App should be uploaded into the tenant site app catalog


Connect-PnPOnline -Url 'siteUrl' -Credentials 'credentials'
Add-PnPApp -Path 'appPath'
0.3.7 (Nightly) + Pswh 7.1.0
I'm still trying to investigate on it, if you have a quick tip to monitor outgoing traffic using dotnet core on windows.. I'm still not able to track the request, even using Fiddler everywhere or Fiddler classic as mentioned by @veronicageek. It works only with legacy PnP PowerShell for now. I'll test using Linux also.
Just tried on archlinux, using 0.3.7 (Nightly) + Pswh 7.1.0, same tenant, same user, it works, app package is uploaded.
This issue is related to pnpframework, my apologies for tracking it here ;
AppManager.cs, there is a method called "Task
Only for Windows Platform, we're trying to get the requestDigest which fails with access denied
var requestDigest = await httpClient.GetRequestDigestWithCookieAuthAsync(handler.CookieContainer, _context.Url);
Not sure to get why we're doing it only for Windows, commenting the line resolves the issue in my case.
@erwinvanhunen May I kindly ask you to transfer it to pnpframework repos please ? Thx
@reidav regarding monitoring on Windows: I use Fiddler. I found out that the order of Launching is important. Launch Fiddler first, then launch PowerShell core. It's important to do it in that order.
There is indeed a logic issue with retrieving the request digest retrieval. I will move this issue to the PnP Framework repo and take it from there. I already am working on a fix.
@reidav regarding monitoring on Windows: I use Fiddler. I found out that the order of Launching is important. Launch Fiddler first, then launch PowerShell core. It's important to do it in that order.
You made my day ! I've been through lots of details to get a trace ($env:http_proxy, wireshark sslkeylog and many more ..) Respecting the start order is really a key for success :) Thanks !
We just merged a fix for this issue which will be available in the nightly release of tomorrow in both the PnP Framework and PnP PowerShell.
Most helpful comment
We just merged a fix for this issue which will be available in the nightly release of tomorrow in both the PnP Framework and PnP PowerShell.