Ho to refresh credentials when creating a vm

CECCHI Pierluigi (External) 20 Reputation points
2024-05-17T12:39:47.9433333+00:00

In the Learn Sandbox I had already created a VM, but it longer exists. I've tried to rebuild with this command:

az vm create  --resource-group "[sandbox resource group name]"  --name my-vm  --public-ip-sku Standard  --image Ubuntu2204  --admin-username azureuser  --generate-ssh-keys

But I get this message:

(AuthorizationFailed) The client 'pierluigi.cecchi.ext@bridgestone.eu' with object id '919663d2-7147-4eb6-ab7e-8b9657b8fa0f' does not have authorization to perform action 'Microsoft.Resources/subscriptions/resourcegroups/read' over scope '/subscriptions/1643dc90-966d-4432-a49c-157d83b413bf/resourcegroups/[sandbox resource group name]' or the scope is invalid. If access was recently granted, please refresh your credentials.

Code: AuthorizationFailed

Message: The client 'pierluigi.cecchi.ext@bridgestone.eu' with object id '919663d2-7147-4eb6-ab7e-8b9657b8fa0f' does not have authorization to perform action 'Microsoft.Resources/subscriptions/resourcegroups/read' over scope '/subscriptions/1643dc90-966d-4432-a49c-157d83b413bf/resourcegroups/[sandbox resource group name]' or the scope is invalid. If access was recently granted, please refresh your credentials.

Hoa can I refresh my credentials?

Many thanks in advance.

 Pierluigi Cecchi
Azure Training
Azure Training
Azure: A cloud computing platform and infrastructure for building, deploying and managing applications and services through a worldwide network of Microsoft-managed datacenters.Training: Instruction to develop new skills.
1,084 questions
0 comments No comments
{count} votes

Accepted answer
  1. TP 79,246 Reputation points
    2024-05-17T12:52:25.3266667+00:00

    Hi,

    The sandbox expires 1 hour after you activated it, and anything you created is automatically deleted. Please Activate a new sandbox, and before you try to run commands, make sure that the code in the exercise has the correct resource group name.

    For example, instead of the code saying [sandbox resource group name] it should have something similar to learn-3294a2f5-b8ec-2def-ca62-49e23701bd77. If it doesn't have correct resource group name, please navigate back to previous Unit using dropdown at the top, allow page to load, then navigate back to exercise you are on, click verify, solve puzzle, and once it says Welcome to Azure Cloud Shell copy/paste the create vm command.

    qna az-900 create azure vm workaround

    https://learn.microsoft.com/en-us/answers/questions/1538922/credential-problem

    Please click Accept Answer and upvote if the above was helpful.

    Thanks.

    -TP

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful