Quite often, developers who have developed Power Apps leave the organisation, leaving issues behind because the accounts they used are being disabled. This results in a non-functional app. That’s why, in this short post, I’ll explain how to update the ownership of your app.

There are several ways to update ownership of a Canvas App; in this quick post, I will use a PowerShell script.

Before updating the ownership, ensure that you have the following prerequisites in place.

  • AppName
  • EnvironmentName
  • AppOwner

 

AppName

To get the AppName (i.e., App ID), navigate to the makers portal, go to Apps, tap the three dots beside the App you want to update the ownership of, and copy the App ID.

EnvironmentName

To get the EnvironmentName (i.e., Environment ID), navigate to the makers portal, on the top right menu, tap on the gear icon, choose SettingsPower AppsDeveloper resources,

and copy the Environment ID  value.

AppOwner

To get the AppOwner (i.e., Object ID) value, navigate to the MS Entra portal, search the user account that will be the user service account for your Power Apps and on the Basic info form, copy the Object ID.

Now that you’ve got all the necessary values, you can proceed to the next step: the PowerShell command to update the ownership.

The screenshot below shows the MyApp owner before and after you execute the PowerShell script.

Using the above values, I will open an elevated PowerShell ISE and run the Set-AdminPowerAppOwner cmdlet.

$AppName= "#######-####-####-####-#############"
$EnvironmentName = "Default-#######-####-####-####-#############"
$AppOwner= "#######-####-####-####-#############"

Set-AdminPowerAppOwner `
-AppName $AppName `
-EnvironmentName $EnvironmentName `
-AppOwner $AppOwner

After executing the Set-AdminPowerAppOwner script, you can see Ownership changed to the Power Apps Service Account.

 

 

 

Share This