By default, the Power Platform does not allow service principals to use its API’s, but this can be enabled easily.
To allow M365Permissions to scan PowerApps, Flows etc:
- Note the GUID of the service principal you’re using to scan with (a.k.a. the app id or client id)
- Open a powershell window
- Run the following code:
Install-Module -Name "Microsoft.PowerApps.Administration.PowerShell"
Add-PowerAppsAccount
New-PowerAppManagementApp -ApplicationId {APPID}
Where you replace {APPID} with the GUID from step 1
[…] 1.2.2 adds scanning of PowerApps and Flows! Only when using SPN auth. (setup instructions) […]