Errors When Attempting to Delete Azure AD Tennant

Tags: Delete, App, Registrations, Enterprise, Applications

When trying to delete an Azure AD Directory and getting an error to delete applications, try:

1) in properties, give your account access to manage resources. (Azure AD -> Properties -> Access management for Azure resources)

2) disable LinkedIn integration and try again. 

3) sign out and sign back in again, and keep refreshing the browser.

4) can take about 5-10 minutes to refresh Azure AD tennant.

5) make sure the default directory for your logon user is not the one you are trying to delete.  Set a different default, not leaving it as last directory you signed in on.

If that doesn't work, try:

https://www.akaes.com/blog/how-to-delete-app-registrations-and-enterprise-applications-from-microsoft-azure-active-directories-using-powershell/

In Summary:

Deleting Enterprise Applications

It appears that what you can’t see from the Portal UI, you must figure out how to deal with using PowerShell. As the name suggests, PowerShell is a powerful tool that interacts with Azure. Use the following steps:  

  1. Run PowerShell as Administrator.
  2. Enter the Connect-AzureAD command and log in with your Azure AD Global Administrator account.
  3. Enter Get-AzureADServicePrincipal to display all registered Enterprise Applications along with their ObjectIds
  4. For each record found, run following command: 
  5. Remove-AzureADServicePrincipal -objectid <ObjectId from above>
  6. If you prefer, you can find and delete all Enterprise Applications using the following script:

  7. $ObjectIds = (Get-AzureADServicePrincipal).ObjectId
    For ($i=0; $i -lt $ObjectIds.Length; $i++)
    {
                 Remove-AzureADServicePrincipal -objectid $ObjectIds[$i]
    }


    NOTE: If you receive the following error for any of the above, simply continue. Basically, the error states that it won’t let you delete Microsoft internal app:

No Comments

You must log on to comment.