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

Dorai Kumar 11 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 Authenticator
Microsoft Authenticator
A Microsoft app for iOS and Android devices that enables authentication with two-factor verification, phone sign-in, and code generation.
6,881 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. JimmySalian-2011 42,116 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 Answers by the question author, which helps users to know the answer solved the author's problem.