Problem
When we want to delete an Azure AD,one of the steps is to delete all enterprise applications in that directory.
But some applicatons like Azure DevOps can not delete directly (Option not available).
Solution With PowerShell
- Create a new user in Azure AD with a role of Global administrator.
- Start PowerShell and install Azure AD module.
Install-Module -Name AzureAD
- Sign in the user we just created.(You may update password because security policy)
Connect-AzureAD
- You can get all enterprise applications in Azure AD tenant.
Get-AzureADServicePrincipal
- And remove all applications you don't need.
Remove-AzureADServicePrincipal -objectid [ObjectID]
- After all,we can this user delete Azure AD now.
Thank you! its saved my time
Why is this not possible using the button that Microsoft have added specifically for this task??? Seriously Azure is a fucking joke at times.
Thank you so much !