Exercise - Create an Azure virtual machine NOT WORKING KEEP GETTING AN ERROR

Victor Lausell 35 Reputation points
2023-11-30T21:36:04.8+00:00

I am a student in Texas and I keep getting the same error. Tried changing my credentials but with my account that is not possible . I am simply trying to learn. Was working on the module Describe Azure compute and networking services

The task requires:

Task 1: Create a Linux virtual machine and install Nginx

Use the following Azure CLI commands to create a Linux VM and install Nginx. After your VM is created, you'll use the Custom Script Extension to install Nginx. The Custom Script Extension is an easy way to download and run scripts on your Azure VMs. It's just one of the many ways you can configure the system after your VM is up and running.

From Cloud Shell, run the following az vm create command to create a Linux VM:

Keep getting the following error:

PS /home/victor_lausell> az vm create --resource-group learn-36e18f87-0615-4b1e-8b69-b63858b521b4 --name my-vm --public-ip-sku Standard --image Ubuntu2204 --admin-username azureuser --generate-ssh-keys

(AuthorizationFailed) The client 'victor.lausell@my.tccd.edu' with object id 'c9478cca-6c66-43c0-b940-41732552dff8' does not have authorization to perform action 'Microsoft.Resources/subscriptions/resourcegroups/read' over scope '/subscriptions/8b4dc032-74e8-4cbb-9bf2-ba780a5c236f/resourcegroups/learn-36e18f87-0615-4b1e-8b69-b63858b521b4' or the scope is invalid. If access was recently granted, please refresh your credentials.

Code: AuthorizationFailed

Message: The client 'victor.lausell@my.tccd.edu' with object id 'c9478cca-6c66-43c0-b940-41732552dff8' does not have authorization to perform action 'Microsoft.Resources/subscriptions/resourcegroups/read' over scope '/subscriptions/8b4dc032-74e8-4cbb-9bf2-ba780a5c236f/resourcegroups/learn-36e18f87-0615-4b1e-8b69-b63858b521b4' or the scope is invalid. If access was recently granted, please refresh your credentials.

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

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,261 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Andriy Bilous 11,176 Reputation points
    2023-11-30T21:45:04.4033333+00:00

    Hello @Victor Lausell

    Yes, you must assign Azure role Contributor to your user victor.lausell@my.tccd.edu to create azure resources as per this article.