Since you are not seeing the application in the portal, you might be facing the same issue that the user in this MSDN thread was facing.
For this user, the solution was to create a user within the tenant that he wanted to delete, followed by running this in Powershell:
Connect-MsolService
Get-MsolServicePrincipal | Remove-MsolServicePrincipal
Then running:
Get-AzureRmADApplication
Get-AzureRmADApplication | Remove-AzureRmADApplication
Then deleting the user, and then deleting the Azure Active Directory.
One other common reason for this is an issue with the Microsoft Visual Studio Team Services Enterprise application. You can go to Enterprise Applications > Microsoft Visual Studio Team Services > Properties > flip “Enable for users to sign-in” to No, and this might resolve the issue.
Do you see anything if you run Get-AzureADServicePrincipal
? If so, you can remove these applications individually using Remove-AzureADServicePrincipal -objectid [ObjectID]
Two additional commands you can also try:
1)
Get-AzureADServicePrincipal | Select-Object -ExpandProperty ObjectId | ForEach-Object { Remove-AzureADServicePrincipal -ObjectId $_}
2)
Get-AzureADServicePrincipal | ForEach-Object { Remove-AzureADServicePrincipal -ObjectId $_.ObjectId }
Let me know if any of these things work for you. If you still have this issue you can reach out to me at AzCommunity@microsoft.com (Attn: Marilee Turscak), and I can get a support case opened for you.