When you open a Power App for the first time, you'll be prompted to consent to any connections being used. Fortunately, we can disable this prompt using PowerShell!

When using Power Apps and connecting to an external source, such as SharePoint, a database, or other connection, your users will be prompted to allow the connections the first time they load the app.

While this is recommended for standalone apps, in many cases, we want to embed the Power App into a SharePoint page, in which case we don't want to prompt the user.

Fortunately, we can turn this off! I've found many variations of these steps. It depends on how your environment is set up. This is what worked for me. I ran this from the Windows PowerShell ISE run as administrator.

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force
dir . | Unblock-File
Install-Module -Name Microsoft.PowerApps.Administration.PowerShell
Install-Module -Name Microsoft.PowerApps.PowerShell -AllowClobber
Import-Module Microsoft.Online.SharePoint.Powershell -Verbose
Connect-SPOService -Url https://<<your tenant>>-admin.sharepoint.com
Set-AdminPowerAppApisToBypassConsent -AppName <<GUID>>
  1. Set the Execution Policy to allow us to run the PowerShell. Accept the prompts.
  2. Install the Power Apps modules. Accept the prompts.
  3. Import the SharePoint  PowerShell module.
  4. Connect to the tenant admin site. You'll be prompted to authenticate.
  5. Set-AdminPowerAppAPIsToBypassConsent is the command that applies the change. Pass in the AppName (this is the App ID that can be found on the App Details page)
  6. I was prompted for the environment name, which can be found by running Get-AdminPowerAppEnvironment, and it will return the default environment name. Copy the value to be used for the Environment parameter when prompted.

Additional Resources

Set-AdminPowerAppApisToBypassConsent (Microsoft.PowerApps.Administration.PowerShell)
The Set-AdminPowerAppApisToBypassConsent cmdlet changes the consent bypass so that users are are not required to authorize API connections for the input app. The command changes the bypassConsent flag of an app to true. Using this command, end users will observe consent is bypassed for First Party c…
PowerShell support - Power Platform
Description of the different PowerShell cmdlets and a walkthrough of how to install and run them.