Win
Win

Reputation: 62260

Deleting Azure Active Directory returns Delete all App registrations although there is no app

I'm trying to delete an Active Directory (not default) in Azure. It said I need to Delete all App registrations. When I click on the link, there is no registered app.

Interesting is dashboard said I have 1 app registered. When I click on the link, there is no app either.

enter image description here

enter image description here

Upvotes: 5

Views: 2118

Answers (3)

user12558487
user12558487

Reputation: 11

First:

Connect-AzureAD -Tenant id <string>

to learn application's object id

Get-AzureADApplication

then

Remove-AzureADApplication -ObjectId <srtring>

Upvotes: 1

Manoj Choudhari
Manoj Choudhari

Reputation: 5624

I faced similar situation today and got to this post.

I have found solution accidentally by following one of the MSDN article. This article is about adding new application and that's how I got to understand how to find all registered applications.

Basically, this happened because there are two places where application registrations are shown.

One

Under "Azure Active Directory" -> "App Registrations".

Second

Under left navigation -> "All Services" -> Search for "Azure AD B2C" -> click on it -> Open.

Then you will be able to see "Applications".

Here is the snapshot of how it looks like

Here all your application which are using your Azure B2C instance are listed. You will have to delete them.

Once they are deleted, you can again go to "Delete Directory" option and all your checks / pre requisites should be successful.

This helped me to resolve exact same issue and hoping that this should also help you.

Upvotes: 5

Sa Yang
Sa Yang

Reputation: 9401

You may also have to remove additional service principals. Use Azure Active Directory Module for Windows PowerShell to remove all service principals. To do this, follow these steps:

Open Azure Active Directory Module for Windows PowerShell. Connect to the Microsoft Online Service.

Run the following command:

Get-MsolServicePrincipal | Remove-MsolServicePrincipal

Note You may receive an error when you remove some service principals. These principals can’t be removed. However, this does not prevent you from deleting your directory.

The error that you receive may resemble the following: Remove-MsolServicePrincipal : Invalid value for parameter. Parameter Name: appPrincipalId.

Also, you can use ARM powershell as following command:

Get-AzureRmADServicePrincipal | Remove-AzureRmADServicePrincipal

Please let me know if it helps!

Upvotes: 4

Related Questions