Hello! I have a similar issue. Can someone please help me to resolve it?
Trying to delete an old tenant with only one user - global administrator.
When clicking on "Delete tenant", all check are marked green(passed) in Azure portal. But next, when I confirms deletion, it says:
Error:
Unable to delete tenant
Unable to delete tenant Каталог по умолчанию. 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.
Link in error description above follows to next documentation: https://learn.microsoft.com/en-us/azure/active-directory/enterprise-users/directory-delete-howto#remove-enterprise-apps-that-you-cant-delete
There are some issues when using regular Powershell, but Powershell ISE made me able to get to step N6:
- Run the following command to remove any enterprise apps that you can't delete:
Get-AzADServicePrincipal | ForEach-Object { Remove-AzADServicePrincipal -ObjectId $_.Id }
Executing command above result in a lot of errors in Powershell with next decription:
Specified App Principal ID is Microsoft Internal.
Here is all of them:
Az.MSGraph.internal\Remove-AzADServicePrincipal : Specified App Principal ID is Microsoft Internal.
At C:\Program Files\WindowsPowerShell\Modules\Az.Resources\6.9.0\MSGraph.Autorest\custom\Remove-AzADServicePrincipal.ps1:194 char:5
+ Az.MSGraph.internal\Remove-AzADServicePrincipal @PSBoundParameter ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: ({ Id = 157a76d9...f, IfMatch = }:<>f__AnonymousType15`2) [Remove-AzADServicePrincipal_Delete], Exception
+ FullyQualifiedErrorId : Request_BadRequest,Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets.RemoveAzADServicePrincipal_Delete
Az.MSGraph.internal\Remove-AzADServicePrincipal : Specified App Principal ID is Microsoft Internal.
At C:\Program Files\WindowsPowerShell\Modules\Az.Resources\6.9.0\MSGraph.Autorest\custom\Remove-AzADServicePrincipal.ps1:194 char:5
+ Az.MSGraph.internal\Remove-AzADServicePrincipal @PSBoundParameter ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: ({ Id = 3640c166...3, IfMatch = }:<>f__AnonymousType15`2) [Remove-AzADServicePrincipal_Delete], Exception
+ FullyQualifiedErrorId : Request_BadRequest,Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets.RemoveAzADServicePrincipal_Delete
Az.MSGraph.internal\Remove-AzADServicePrincipal : Specified App Principal ID is Microsoft Internal.
At C:\Program Files\WindowsPowerShell\Modules\Az.Resources\6.9.0\MSGraph.Autorest\custom\Remove-AzADServicePrincipal.ps1:194 char:5
+ Az.MSGraph.internal\Remove-AzADServicePrincipal @PSBoundParameter ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: ({ Id = 505e36e1...e, IfMatch = }:<>f__AnonymousType15`2) [Remove-AzADServicePrincipal_Delete], Exception
+ FullyQualifiedErrorId : Request_BadRequest,Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets.RemoveAzADServicePrincipal_Delete
Az.MSGraph.internal\Remove-AzADServicePrincipal : Specified App Principal ID is Microsoft Internal.
At C:\Program Files\WindowsPowerShell\Modules\Az.Resources\6.9.0\MSGraph.Autorest\custom\Remove-AzADServicePrincipal.ps1:194 char:5
+ Az.MSGraph.internal\Remove-AzADServicePrincipal @PSBoundParameter ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: ({ Id = 5bd407f9...d, IfMatch = }:<>f__AnonymousType15`2) [Remove-AzADServicePrincipal_Delete], Exception
+ FullyQualifiedErrorId : Request_BadRequest,Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets.RemoveAzADServicePrincipal_Delete
Az.MSGraph.internal\Remove-AzADServicePrincipal : Specified App Principal ID is Microsoft Internal.
At C:\Program Files\WindowsPowerShell\Modules\Az.Resources\6.9.0\MSGraph.Autorest\custom\Remove-AzADServicePrincipal.ps1:194 char:5
+ Az.MSGraph.internal\Remove-AzADServicePrincipal @PSBoundParameter ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: ({ Id = 7075a0e2...a, IfMatch = }:<>f__AnonymousType15`2) [Remove-AzADServicePrincipal_Delete], Exception
+ FullyQualifiedErrorId : Request_BadRequest,Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets.RemoveAzADServicePrincipal_Delete
Az.MSGraph.internal\Remove-AzADServicePrincipal : Specified App Principal ID is Microsoft Internal.
At C:\Program Files\WindowsPowerShell\Modules\Az.Resources\6.9.0\MSGraph.Autorest\custom\Remove-AzADServicePrincipal.ps1:194 char:5
+ Az.MSGraph.internal\Remove-AzADServicePrincipal @PSBoundParameter ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: ({ Id = 82c8223d...7, IfMatch = }:<>f__AnonymousType15`2) [Remove-AzADServicePrincipal_Delete], Exception
+ FullyQualifiedErrorId : Request_BadRequest,Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets.RemoveAzADServicePrincipal_Delete
Az.MSGraph.internal\Remove-AzADServicePrincipal : Specified App Principal ID is Microsoft Internal.
At C:\Program Files\WindowsPowerShell\Modules\Az.Resources\6.9.0\MSGraph.Autorest\custom\Remove-AzADServicePrincipal.ps1:194 char:5
+ Az.MSGraph.internal\Remove-AzADServicePrincipal @PSBoundParameter ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: ({ Id = 89d54aee...d, IfMatch = }:<>f__AnonymousType15`2) [Remove-AzADServicePrincipal_Delete], Exception
+ FullyQualifiedErrorId : Request_BadRequest,Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets.RemoveAzADServicePrincipal_Delete
Az.MSGraph.internal\Remove-AzADServicePrincipal : Specified App Principal ID is Microsoft Internal.
At C:\Program Files\WindowsPowerShell\Modules\Az.Resources\6.9.0\MSGraph.Autorest\custom\Remove-AzADServicePrincipal.ps1:194 char:5
+ Az.MSGraph.internal\Remove-AzADServicePrincipal @PSBoundParameter ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: ({ Id = 9f5342cb...7, IfMatch = }:<>f__AnonymousType15`2) [Remove-AzADServicePrincipal_Delete], Exception
+ FullyQualifiedErrorId : Request_BadRequest,Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets.RemoveAzADServicePrincipal_Delete
Az.MSGraph.internal\Remove-AzADServicePrincipal : Specified App Principal ID is Microsoft Internal.
At C:\Program Files\WindowsPowerShell\Modules\Az.Resources\6.9.0\MSGraph.Autorest\custom\Remove-AzADServicePrincipal.ps1:194 char:5
+ Az.MSGraph.internal\Remove-AzADServicePrincipal @PSBoundParameter ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: ({ Id = ba8ccb58...c, IfMatch = }:<>f__AnonymousType15`2) [Remove-AzADServicePrincipal_Delete], Exception
+ FullyQualifiedErrorId : Request_BadRequest,Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets.RemoveAzADServicePrincipal_Delete
Az.MSGraph.internal\Remove-AzADServicePrincipal : Specified App Principal ID is Microsoft Internal.
At C:\Program Files\WindowsPowerShell\Modules\Az.Resources\6.9.0\MSGraph.Autorest\custom\Remove-AzADServicePrincipal.ps1:194 char:5
+ Az.MSGraph.internal\Remove-AzADServicePrincipal @PSBoundParameter ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: ({ Id = d9336fab...d, IfMatch = }:<>f__AnonymousType15`2) [Remove-AzADServicePrincipal_Delete], Exception
+ FullyQualifiedErrorId : Request_BadRequest,Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets.RemoveAzADServicePrincipal_Delete
Az.MSGraph.internal\Remove-AzADServicePrincipal : Specified App Principal ID is Microsoft Internal.
At C:\Program Files\WindowsPowerShell\Modules\Az.Resources\6.9.0\MSGraph.Autorest\custom\Remove-AzADServicePrincipal.ps1:194 char:5
+ Az.MSGraph.internal\Remove-AzADServicePrincipal @PSBoundParameter ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: ({ Id = e9ec0b77...4, IfMatch = }:<>f__AnonymousType15`2) [Remove-AzADServicePrincipal_Delete], Exception
+ FullyQualifiedErrorId : Request_BadRequest,Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets.RemoveAzADServicePrincipal_Delete
Az.MSGraph.internal\Remove-AzADServicePrincipal : Specified App Principal ID is Microsoft Internal.
At C:\Program Files\WindowsPowerShell\Modules\Az.Resources\6.9.0\MSGraph.Autorest\custom\Remove-AzADServicePrincipal.ps1:194 char:5
+ Az.MSGraph.internal\Remove-AzADServicePrincipal @PSBoundParameter ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: ({ Id = ebfb467f...9, IfMatch = }:<>f__AnonymousType15`2) [Remove-AzADServicePrincipal_Delete], Exception
+ FullyQualifiedErrorId : Request_BadRequest,Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets.RemoveAzADServicePrincipal_Delete
Az.MSGraph.internal\Remove-AzADServicePrincipal : Specified App Principal ID is Microsoft Internal.
At C:\Program Files\WindowsPowerShell\Modules\Az.Resources\6.9.0\MSGraph.Autorest\custom\Remove-AzADServicePrincipal.ps1:194 char:5
+ Az.MSGraph.internal\Remove-AzADServicePrincipal @PSBoundParameter ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: ({ Id = ef9d5245...b, IfMatch = }:<>f__AnonymousType15`2) [Remove-AzADServicePrincipal_Delete], Exception
+ FullyQualifiedErrorId : Request_BadRequest,Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets.RemoveAzADServicePrincipal_Delete
All next steps from official documentation, liked above, fails. I can provide errors text if it could help to solve my problem, but it looks like problem with step 6 should be fixed first.
I have tried all solutions provided within this thread - unfortunately, it didn't help.
There is information in this thread, that possible solution could be to find and configure next app:
DisplayName : Microsoft Partner
Application ID : 4990cffe-04e8-4e8b-808a-1175604b879f
But it is not present in a list of all enterprise apps on Azure portal:
I really need help with deleting this tenant. Have tried all possible solutions, found on the Internet - unsuccessfully.
It seems like impossible to contact with support without active subscription - which I don't have.
Please help me resolve this issue. Will be much appreciate.