Forum Discussion
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:
- Open Windows PowerShell as an administrator.
- Run: Import-Module AzureAD
- Connect to Azure AD: Connect-AzureAD
- Retrieve enterprise applications: Get-AzureADServicePrincipal
- Identify and remove any remaining applications using: Remove-AzureADServicePrincipal -ObjectId <Object ID>
- alwaysLearnerIron 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: