Blog
Apps - What happens to canvas apps when the owner/employee leaves an organisation?
When an employee leaves an organisation, what happens to the apps that they've built? Can other employees continue to edit and access the apps?
An employee creates an app and becomes the owner
To demonstrate, let's take the fictional user "Pradeep Gupta". Pradeep creates a Canvas app. Because Pradeep creates the app, he automatically becomes the "Owner" of the app. The app owner has full control of the app, including the ability to edit, share, and delete the app.
As part of the app development process, Pradeep shares the app with "Sally Smith" and "Tim Leung", and assigns the roles "User" and "Co-owner" respectively. The difference between these roles is that a "Co-owner" has rights to edit an app, whereas a "User" has rights to run an app only.
The employee leaves and the administrator deletes the app owner
Pradeep now leaves the company. As part of this process, the Microsoft 365 administrator deletes Pradeep's account through the Microsoft 365 admin center, shown below.
- It's possible to easily restore a user through the 'Deleted Users' section of the Microsoft 365 admin center, for up to 30 days after the initial deletion. Therefore if anything goes wrong, there is a possible recovery path.
- Deleting a user deletes the user's OneDrive files. The reason why this is important is that the user might have created apps based on Excel datasources in OneDrive, and these will be deleted as part of the user deletion process. Therefore, it's good practice to reassign the ownership of OneDrive contents to another employee.
What happens to apps after the app owner is deleted?
After an administrator deletes Pradeep from the Microsoft organisation, this is what we see when we enter the app sharing settings.What can Owners do that Co-owners cannot do?
Now that our app has no owner, what's the practical impact of this? Effectively, a co-owner can do almost everything that the owner could do. However, one thing that a co-owner cannot do is delete an app (the 'delete' menu option is greyed out in the app list). Therefore, there is now no way for any of the assigned users to delete the app, although it's possible for a tenant administrator to carry out this task with Power Shell.
How to change/reset the owner of a canvas app
To set an app owner or to change the owner of an app, we can perform this action with Power Shell. Lee Zuckett (Senior Power Apps program manager at Microsoft) and Steve Jeffery recently published a great article on this topic. I was fortunate to have worked with Lee during my book project, so I would recommend his post, particularly if you want to learn more about resetting the owners of model-driven apps.
In terms of our example, to reset the owner of our app, we first need to install the PowerShell Cmdlets for Power Apps. To use the Cmdlets, we require tenant admin access, the environment id, app id, and user id. My post here. describes how to retrieve the environment and app ids:
http://powerappsguide.com/blog/post/general-how-to-restore-undeleting-an-app
To reset the app owner, here are the initial Power Shell commands that we need to run.
Install-Module -Name Microsoft.PowerApps.Administration.PowerShell
Install-Module -Name Microsoft.PowerApps.PowerShell –AllowClobber
Add-PowerAppsAccount
The Set-AdminPowerAppOwner cmdlet resets the owner. Note that '$Global:currentSession.userId' value specifies the user id of the user that's currently running the Power Shell script.
Set-AdminPowerAppOwner
-AppName "c76e2c97-5740-4b63-a00c-bf8a83da8b40"
-EnvironmentName "Default-df7b308b-854f-4f83-bb6b-bcee961c8b51"
-AppOwner $Global:currentSession.userId
The screenshot beneath highlights the result when this cmdlet succeeds - specifically, the "error" entries will be blank.
If we now return to the app sharing screen, we now see that "Tim Leung" is now the owner of the app.
Can an app have 2 owners?
Is it possible for an app to have 2 owners? The answer is no. If we attempt to assign another owner with the Set-AdminPowerAppOwner cmdlet, it overwrites the existing owner with the new owner.
Set-AdminPowerAppOwner
-AppName "c76e2c97-5740-4b63-a00c-bf8a83da8b40"
-EnvironmentName "Default-df7b308b-854f-4f83-bb6b-bcee961c8b51"
-AppOwner 217ee3ae-05c3-401d-b34a-3f86fd0b398a
The important point to note here is that when we call Set-AddPowerAppOwner cmdlet, it resets the existing owner as a "User", rather than a "Co-owner".
As a side note, one way to retrieve the user id of a specified user for use with the Set-AdminPowerAppOwner cmdlet, is to open the user in the Microsoft 365 admin center, and to retrieve the user from the address bar (shown below).
Conclusion
- Categories:
- general
- How to work more quickly with Power Apps by creating browser bookmarks
- What languages does Power Apps support, and how to start Power Apps in a different langauge?
- New model driven app designer - a first look
- Learn Power Apps and Dataverse with the free, online 'app in a day' training course
- Themeing - How to apply consistant styles and themes to canvas apps with the CoE theming solution
- Does Power Apps still support Internet Explorer (IE) - 2020?
- How app design will become much easier with the new converged/integrated canvas and model driven app designer
- General - The easiest way to convert phone apps to tablet apps
- Email - How to send email with the Office 365 Outlook connector
- General - How to change the language of Power Apps Studio
- 2021 Release Wave 1 - A review of the upcoming features for April - September 2021
- GPS - 3 Frequent Questions about Location Services
- Settings - Old Layout vs New Layout (2021)
- What to do when some part your app breaks, or starts behaving differently?
- 5 Tips for when you can't sign into Power Apps