Enable or disable the Power Apps Consent Dialog
How to use PowerShell to disable the consent dialog showing when a user opens Microsoft Power Apps for the first time or when a new connection is added.
Table of Contents
When we publish a canvas Power App to users, when they first access the app, they'll be prompted to verify their connections within the app. These may be connections to SharePoint, Dataverse, SQL, etc.
Most of the time, these connections are all good to go, and the user only needs to click to accept and move on. If you want to hide this dialog altogether, you can run the PowerShell shown below.
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 {Your SharePoint Admin Tenant URL}
Set-AdminPowerAppApisToBypassConsent \-AppName {Your App ID}
When prompted, enter your Environment ID in the URL or the Power Platform Admin center in the selected Environment.
The following PowerShell clears the consent bypass that is set. The users will again be prompted for consent when they open the app for the first time or if a new connection is added.
Clear-AdminPowerAppApisToBypassConsent -AppName {Your App Id}
The Weekly Cache
A weekly newsletter where I share what I did, what I learned, what I discovered, what I read, and more. Each edition is short and to the point, and packed with interesting links.