management.azure.com Authorization Failed azure csp account

Murugan Andezuthu Dharmaratnam 116 Reputation points
2021-11-10T16:33:49.103+00:00

I was trying a GET request from this url .

https://management.azure.com/subscriptions/\*\*\*\*\*\*\*\*-0f71-\*\*\*\*-994b-804713\*\*\*\*\*\*/resourceGroups/\*\*\*\*\*\*\*\*\*\*WE01/resources?api-version=2017-05-10
I have sent the authentication token & already have an application registered in Active directory

I am getting this error message.

{"error":{"code":"AuthorizationFailed","message":"The client '********-22c0-****-bb40-416f1a******' with object id '********-22c0-****-bb40-416f1a******' does not have authorization to perform action 'Microsoft.Resources/subscriptions/resourceGroups/resources/action' over scope '/subscriptions/********-0f71-****-994b-8047********/resourceGroups/**********WE01' or the scope is invalid. If access was recently granted, please refresh your credentials."}}

I already have an application registered in AD. What all permissions should I need to give to the registered application.

Thanks!
Murugan

Azure API Management
Azure API Management
An Azure service that provides a hybrid, multi-cloud management platform for APIs.
1,732 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
19,339 questions
0 comments No comments
{count} votes

Accepted answer
  1. JamesTran-MSFT 36,351 Reputation points Microsoft Employee
    2021-11-11T00:33:08.68+00:00

    @Murugan Andezuthu Dharmaratnam
    Thank you for the detailed post!

    When it comes to using the Resources - List By Resource Group REST API, can you make sure that your AzureAD App registration has the user_impersonation API permission. For more info.

    148383-image.png

    If you're still experiencing issues - for testing purposes, you can also try assigning the Global Admin role to your AzureAD App to see if that resolves your issue.
    Navigate to AzureAD -> Roles and Administrators -> Search for Global Admin -> Add the role assignment to your App (for testing purposes).
    148375-image.png

    If you have any other questions or are still experiencing issues, please let me know.
    Thank you for your time and patience throughout this issue.

    ----------

    Please remember to "Accept Answer" if any answer/reply helped, so that others in the community facing similar issues can easily find the solution.

    0 comments No comments

0 additional answers

Sort by: Most helpful