Bypass the user consent prompt in Power Apps
How to turn off the consent prompt in Power Apps using PowerShell.
Table of Contents
When using Microsoft Power Apps and connecting to an external source, such as SharePoint, a database, or other connection, users will be prompted to allow the connections the first time they load the app.
Fortunately, we can turn this off! 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>>
```
- Set the Execution Policy to allow us to run the PowerShell. Accept the prompts.
- Install the Power Apps modules. Accept the prompts.
- Import the SharePoint PowerShell module.
- Connect to the tenant admin site. You'll be prompted to authenticate.
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)- 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


Newsletter
Join the newsletter to receive the latest updates in your inbox. After entering your name and email, you can choose Focustivity (PKM and Self Development), Microsoft Roundup, or both.
Subscribe