Share via

Cannot delete Microsoft Entra tenant

Mihiran Priyankara 10 Reputation points
2026-03-31T19:55:52.2133333+00:00

I am trying to delete my tenant ,The tenant deletion checklist shows all items green except for 'Enterprise Applications', which has an orange warning with a 'Delete all enterprise applications' link. However, when I click that link, the Enterprise Applications page shows 0 applications.

User's image

Does anyone have an idea about this?

Microsoft Security | Microsoft Entra | Microsoft Entra ID

1 answer

Sort by: Most helpful
  1. Q&A Assist
    2026-03-31T19:56:09.5233333+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    The tenant deletion check can still be blocked by hidden or system enterprise applications (service principals) that don’t appear in the Enterprise applications blade. These must be removed or disabled by using Microsoft Graph and Az PowerShell, then the deletion can be retried.

    Follow these steps:

    1. Install the required PowerShell modules
         Install-Module Microsoft.Graph
         Install-Module -Name Az
      
    2. Connect to the tenant to be deleted (as a homed Global Administrator)
         Connect-MgGraph -Scopes "Application.ReadWrite.All"
      
      Run Get-MgDomain to verify the connected tenant ID and onmicrosoft.com domain.
    3. Verify Az context for the same tenant (safety check)
         Clear-AzContext -Scope CurrentUser
         Connect-AzAccount -Tenant <object id of the tenant you are attempting to delete>
         Get-AzContext
      
      Confirm the tenant ID and domain match the tenant that should be deleted. Do not skip this step to avoid deleting apps in the wrong tenant.
    4. Remove all service principals (enterprise apps) Run the following command multiple times until no more service principals can be removed:
         Get-MgServicePrincipal -All | ForEach-Object { Remove-MgServicePrincipal -ServicePrincipalId $_.Id }
      
    5. If some service principals cannot be deleted, disable 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 
         }
      
    6. After the service principals are removed/disabled, go back to the Microsoft Entra admin center and retry tenant deletion from Entra ID → Overview → Manage tenants → Delete.

    This clears hidden enterprise applications that are not visible in the portal list but still block tenant deletion.


    References:

    0 comments No comments

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.