One of the newer features in the Power BI Admin Portal is the ability to view all of a tenant’s Workspaces. As I was browsing through the collection of workspaces, I noticed several marked as Orphaned. What is an orphaned workspace, and how does it occur?
What is an Orphan?
An orphaned workspace is one that does not have an admin assigned. Kay Unkroth from the Power BI product team mentioned this in a recent blog post on workspace management.
Workspaces are assigned one of several states: Active, Deleted, Removing, Orphaned
How to Check for Orphans in Power BI Service
If you’re a Service Admin, you can now view all of your organization’s workspaces through the Admin Portal in the user interface. Previously, it was only possible to get this content using Power BI’s REST API or the PowerShell cmdlet that wraps the API.
Go to the Admin Portal and select Workspaces.
Browse through the collection of workspaces, sort based on the State column, or place a text filter on State that filters down to Orphaned.
My tenant had a lot of orphans…
What Causes an Orphan?
Is an orphaned workspace a problem? Apart from cluttering your tenant with resources that no one owns, probably not too much. I would like to know what caused all of these orphans in my organization’s tenant though. At first I though it might have been due to turnover and the deactivation of accounts.
I determined by the workspace names, however, the user who had originally created these orphaned test workspaces. It was an active user. I contacted him to try to figure out more of his process and see if we could replicate what he did. He said that he had manually created and deleted the workspaces–no API or PowerShell involved. When we tried to recreate the process again, it led to a properly Deleted workspace–not Orphaned.
I have to assume that there was something from earlier in the Summer or Fall of 2018 that has since been corrected. It is more difficult for users with “new workspaces / workspaces V2” to make orphans.
It is still possible to create orphaned workspaces though–both in the Service and via API. If there are more ways that people have found than what follows, I would love to hear about the process in the Comments below.
Making Orphans – Attempt 1 – Failure
My first attempt was to simply try to remove myself as the admin from a workspace. Thankfully, it’s not that easy. I created a brand new V2 workspace. There were no other members, only my user as the workspace admin.
I then opened Workspace Access and attempted to Remove myself. From within the workspace, Power BI checks to make sure that there is at least one admin. You cannot remove a workspace’s only admin using this method.
Power BI provides this friendly message, and attempting to simply remove myself like someone might typically try to remove users (fortunately) fails.
Making Orphans – Attempt 2 – Success
These attempts to create orphans are of course only to test out how it could be achieved. Don’t actually do this. That “you” from the message above stating that you can’t remove all admins from this workspace is talking about the workspace admin you, not the Service admin you. It’s possible to do this in the UI from the Admin Portal using a similar approach as Attempt 1. Bug?
To generate an orphan as an admin for testing purposes, you would simply need to go to the Workspaces area in the Admin Portal, select Access for a given workspace, and remove the admin(s). Unlike the similar workflow from the workspace itself, this method lets you remove all users/admins without a warning message.
We now have an orphan.
It’s easy to Recover an orphan from this screen. Simply select the workspace and click Recover, then add yourself or another user as an admin.
The workspace state changes back to Active once it has an admin user assigned.
Making Orphans – Attempt 3 – Success
Once I knew that I could intentionally create an orphan using the Admin Portal, I thought that it would be likely I could do the same thing with the API or PowerShell. I could. Using the Remove-PowerBIWorkspaceUser PowerShell cmdlet, the following command created an orphaned workspace when used to remove the workspace’s only admin.
The good news is that it’s apparently not as easy as it used to be for a non-admin user like my colleague to create orphaned workspaces. Perhaps this was a bug with new workspaces that Microsoft has already corrected. It is still possible though as an admin using either the UI or code. Fortunately, if you ever find yourself with an orphaned workspace, it’s only a few steps to Recover that workspace by assigning a user as an admin through the Admin Portal or code.