Managing external identities to enable secure access for partners, customers, and other non-employees
Looks like the delete operation is refusing because the resource is being used. Here is how to try and resolve the issue. Use Graph API or Powershell
1. Check Dependency on Azure AD Authentication Policies
- Browse to Azure AD B2C bladein the Azure Portal.
- Navigate to Custom Authentication Extensionsunder Security > Authentication Methods.
- Look for any references to the custom extension you are trying to delete. If it's bound to any authentication method or policy here, you must remove it.
2. Identify the Listener
- The listener ID
01565c76-7216-42fd-96d2-xxxxxxxxxin the error message indicates an associated entity. To identify what or where this listener is:- Use Microsoft Graph Exploreror PowerShell/Microsoft Graph APIsto query your tenant. Specifically, run a query against the
authenticationMethodsPolicyendpoint to detect where the extension is attached.
- Use Microsoft Graph Exploreror PowerShell/Microsoft Graph APIsto query your tenant. Specifically, run a query against the
Example Using Microsoft Graph API:
GET https://graph.microsoft.com/v1.0/policies/authenticationMethodsPolicy
Authorization: Bearer <Access_Token>
- Look in the response for any reference to
01565c76-7216-42fd-96d2-xxxxxxxxxor details of bindings that use your custom extension.
3. Unlink or Remove the Dependency
- Once you've located the policy, feature, or configuration that is associated with the custom extension, unlink or delete it.
- Depending on the result:
- If the listener is part of a group, policy, or a service principal, update the properties using the respective Azure AD blade.
- If it's an API-level setting or something bound through Microsoft Graph, update or delete it using the Graph API.
- If the listener is part of a group, policy, or a service principal, update the properties using the respective Azure AD blade.
4. Attempt to Delete the Custom Extension Again
- After clearing all dependencies, try deleting the custom extension:
- Go back to Azure AD B2C > Security > Custom Authentication Extensions.
- Locate the custom extension you want to delete and click Delete
Example PowerShell Command (To Check All Dependencies)
Run the following script using the AzureAD module in PowerShell:
Install-Module AzureAD
Connect-AzureAD
# Replace with your extension ID
$extensionId = "xxxxxxx-dc55-4595-bb81-2376317fcaa6"
# Search all service configs for mentions of the extension
Get-AzureADServicePrincipal | Where-Object { ($_ | ConvertTo-Json -Depth 10) -match $extensionId }