I have been working on Azure PIM integration project for a while now and have successfully managed to setup REST API calls for “Role Eligibility”, “Role Assignments” and “Role Policy Rules”. Now when I am trying to setup REST API calls for PIM Assignment Approvals, i find it very strange but I keep getting error. Does anyone know what I am doing different here? Also why the calls that are working using same AuthToken for one endpoint are not working for other?
"error": {
"code": "GatewayAuthenticationFailed",
"message": "Gateway authentication failed for 'Microsoft.Authorization'. Diagnostic information: timestamp '20240727T210153Z', tracking id 'XXXXXXX-562b-4468-a067-4cb27d2b1253', request correlation id 'XXXXXXX-562b-4468-a067-4cb27d2b1253'."
}
As I mentioned earlier the calls for other requests works fine e.g. call to GET roleManagementPolicies works fine using Bearer Auth Token Auth flow.
When I am trying to make a similar call to GET roleAssignmentApprovals, this results in the error I mentioned above.
Few additional details to mention to help understand context:
- I am using client_credentials OAuth2.0 authorization flow.
- The client_id and client_secret parameters are correctly set and hence all other REST API calls are working fine.
- The API permission for Entra ID app have been Granted at tenant level for both Azure Service Management (user_impersonation) & Microsoft Graph (User.Read).
- The actual url after replacing variables is something like
https://management.azure.com/subscriptions/[SUBSCRIPTIONID]/providers/Microsoft.Authorization/roleAssignmentApprovals?api-version=2021-01-01-preview'
I have tried to use other grant types as well just to see if that works. Also I did try to use filter={$filter}
as per the REST API documentation for Role Assignment Approval.