Skip to content

Bypass the user consent prompt in Power Apps

How to turn off the consent prompt in Power Apps using PowerShell.

Eric Gregorich
Eric Gregorich
2 min read

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>>
```
  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.
Power Apps

Eric Gregorich Twitter

I design and build software solutions that help companies and people be more productive.


Related Posts

How to access environment variables in a Canvas Power App

How to access Environment Variables for text and other data type values from your canvas Power App. Useful for managing settings for environments.

An example app with a text label control.

Name too long error in Power Apps

An error appears in Microsoft Power Apps. There was a problem saving your data. The name could be too long. This only occurs when using the SaveData function to save data to the device. There may be too much data in the collection that is being saved, but the data

Microsoft Power Apps Icons

Microsoft Power Apps has a few icons built-in that we can use in our applications. If you want more options, you can follow these simple steps. ^ 1. Go to the site Power Apps Icons. 2. Search for the icon name to find the one you want. 3. Click the color

Microsoft Power Apps Icons