When we are using basic token for create user that time we are facing AuthorizationFailed issue.

Ron Weasley 0 Reputation points
2024-05-16T14:46:57.05+00:00

Hi, We are able to create user and delete user with OAuth 2 token but When we are using basic token that time we are getting below error
"code": "AuthorizationFailed",

        "message": "The client 'f04c77f3-530e-416d-a165-42304fb90583' with object id 'f04c77f3-530e-416d-a165-42304fb90583' does not have authorization to perform action 'Microsoft.ApiManagement/service/users/write' over scope '/subscriptions/2d1e70f3-6530-480e-ab57-5c71915083af/resourceGroups/TestResorceGroupSub2/providers/Microsoft.ApiManagement/service/TestResourceSub2/users/Vivek' or the scope is invalid. If access was recently granted, please refresh your credentials."

Microsoft Entra
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
20,138 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Babafemi Bulugbe 2,680 Reputation points MVP
    2024-05-16T15:13:07.87+00:00

    Hello Ron Weasley,

    Thank you for posting your question in the Microsoft Q&A Community.Based on the error you posted, the actor performing the action doesnt have the permission (Microsoft.ApiManagement/service/users/write) to complete the process. Kindly assign the API Management Service Contributor on the Resource TestResourceSub2 to give the necesarry permission. Alternately, you can create a custom role and add the missing permission (Microsoft.ApiManagement/service/*) or (Microsoft.ApiManagement/service/write)

    Let me know if this helps.

    Babafemi

    0 comments No comments