Removing AppRole App in Azure Active Directory
Removing AppRole from Application Manifest raises 400 Bad Request with error
The property value cannot be removed unless it is disabled first.
When I set the isEnabled property to false and then remove save, I get a successful 200 OK shroud, looking at the browser developer tools:
After reloading the Edit Manifest screen, the property isEnabled
is still there true
, and if you look at the PUT response in the browser developer tools, it reappears as true
.
How can I remove the appRole without having to delete and re-create the entire application?
Update
I added the following bug .
source to share
Until this is fixed, there are two possibilities for solving this problem:
-
Using Azure AD PowerShell, you can disable and then remove the application role. Here's a sample script that will achieve this:
$appId = "83d7d56d-6e64-4791-b8e8-9a8da8dd957e" $appRoleValue = "app-role-value" # i.e. the scope Connect-AzureAD # Disable the AppRole $app = Get-AzureADApplication -Filter "appId eq '$appId'" ($app.AppRoles | Where-Object { $_.Value -eq $appRoleValue }).IsEnabled = $false Set-AzureADApplication -ObjectId $app.ObjectId -AppRoles $app.AppRoles # Remove the AppRole $toRemove = $app.AppRoles | Where-Object { $_.Value -eq $appRoleValue } $app.AppRoles.Remove($toRemove) | Out-Null Set-AzureADApplication -ObjectId $app.ObjectId -AppRoles $app.AppRoles
-
An alternative is to use the Azure AD Graph Explorer and issue two
PATCH
requests to the Application object. The firstPATCH
request is to set the application role attributeisEnabled
tofalse
. The second requestPATCH
can remove the application role (i.e. enable all existing application roles except the disabled one).
source to share
There seems to be a bug in the new portal. The save operation does not store isEnabled
false on the server side. Any feedback you can send to here .
Currently, you can use the classic Azure AD portal to change the application roles in the manifest (upload the manifest and then upload the manifest that was changed). Removing an application role in classic portal works great in my environment. Please let me know if this helps.
source to share