Cannot delete Microsoft Entra tenant: license-based subscriptions, applications or users still exist
The Delete tenant check in the Microsoft Entra admin center fails because subscriptions, users, apps, self-service products, MFA providers or unpaid invoices remain.
Why does this Entra ID error happen?
Microsoft only deletes a tenant when all of these are true: invoices are paid, only the one Global Administrator doing the deletion remains, no applications remain, no multifactor authentication providers are linked, and no subscriptions (Microsoft 365, Azure, Entra ID P1 or P2) are associated with it. Licence-based subscriptions must reach Deprovisioned, which takes about four months if you just wait. The check fails on whichever of these is still present. Microsoft first-party apps are the exception: they cannot be deleted, and Microsoft says they do not prevent deletion.
Where does this Entra ID error appear, and what does it affect?
You see it in the Microsoft Entra admin center when you select Microsoft Entra ID > Overview > Manage tenants, tick the tenant and select Delete. Each failed check links to what needs fixing. The older Azure portal shows messages such as Directory has one or more Azure subscriptions, Directory has one or more applications or Delete all users except yourself. It usually appears at the end of a tenant decommission or after a tenant-to-tenant migration.
How do you fix this Entra ID error?
- 1
Step 1
License-based subscriptions: in the Microsoft 365 admin center go to Billing > Your products, set Subscription status to All, cancel each active subscription, then select Delete on each disabled one and confirm Delete subscription. It reaches Deprovisioned 72 hours later. Export data first: data is deleted within three days and SharePoint and OneDrive content immediately. Microsoft Customer Agreement subscriptions cannot be deleted early; they go at the end of the term. Subscriptions from a partner or reseller must be cancelled by them.
- 2
Step 2
Azure subscriptions: cancel them in the Azure portal, then delete once the option appears (seven days after cancelling for standard subscriptions, three days for free trial and pay-as-you-go), or transfer billing ownership to another tenant. A cancelled subscription still blocks deletion, and Switch directory alone does not help.
- 3
Step 3
Users: delete every user except the Global Administrator doing the deletion. If users sync from on-premises Active Directory, turn off directory sync first, then delete them in the cloud.
- 4
Step 4
Applications you own: delete app registrations under App registrations > All applications, and non-Microsoft apps under Enterprise apps.
- 5
Step 5
Enterprise apps the portal will not delete: remove them with Microsoft Graph PowerShell, signed in as a Global Administrator homed in this tenant (not a guest or Microsoft account). Confirm the tenant context first, because the command removes every service principal it can. Run it more than once, and if some still fail, disable them and remove again (see the commands below).
- 6
Step 6
Microsoft first-party apps: if you see
You can't delete this application because it's a Microsoft first party applicationorSpecified App Principal ID is Microsoft Internal, leave them. Microsoft says these do not prevent deleting the directory. - 7
Step 7
Self-service sign-up products (Power BI, Azure Rights Management, Power Apps, Dynamics 365): back up their data, then go to Microsoft Entra ID > Licenses > Self-service sign-up products, select each and Delete. Deletion is immediate and cannot be undone.
- 8
Step 8
MFA providers, unpaid invoices and partner directories: remove linked MFA providers, pay outstanding invoices under Billing > Bills and payments, and for a partner directory contact Microsoft Partner Support.
- 9
Step 9
Run the deletion again under Microsoft Entra ID > Overview > Manage tenants > Delete. If a check still fails on something you cannot remove, Microsoft says some tenant configurations cannot be deleted and to contact Microsoft support.
Connect-MgGraph -TenantId <tenant-id> -Scopes "Application.ReadWrite.All"
Get-MgDomain # confirm you are in the tenant you are deleting
Clear-AzContext -Scope CurrentUser
Connect-AzAccount -Tenant <tenant-id>
Get-AzContext
Get-MgServicePrincipal -All | ForEach-Object { Remove-MgServicePrincipal -ServicePrincipalId $_.Id }
Get-MgServicePrincipal -All | ForEach-Object { Update-MgServicePrincipal -ServicePrincipalId $_.Id -BodyParameter @{ accountEnabled = $false } }
Get-MgServicePrincipal -All | ForEach-Object { Remove-MgServicePrincipal -ServicePrincipalId $_.Id }How do you check this Entra ID error is fixed?
- Billing > Your products, with status All, shows no active subscriptions and every disabled one deleted or past its term.
- Rerun
Get-MgServicePrincipal -All: only Microsoft-owned apps remain. - Users > Active users shows only the Global Administrator doing the deletion.
- Manage tenants > Delete shows every check passed, and after deletion the tenant is no longer listed.