How to remove a faulty tab from a channel

Every now and then while removing a tab from a channel I get an error, and if the tab is an SPFx app I no longer can remove it using the UI.

This happens because the removal process gets interrupted, the reference to the tab in the Hosted Apps Config list on SharePoint gets deleted but the tab remains on Microsoft Teams.

PowerShell is always my first choice to fix these kind of issues but since tabs are not available in the Microsoft Teams module I need to use Microsoft Graph to remove the broken tabs.

How to remove a tab using Microsoft Graph

To remove the faulty tabs I use the Graph Explorer for convenience to avoid dealing with the authentication, the following section has a detailed explanation of how to do it.

  1. Open the Microsoft Graph Explorer – https://developer.microsoft.com/en-us/graph/graph-explorer
  2. Click on Sign in and authenticate with your account
  3. Click on Modify permissions
  4. Check the Read.All, User.Read.All and click Modify permissions
  5. Authenticate again and accept the new permissions
  6. Click on Show more samples
  7. Turn on the Microsoft Teams
  8. Click on My Joined Teams and then Run Query
  9. Look for the team where you have your faulty app and copy the ID
  10. Click on Channels of a team which I am member of
  11. Replace the {Team ID} by the ID of your team and click Run Query
  12. Look for the channel where your faulty tab is and copy the ID
  13. Click on tabs in a channel and replace {Team ID} and the {Channel ID} by the values you copied previously
  14. Locate the faulty tab by its name and copy the ID
  15. Change the query method to delete and paste the following link
    https://graph.microsoft.com/v1.0/teams/{id}/channels/{id}/tabs/{id}
  16. Replace all the IDs and click Run Query
    Remove Microsoft teams tab using Graph

As a workaround this works quite well, it could be automated into a solution but the error removing the tabs doesn’t happen that often to justify it.

Business vector created by iconicbestiary – www.freepik.com


No comments yet

Leave a Reply


I've been working with Microsoft Technologies over the last ten years, mainly focused on creating collaboration and productivity solutions that drive the adoption of Microsoft Modern Workplace.

%d bloggers like this: