Forum Discussion

alwaysLearner's avatar
alwaysLearner
Iron Contributor
Jun 08, 2025

Unable to delete tenant

I want to delete a single tenant I've created some time ago using my personal MS account (@outlook.com). The goal is to start fresh. In the Manage tenants page I see this 'All initial checks passed. Click 'Delete' to Delete tenant 'Default Directory'', meaning all the checks are passed. However, when I try to delete 'Default Directory' I am getting below error:

'Unable to delete tenant Default Directory. Known issues exist where some enterprise applications are not capable to delete within the portal. Click the notification title for more information and manual troubleshooting steps.'

But I don't have any enterprise applications left in my tenant. 

Is it even possible to delete only tenant? 

2 Replies

  • Let's try to use PowerShell to manually remove any lingering enterprise applications:

    1. Open Windows PowerShell as an administrator.
    2. Run: Import-Module AzureAD
    3. Connect to Azure AD: Connect-AzureAD
    4. Retrieve enterprise applications: Get-AzureADServicePrincipal
    5. Identify and remove any remaining applications using: Remove-AzureADServicePrincipal -ObjectId <Object ID>
    • alwaysLearner's avatar
      alwaysLearner
      Iron Contributor

       

      Thanks for the reply. 

      I had around 100 apps there and I could delete most of them. However, now I have 33 apps still remaining and can't delete them. They seem to be 'internal' to MS apps. Here is error message. 

      PS C:\windows\system32> Remove-AzureADServicePrincipal -ObjectId "ee8b712f-88cf-4165-ae03-cdc97ab6017f"
      Remove-AzureADServicePrincipal : Error occurred while executing RemoveServicePrincipal 
      Code: Request_BadRequest
      Message: Specified App Principal ID is Microsoft Internal.
      RequestId: 0fd480d3-7d18-4fc9-8d56-363c04935fb8
      DateTimeStamp: Mon, 09 Jun 2025 07:47:07 GMT
      HttpStatusCode: BadRequest
      HttpStatusDescription: Bad Request
      HttpResponseStatus: Completed
      At line:1 char:1
      + Remove-AzureADServicePrincipal -ObjectId "ee8b712f-88cf-4165-ae03-cdc ...
      + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          + CategoryInfo          : NotSpecified: (:) [Remove-AzureADServicePrincipal], ApiException
          + FullyQualifiedErrorId : Microsoft.Open.AzureAD16.Client.ApiException,Microsoft.Open.AzureAD16.PowerShell.RemoveServicePrincipal

       

      And these are some of those 33 apps:

       

      The thing is, I've passed all the checks:

      But still can't delete the tenant:

       

Resources