May 5, 2020

How to Clean Up Unused Workspaces in Power BI

Microsoft’s Power BI is a premier enterprise reporting platform. Its powerful self-service analytics enable business leaders to scale and customize reporting without developer expertise.

Most of our Fortune 500 customers use Power BI across their organizations. Teams can develop their own Power BI workspace with customized dashboard and report collections. With every organizational team creating their own workspace, management is challenging. To perform maintenance, report administrators typically navigate to the Power BI portal and manually locate and remove empty/unused workspaces.

Enterprise Power BI customers with high adoption and usage rates need ways to simplify workspace management. With our open-source solution on GitHub, users can now automatically locate unused workspaces for quicker removal.

Solution Design:

We developed a web app that uses Power BI REST API calls to fetch and display workspace metadata, including report, data set, and dashboard content. After fulfilling prerequisites and gaining access, users can view workspaces based on user role. If a workspace is empty, users can delete the workspace from a centralized page.

Figure 1: Centralized page displaying workspace content information

The Power BI Rest APIs are internally configured to convert groups from classic to V2 workspaces during deletion. As deletion is permanent, our app displays a warning message for users to confirm before deleting empty workspaces.

User Access

To access the application, users must sign in using their Office 365 accounts. Users can view workspace details with basic viewer access. To delete workspaces, users need administrator access.

App Permissions

To run the application, the user must grant consent on Workspace.ReadWrite.All and Report.ReadWrite.All permissions. The Azure Active Directory requires permissions to generate the access token, which is used by the remaining API calls to retrieve a list of accessible workspaces.

To authorize the application to call APIs that delete workspaces, users/admins need to provide Admin Consent. The list of configured permissions must include all permissions needed by the application, as shown below.

Figure 2: List of required permissions


  Automatically locate empty/unused workspaces for quicker clean up 
  Enhance security with role-based usage
  Enable workspace tracking 

To clean your workspaces with just the click of a button, check out our open source solution on GitHub. Feel free to fork the solution and contribute to it. If you come across any issues, please raise them in the issues section.