I am getting unauthorized(401) error when trying to executing Get-PnPProvisioningTemplate in Azure funciton app powershell(runtime version ~1), I am passing appid and appsceret as parameters at tenant level and site collection level. I am getting the same errors when executing them in Windows powershell.
Connect-PnPOnline -AppId $appId -AppSecret $appsecret -Url $url Get-PnPProvisioningTemplate -Out $dropPath
Thanks