[Enter feedback here]
I followed the above instructions but instead of giving tenant wide full control, I tried to provide permission to specific site collection only as shown below.

Connect-PnPOnline -Url "https://mytenant.sharepoint.com/sites/mysite" -ClientId "1234567890" -ClientSecret "1234567890"
When I tried to call the api using Pnp, I am getting following error message.
Get-PnPSubWeb -Recurse -IncludeRootWeb
Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
Either this article is not valid anymore or it requires tenant wide full control to work, which is scary.
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
[Enter feedback here]
I followed the above instructions but instead of giving tenant wide full control, I tried to provide permission to specific site collection only as shown below.
Connect-PnPOnline -Url "https://mytenant.sharepoint.com/sites/mysite" -ClientId "1234567890" -ClientSecret "1234567890"
When I tried to call the api using Pnp, I am getting following error message.
Get-PnPSubWeb -Recurse -IncludeRootWeb
Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
Either this article is not valid anymore or it requires tenant wide full control to work, which is scary.
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.