If access was recently granted, please refresh your credentials in c#

Dorai Kumar 16 Reputation points
2022-09-12T15:18:38.58+00:00

When I run my C# application its giving the following error "The client 'xxxxxx-16f5-4f1e-b52d-b8ab11cfdxxx' with object id 'xxxxxxx-16f5-4f1e-b52d-b8ab11cfdxxx' does not have authorization to perform action 'Microsoft.Compute/locations/usages/read' over scope '/subscriptions/xxxxxx-599c-4fa6-9639-4c070a5axxxx' or the scope is invalid. If access was recently granted, please refresh your credentials".

Subscription type - Free Trial

Microsoft Security | Microsoft Authenticator
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. JimmySalian-2011 44,986 Reputation points
    2022-09-12T15:50:45.117+00:00

    Hi,

    It seems you do not have permissions on the compute resources, please assign permissions as per the chart it is VM Contributor.

    built-in-roles

    ==
    Please "Accept the answer" if the information helped you. This will help us and others in the community as well.


Your answer

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