I’ve a requirement wherein when a user moves to “leave10days” lifecycle state, then corresponding AzureAD account needs to be deleted for the same user.
I was thinking to use before provisioning rule with the logic that any “disable” account request will be converted to “delete” account request.
I want to know if AzureAD source has the implementation written for “delete” account request or is there any other better way to implement this?
Scheduled Powershell script on the IQ server that checks for any accounts in that lifecycle state, gets the account’s EntraID GUID from an Identity attribute, then sends a delete request to Entra ID.
Hope this gives you a start to design the workflow:
Step1: Trigger - Identity Attributes Changed . You can use filter (Advanced) as $.changes[?(@.attribute == "cloudLifecycleState")]
Step 2:Compare String operator to check if the new cloudLifecycleState value is “leave10days” $.trigger.changes[?(@.attribute == "cloudLifecycleState")].newValue with leave10days
Step 3: For Compare StringTrue flow, Get Identity by Identity based on $.trigger.identity.id
Step 4: Define Variable to fetch and store the EntraUD GUID variable from the Azure account of the user. The value of the variable userId can be defined as : $.getIdentity.attributes.<Entra GUID>
Alternately, as mentioned by @phil_awlings , you can schedule a powershell script from IQ server to make the API call; you will have to ensure that proper network connectivity to Entra tenant is established from IQ server.