DEV Community

Cover image for How To Create And Connect To A Virtue Machine Scale Set
Abisola Adesegun
Abisola Adesegun

Posted on

How To Create And Connect To A Virtue Machine Scale Set

Table of contents
Step 1: Introduction
Step 2: Sign in to Azure Portal
Step 3: Configure Basic Settings
Step 4: Configure Networking Settings
Step 5: Review and Create Virtue Machines
Step 6: Create the Virtual Machine
Step 7: Connect to virtual machine
Step 8: Install web server
Step 9: View the web server in action

Step 1: Introduction
What is Microsoft Azure Virtual Machine (VM) Scale Sets?
Microsoft Azure Virtual Machine Scale Sets is a way to configure and manage large numbers of Windows and Linux VMs within the Microsoft Azure public cloud as a single unit. By using scale sets, IT administrators can easily create and manage a group of load-balanced VMs in Azure at any scale, across multiple availability zones and fault domains and respond quickly to changing demand.
Below are guides on how to create and connect to Virtual Machine Scale Set.

Step 2: Sign in to Azure Portal
Go to the Azure Portal (portal.azure.com) and sign in using your Azure account credentials.

Step 3: Configure Basic Settings

  • Search for Virtual machines Scale Set.

  • In the Virtual machines page, select “+ Create”.

Image description

  • In the Basics tab, under Project details, make sure to select the right subscription and then either select an existing resource group or choose to Create new resource group.

Image description

  • Under Instance details, enter the Virtual machine name, and choose Ubuntu Server 22.04 LTS - Gen2 for your Image. Leave the other defaults.

  • Under Administrator account, select SSH public key.

Enter azureuser as the username.
For SSH public key source, leave the default of Generate new key pair.

  • Under Orchestration mode select Uniform and select Standard under Security. Then Under the Scaling configuration, click on the configure to input your scaling condition.

Image description

Image description

  • Under Inbound Ports, this is the port that we will be using to connect to our Virtual Ubuntu Machine

Step 4: Configure Network Settings

  • Under Network Interface, click + Create new nic then select SSH (22) and HTTP (80) from the drop-down.

Image description

  • Also create a load balancer

Image description

*Step 5: Review and Create Virtue Machine Step
*

Review your settings and make any changes if required.

Step 6: Create the Virtual Machine

  • After clicking on "Create," Azure will start deploying your virtual machine. It may take a few minutes for the deployment to complete.

Image description

  • When the Generate new key pair window opens, select Download private key and create resource.

Image description

  • When the deployment is finished, select Go to resource.

Image description

  • Go to Load balancing and copy Pub;ic IP Address.

Image description

*Step 7: Connect to virtual machine *

Create an SSH connection with the VM.

  • On your Windows computer, open a Command prompt.

  • At your prompt, open an SSH connection to your virtual machine. Copy and paste the IP address on your Virtual machine.
    Then type in the below command,

ssh -i “/path/to /your/private-key-file.pem” Username@Fronted IP Address

Step 8: Install web server
To see your VM in action, install the NGINX web server. From your SSH session, update your package sources and then install the latest NGINX package.
Type the below commands one after the other

sudo apt-get -y update
sudo apt-get -y install nginx

Image description

When done, type exit to leave the SSH session.

Step 9: View the web server in action
Use any web browser of your choice to view the default NGINX welcome page. Tycopy amd paste the public IP address of the VM as the web address.

Image description

Top comments (0)