We used links such as Office365User and Sharepoint in a sharepoint form application we have made. However, we realized that end users are constantly faced with a permission pop-up when they try to open this form. The pop-up asks the user for Office365User and Sharepoint permission, but even if the user gives permission, the user is repeatedly asked for permission when each page is refreshed.

PowerApps Connection Permissions

First of all, I would like to state the source of the problem. As a result of the links used in the application, a permission is obtained from the end users that the relevant links will be used. These links can be accessed from power automate or powerapps panel. It is even possible to view where each connection is used. Normally, when the user allows a connection, these connections should be saved and the user should not be asked again and again. However, for some reason that I do not know the reason for now, when the end user gives permission, it is not recorded and therefore the user is repeatedly given permission.

1st Solution

If few people use the app, there is a solution that is not a complete solution.

  • The user enters the customize form or edit app field.
  • The same permission confirmation appears on the screen that appears.
  • The permission granted here is permanently registered on the connections.
  • When the user leaves the edit screen and logs in to the application or form, the system will not ask for permission again.
  • However, this method doesn't make much sense if you have a large number of users or if you don't want to bring users into the editing area.

2nd Solution

Some conditions are required to implement this solution.

  • You must be the global administrator of your tenant.
  • You must own the application you have made.
  • Your PowerShell version must be 5 or higher.

First, run "Windows PowerShell" as administrator on your computer.

$PSVersionTable.PSVersion

code to check the powershell version.

If version 5 and above, respectively;

Install-Module -Name Microsoft.PowerApps.Administration.PowerShell
Install-Module -Name Microsoft.PowerApps.PowerShell -AllowClobber

codes. At this stage, you may receive some notifications that you need to accept. You can answer these notifications by typing "Y" or "A".

Then we need to log in to our microsoft account with the code below.

Add-PowerAppsAccount

It should be noted that the account entered must be both the global admin and the owner of the app.

Finally, we write the bypass command.

Set-AdminPowerAppApisToBypassConsent -EnvironmentName {1} -AppName {2}
  • EnvironmentID must be written in the field labeled {1}. You can find this value in the powerapps settings area.
  • App ID should be written in the field where {2} is written.
Environment ID
App-Id

If you received a return of 200 after the bypass code, the transaction was completed successfully.

Users will no longer have to give permission every time they open an application. Here, if you get erroneous returns such as 403 instead of 200 returns, the user you logged in may have an authorization problem. In the other case, I recommend you to check the relevant {1} and {2} fields.

Note: If changes are made in the application after this process, these operations may be invalid. In this case, you may need to do the operations again.

For other similar operations; Learn