Can't Delete Tenant Due to Enterprise Applications I Can't See/Delete

Anonymous
2026-03-30T21:07:24.5933333+00:00

I am attempting to delete my tenant so I can delete my organization. Started it so I could learn development and am ready to close it down. Closing it, however, has been a huge pain. I cannot close it due to Enterprise Applications existing that are preventing deletion.

User's image

Upon clicking the link I see this page:

User's image

It appears that there are none there. If I remove all filters, however, I see these:

User's image

Awesome, great. I see the issue. Well, when I attempt to delete them they are all grayed out due to being "Microsoft Internal". Whatever that means. I've connected through MgGraph via PowerShell as well to attempt to remove these and they just won't go away. I have no idea what to do here, as all solutions I've tried regarding "Remove-MgServicePrincipal" have failed.

Yes I'm the only user in the tenant. Yes I have Global Administrator.

Microsoft Security | Microsoft Entra | Microsoft Entra ID

1 answer

Sort by: Oldest
  1. AI answer

    2026-03-30T21:07:42.9266667+00:00

    Use Microsoft Graph PowerShell to remove or disable the blocking enterprise applications, then retry tenant deletion.

    Follow the documented sequence for tenants that are blocked by undeletable enterprise apps:

    1. Install and connect the required modules
         Install-Module Microsoft.Graph
         Install-Module -Name Az
      
      Connect to the tenant that must be deleted using a homed Global Administrator account:
         Connect-MgGraph -Scopes "Application.ReadWrite.All"
      
      Verify that the connected tenant is the one to be deleted:
         Get-MgDomain
      
      Then verify the same tenant with Az (safety check so apps are not removed from the wrong tenant):
         Clear-AzContext -Scope CurrentUser
         Connect-AzAccount -Tenant <object id of the tenant you are attempting to delete>
         Get-AzContext
      
    2. Remove all service principals (enterprise applications) Run the removal in a loop, because some deletions can fail on the first attempt due to dependencies:
         Get-MgServicePrincipal -All | ForEach-Object { 
             Remove-MgServicePrincipal -ServicePrincipalId $_.Id 
         }
      
      Run this command multiple times until no more service principals can be removed.
    3. If some service principals cannot be deleted (for example, Microsoft internal apps), disable them and retry
         $ServicePrincipalUpdate = @{ "accountEnabled" = "false" }
         
         Get-MgServicePrincipal -All | ForEach-Object { 
             Update-MgServicePrincipal -ServicePrincipalId $_.Id -BodyParameter $ServicePrincipalUpdate 
         }
         
         Get-MgServicePrincipal -All | ForEach-Object { 
             Remove-MgServicePrincipal -ServicePrincipalId $_.Id 
         }
      
      Disabling them ensures they no longer block tenant deletion, even if some remain undeletable.
    4. After the service principals are removed or disabled, delete the tenant
      1. Sign in to the Microsoft Entra admin center as Global Administrator.
      2. Go to Microsoft Entra ID → Overview → Manage tenants.
      3. Select the tenant and choose Delete.
      4. If any checks still fail (for example, subscriptions or users), resolve those, then repeat the delete action.

    This process is explicitly designed for the scenario where enterprise applications (including Microsoft internal ones) prevent tenant deletion.


    References:

    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.