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)
- You can get all enterprise applications in Azure AD tenant.
- And remove all applications you don't need.
Remove-AzureADServicePrincipal -objectid [ObjectID]
- After all,we can this user delete Azure AD now.