A cloud-based identity and access management service for securing user authentication and resource access
It seems the issue cleared up on its own after a few weeks.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I have an Entra ID tenant that I would like to delete. The dialog to delete the tenant is suggesting an enterprise application exists that must first be deleted.
The only enterprise applications left are first-party which cannot be deleted. I've waited several days thinking one of the applications I did delete was pending, but that did not make a difference.
Does anyone know how to troubleshoot this?
Thank you.
A cloud-based identity and access management service for securing user authentication and resource access
It seems the issue cleared up on its own after a few weeks.
To troubleshoot and unblock deletion of the Entra ID test tenant when an enterprise application is still reported:
Install-Module Microsoft.Graph
Install-Module -Name Az
b. Connect to the tenant to be deleted with a homed Global Administrator:
Connect-MgGraph -Scopes "Application.ReadWrite.All"
Run Get-MgDomain to verify the connected tenant ID and onmicrosoft.com domain. c. Verify Az context to avoid affecting the wrong tenant:
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 test tenant. d. Remove service principals (enterprise apps):
Get-MgServicePrincipal -All | ForEach-Object {
Remove-MgServicePrincipal -ServicePrincipalId $_.Id
}
Run this multiple times until no more service principals can be removed. e. If some service principals still cannot be deleted, disable them and retry removal so they no longer block tenant deletion:
$ServicePrincipalUpdate = @{ "accountEnabled" = "false" }
Get-MgServicePrincipal -All | ForEach-Object {
Update-MgServicePrincipal -ServicePrincipalId $_.Id -BodyParameter $ServicePrincipalUpdate
}
Get-MgServicePrincipal -All | ForEach-Object {
Remove-MgServicePrincipal -ServicePrincipalId $_.Id
}
This PowerShell-based cleanup is specifically intended for cases where non‑deletable enterprise applications are blocking tenant deletion.
References: