How To Create And Connect To A Virtue Machine Scale Set
Tags: vmss, azure, loadbalancer, cloudcomputing
Published: 2024-06-28 14:08:03

**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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tke1tuiwvho4ggh2e1u7.png)

- 
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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jcisrvxdnfwygm82minl.png)

- 
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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1quisds2yhgf6sbbdvze.png)


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fqeje8xw0frkxuo2nibj.png)


- 
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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4q79c2hb4e1k31177ld9.png)



- 
Also create a load balancer

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ktleefj93ya2abkv06hq.png)


 
**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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/reisi95yejgh7dtsz3g9.png)


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


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/soefjfijlo9elpyt3zbh.png)


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


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8gh2lfdqfmklj2wrrff9.png)


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


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fobdti32z9oh4ctvr5e0.png)

**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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4tndqqgsy7o27htyzr03.png)



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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mkpwg40fpx8c90uaxspp.png)