i am unable to Create a Linux virtual machine and install Nginx

Shraddha Bhardwaj 0 Reputation points

Requesting a Cloud Shell.Succeeded.

Connecting terminal...

Welcome to Azure Cloud Shell

Type "az" to use Azure CLI

Type "help" to learn about Cloud Shell

azbhardwajshradha800 [ ~ ]$ az vm create

the following arguments are required: --name/-n, --resource-group/-g

Examples from AI knowledge base:

az vm create --name MyVm --resource-group MyResourceGroup --image RedHat:RHEL:7-RAW:7.4.2018010506

Create a default RedHat VM with automatic SSH authentication using an image URN.

az vm create --name MyVm --resource-group rg1 --image debian --assign-identity /subscriptions/99999999-1bf0-4dda-aec3-cb9272f09590/resourcegroups/myRG/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myID

Create a debian VM with a user assigned identity.

az group create --location westus --resource-group MyResourceGroup

Create a new resource group in the West US region.


Read more about the command in reference docs

bhardwajshradha800 [ ~ ]$

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 skilled behavior.
255 questions
{count} votes

1 answer

Sort by: Most helpful
  1. AmaranS 160 Reputation points Microsoft Vendor

    Hi @Shraddha Bhardwaj

    Based on my understanding of the issue, you're practicing the following Learning Path exercise.

    Unit: 3 of 14 Exercise - Create an Azure Virtual Machine

    I have tried several times to reproduce the issue, and the documented steps works fine for me.

    Kindly take a look the similar discussion thread (by TP), copying the summarized steps:

    1. Activate new sandbox and create the VM as mentioned in the Exercise (step1 at Create a Linux VM and install Nginx)
    2. After step 1, please make a note of Public IP address that was assigned to VM.
    3. Before moving into step2, connect to newly created VM using ssh command in cloud shell. Please run the below command to connect VM. ssh azureuser@<VM public ip address>
    4. system asks you to prompt to Yes/No. Enter Yes.
    5. Please run the below commands one after another (in cloud shell).
    • sudo apt-get update
    • sudo apt-get install -y nginx
    • echo "<html><body><h2>Welcome to Azure! My name is $(hostname).</h2></body></html>" | sudo tee -a /var/www/html/index.html.
    • exit 

    After completed the step 5, Continue your module from step2 of Task 1: Create a Linux virtual machine and install Nginx at module 3 of 14.

    If the issue persists, please let us know we will help you further.

    1 person found this answer helpful.