Unable to delete M365 Tenant do to existing “Enterprise Applications.”

Problem Description

You may find yourself in the process of deleting a Microsoft 365 Tenant because you’re no longer using it or would like to make the domain name available for reuse.

However, when attempting to “Delete all enterprise applications“, you are not able to proceed with error, “You can’t delete this application because it’s a Microsoft first party application.”

Example:

Cause

This is a common issue where the installed “Enterprise Application” that is preventing the Tenant deletion is not exposed to the “Enterprise Applications” list in the Azure Admin Portal.

Resolution

The resolution is simple if you are familiar with PowerShell and using the MSOnline or Azure modules.  To resolve the issue, execute one of the solutions provided below.

MSOnline Module:

Azure Modules

Note: You may see errors from the PowerShell output while deleting the Service Principals, this is normal as its trying to delete objects that cannot be removed.

After the deletion script completes, you should now be able to delete your Tenant.

More information

Delete an Azure AD organization (tenant) – Azure Active Directory | Microsoft Docs

Troubleshoot common problems adding or removing an application to Azure Active Directory – Active Directory | Microsoft Docs

Az.Accounts Module | Microsoft Docs

Az.Accounts Module | Microsoft Docs

2 Comments


  1. You saved me after hours of wasting my time. Sincerely, thank you sir.

    Reply

Leave a Reply