Install NGINX on a Linux VM in Deployment with Cloud Init

30 minutes
  • 2 Learning Objectives

About this Hands-on Lab

Your manager asks if you can install NGINX on all new Linux VMs with as little manual intervention as possible. Instead of installing NGINX on each VM manually, you can use `cloud-init` to install NGINX during the deployment of a Linux VM.

Learning Objectives

Successfully complete this lab by achieving the following learning objectives:

Create a New Linux VM
  1. Log in to the Azure Portal and go to Virtual machines.
  2. Click Add > Virtual machines.
  3. Create a VM with the following settings:
    • Image: Ubuntu Server 18.04 LTS Gen2
    • VM name: vm1
    • VM size: Standard_B2ms
    • Authentication type: Password
    • Public inbound ports: SSH (22)
  4. Add the cloud-init script in the advanced settings before clicking Review + create > Create.
Deploy VM and Verify NGINX is Installed
  1. Once you’ve added the cloud-init script and started the deployment, ensure the VM deployment finishes successfully.
  2. Log in to the VM via SSH.
  3. Check the installed version of NGINX.

Additional Resources

Log in to the Azure portal with the credentials given. Create a VM with the following requirements:

  • Image: Ubuntu Server 18.04 LTS Gen2
  • VM name: LinuxVM1-NGINX
  • VM size: Standard_B2ms
  • Authentication type: Password
  • Public inbound ports: SSH (22)

Ensure you have added the cloud-init script before you create the VM. Once the VM has been deployed successfully, log in via SSH and verify NGINX is already installed. During the lab, use the same location as your lab provided resource group.

What are Hands-on Labs

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?