Unable to Access Azure RBAC PIM Approval Data via App-Only Token

Abdulrahman Elheyb 0 Reputation points
2025-06-15T16:58:01.58+00:00

I'm trying to retrieve approvals using the management.azure.com API, but the endpoint requires a user token instead of an app token. However, the Microsoft Graph API returns PIM request approvals successfully using an app token. I want getting approvals from this endpoint without user token like Microsoft Graph

https://management.azure.com/providers/Microsoft.Authorization/roleAssignmentApprovals

Any solution or suggestion?

Azure Role-based access control
Azure Role-based access control
An Azure service that provides fine-grained access management for Azure resources, enabling you to grant users only the rights they need to perform their jobs.
949 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Alex Burlachenko 8,765 Reputation points
    2025-06-17T10:58:42.7866667+00:00

    hi Abdulrahman Elheyb and thanks for posting this Q

    u can actually use graph api for pim approvals with app-only tokens, its way more flexible here. check the graph api docs for 'list privilegedAccess' and 'roleAssignmentApproval' - they support app permissions like 'privilegedaccess.readwrite.azureresources'. u might need to tweak ur app registration in azure ad to add these permissions, but it should work like a charm )

    aha, and if u're stuck with management.azure.com... yeah, thats a bummer, it really wants that user token.

    btw for general stuff ... try breaking down the auth flow. sometimes mixing delegated and app permissions does the trick. also check if ur token has the right 'aud' claim - management.azure.com can be picky about that. this might help in other tools too ))

    worth looking into service principals with higher privileges, but be careful, dont go wild with permissions haha. and hey, if graph api works for u, maybe just roll with it? its cleaner for app-only scenarios anyway.

    let me know if its helps,

    rgds,

    Alex


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.