Error in Creating the VM in the Azure Fundamentals Learning Path

Ishara Ishak 40 Reputation points
2024-01-09T09:06:25.62+00:00

I am getting the below error when trying to run the code (also mentioned below) related to creating an Azure VM via the Azure Cloud shell

Error:

(AuthorizationFailed) The client 'live.com#******@hotmail.com' with object id 'bcb8b8b7-8ec2-49e9-b51b-94821a09cec5' does not have authorization to perform action 'Microsoft.Resources/subscriptions/resourcegroups/read' over scope '/subscriptions/66934742-a2f4-4f94-ad7b-07a47d83d2bc/resourcegroups/rg1' or the scope is invalid. If access was recently granted, please refresh your credentials. Code: AuthorizationFailed

Script used:

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

Learning path followed:

https://learn.microsoft.com/en-us/training/modules/describe-azure-compute-networking-services/3-exercise-create-azure-virtual-machine

Azure | Azure Training
0 comments No comments
{count} votes

Answer accepted by question author
  1. TP 146K Reputation points Volunteer Moderator
    2024-01-09T09:58:35.32+00:00

    Hi,

    The script you are entering isn't correct. There is no resource group "rg1" and you don't have permission to create it.

    Please navigate to the Create an Azure virtual machine exercise, Activate a new sandbox, sign in, etc. Once sandbox is activated and black cloud shell window with "Welcome to Azure Cloud Shell" displayed, navigate to Exercise - Configure network access using the "Unit x of 14" dropdown above the exercise.

    qna az-900 create azure vm workaround

    After page loads and resource group name is updated to learn-, immediately navigate back to Create an Azure virtual machine exercise and complete it.

    Inspiration for above workaround came from @pnaroju's #2 suggestion in this post.

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

    Thanks.

    -TP

    2 people found this answer helpful.

0 additional answers

Sort by: Most helpful

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.