Problem


When we want to delete an Azure AD,one of the steps is to delete all enterprise applications in that directory. AAD Remove Check

But some applicatons like Azure DevOps can not delete directly (Option not available). DevOps Delete Options

Solution With PowerShell


  • Create a new user in Azure AD with a role of Global administrator.

Create new user

  • Start PowerShell and install Azure AD module.
Install-Module -Name AzureAD

Install Module

  • Sign in the user we just created.(You may update password because security policy)
Connect-AzureAD

Sign in

  • You can get all enterprise applications in Azure AD tenant.
Get-AzureADServicePrincipal

Get apps

  • And remove all applications you don't need.
Remove-AzureADServicePrincipal -objectid [ObjectID]

Remove apps

  • After all,we can this user delete Azure AD now.

Delete AAD