DEV Community

Cover image for Azure Hands-on: Create Virtual Machine Scale Set and Install App
Sudha Chandran B C
Sudha Chandran B C

Posted on

Azure Hands-on: Create Virtual Machine Scale Set and Install App

In Azure, A virtual machine scale set allows to deploy and manage a set of auto-scaling virtual machines. We can scale the number of VMs in the scale set manually, or define rules to auto-scale based on resource usage like CPU, memory demand, or network traffic. An Azure load balancer then distributes traffic to the VM instances in the scale set.

Let’s create VM Scale set as below.

Step 1: Create VM Scale Set

1.Let’s add basic information like

  • Resource group “gl_project_rg”
  • VMSS name “glProjectVMSS”
  • Region “Central US”
  • Availability Zone “Zone 3”
  • Image “Windows Server 2016-Datacenter – Gen 1”
  • Size “Standard_DS1_V2 – 1 vcpu, 3.5 GiB memory”
  • Credentials

image.jpeg

Create Load Balancers with backend pool.

image.jpeg

Auto Scale setup to have one instance max and min. And Scale out rule to increase instance count by 1 when CPU threshold is greater than 80%. And Scale in to decrease instance count by 1 when CPU threshold is less than 30%.

image.jpeg

Final Review page.

image.jpeg

image.jpeg

After clicking on Create, deployment will start.

image.jpeg

Deployment complete:

image.jpeg

image.jpeg

VMSS will have one instance created: “glProjectVMSS_1”

image.jpeg

Scaling rules created as below:

image.jpeg

Operating System information.

image.jpeg

Following inbound rules created by default.

image.jpeg

Load Balancer created.

image.jpeg

Step 2: Modify Network configuration.

We need to allow incoming traffic through port 80. So will create a new inbound rule “port_80”

image.jpeg

Also we need to allow port 3389 to connect to virtual machine through RDP.

image.jpeg

Step 3: Setup IIS and run default website.

Let’s connect to our VM through RDP through load balancers public ip address.

Go to instance glProjectVMSS_2 and click on connect through RDP. Download RDP file.

image.jpeg

The RDP file downloaded asks for username and password.

image.jpeg

Asks for certificate validation. Click on continue.

image.jpeg

On connecting successfully, it will open Windows Server app automatically.
image.jpeg

Next, Open the PowerShell app in the remote VM and add the following command to install IIS.

Install-WindowsFeature -name Web-Server -IncludeManagementTools

Installed successfully.

image.jpeg

Next try to access Load balancers public IP address.

image.jpeg

Now we are able to access IIS home page successfully through Load Balancer’s IP.
image.jpeg

Finally we have created Virtual Machine Scale Set, Load Balancers, Scale rules.
Then we connected to Instance with RDP using Load Balancer's IP address.
Lastly we installed IIS and setup a default web server and accessed it from Load Balancer's IP address.

Thank you for Reading! 😊

Top comments (0)