How to fix Azure AD PIM role assignment going into a queue
We deployed an Azure AD registered App to automate assigning eligible PIM role to Azure AD accounts/objects by calling MS graph API. The registered App is granted the required Application API permissions with an admin consent granted. The issue is when the API is called, PIM roles are assigned to AAD objects immediately and while on few occasion this goes into a queue and could be in the queue as a pending task for few hours before eventually the role is assigned.
Our Initial investigation was pointing to API throttle, but further testing revealed this is not the case. Anyone out there with similar issue