Set-AdminPowerAppApisToBypassConsent

Sets the consent bypass of an app to true.

Syntax

Set-AdminPowerAppApisToBypassConsent
   -EnvironmentName <String>
   -AppName <String>
   [-ApiVersion <String>]
   [<CommonParameters>]
Set-AdminPowerAppApisToBypassConsent
   [-ApiVersion <String>]
   [-ForceLease <Boolean>]
   [<CommonParameters>]

Description

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 connectors that support single sign-on and custom connectors that don’t require authentication. This includes custom connectors with or without a gateway.

Examples

EXAMPLE 1

Set-AdminPowerAppApisToBypassConsent -EnvironmentName [Guid] -AppName [Guid]

Updates the specified input canvas app to not require consent for APIs in the production tenant of the signed on user.

EXAMPLE 2

Set-AdminPowerAppApisToBypassConsent -EnvironmentName [Guid] -AppName [model driven app unique name]

Updates the specified input model driven app using custom pages to not require consent for APIs in the production tenant of the signed on user. You can find a model driven app's unique name in the properties section in the app authoring experience.

EXAMPLE 3

Add-PowerAppsAccount 
$connectors = Get-PowerAppConnector
$firstPartyConnectors = $connectors.Where{$_.Internal.properties.connectionParameters.token.oAuthSettings.properties.IsFirstParty -eq $true}
foreach($firstPartyConnector in $firstPartyConnectors)
{
    Write-Host $firstPartyConnector.Internal.name - $firstPartyConnector.DisplayName
}

The list of First Party connectors can change over time. It is easiest to get the full list of First Party connectors using the following PowerShell commands.

Parameters

-ApiVersion

Version of Power Apps API to use.

Type:String
Position:Named
Default value:2017-05-01
Accept pipeline input:False
Accept wildcard characters:False

-AppName

ID of Power Apps app to update.

Type:String
Position:Named
Default value:None
Accept pipeline input:True
Accept wildcard characters:False

-EnvironmentName

ID of the environment (not the display name).

Type:String
Position:Named
Default value:None
Accept pipeline input:True
Accept wildcard characters:False

-ForceLease

Forces the lease when overwriting the Power Apps fields. The lease creates and manages a lock on the Power Apps fields for write and delete operations. Defaults to false if no input is provided.

Type:Boolean
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False