I'm trying to delete one Azure Resource using RestAPI by following this document: https://learn.microsoft.com/en-us/rest/api/resources/resources/delete-by-id
I have the access token with scope as https:/management.azure.com/.default where I granted user_impersonation too.
The problem is when I used the token to delete the resource for this query:
DELETE https://management.azure.com/{resourceId}?api-version=2021-04-01
I'm getting error like:
Status Code(403): 'Forbidden', Response from server: '{"error":{"code":"AuthorizationFailed","message":"The client ' ' with object id ' ' does not have authorization to perform action over scope or the scope is invalid. If access was recently granted, please refresh your credentials."}}'
I'm the owner of the subscription and I have Global Administrator role that has high privilege. What more roles are needed to avoid the error?