Azure Hands-on: Create Virtual Machine Scale Set and Install App
Tags: azure, 100daysofcloud
Published: 2020-08-25 04:30:53

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](https://cdn.hashnode.com/res/hashnode/image/upload/v1598329049305/TkWFrcaEP.jpeg)

Create Load Balancers with backend pool.

![image.jpeg](https://cdn.hashnode.com/res/hashnode/image/upload/v1598329129120/ap5fVl1lX.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](https://cdn.hashnode.com/res/hashnode/image/upload/v1598329142341/RLRUSoo0p.jpeg)

Final Review page.

![image.jpeg](https://cdn.hashnode.com/res/hashnode/image/upload/v1598329152555/8700KSeNR.jpeg)

![image.jpeg](https://cdn.hashnode.com/res/hashnode/image/upload/v1598329155206/aoYdov6sQ.jpeg)

After clicking on Create, deployment will start.

![image.jpeg](https://cdn.hashnode.com/res/hashnode/image/upload/v1598329164633/R2_1Ag6Hl.jpeg)

Deployment complete:


![image.jpeg](https://cdn.hashnode.com/res/hashnode/image/upload/v1598329179941/qXASIkBhOw.jpeg)

![image.jpeg](https://cdn.hashnode.com/res/hashnode/image/upload/v1598329185437/Ga332XZWm.jpeg)

VMSS will have one instance created: “glProjectVMSS_1”

![image.jpeg](https://cdn.hashnode.com/res/hashnode/image/upload/v1598329206435/nW8Nu3gbu.jpeg)

Scaling rules created as below:


![image.jpeg](https://cdn.hashnode.com/res/hashnode/image/upload/v1598329225900/OBz6jdRg8.jpeg)

Operating System information.

![image.jpeg](https://cdn.hashnode.com/res/hashnode/image/upload/v1598329230800/odcreUS7h.jpeg)

Following inbound rules created by default.

![image.jpeg](https://cdn.hashnode.com/res/hashnode/image/upload/v1598329240210/Ln0XyA-hH.jpeg)

Load Balancer created.


![image.jpeg](https://cdn.hashnode.com/res/hashnode/image/upload/v1598329248926/dL0wjw3SDg.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](https://cdn.hashnode.com/res/hashnode/image/upload/v1598329268877/1d9MKkWviG.jpeg)

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


![image.jpeg](https://cdn.hashnode.com/res/hashnode/image/upload/v1598329279718/0CrWY7eTS.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](https://cdn.hashnode.com/res/hashnode/image/upload/v1598329304085/ebLCD_Agh.jpeg)

The RDP file downloaded asks for username and password.

![image.jpeg](https://cdn.hashnode.com/res/hashnode/image/upload/v1598329314237/Qqp6dn13-.jpeg)

Asks for certificate validation. Click on continue.
 
![image.jpeg](https://cdn.hashnode.com/res/hashnode/image/upload/v1598329360539/zzrebJJHf.jpeg)

On connecting successfully, it will open Windows Server app automatically.
![image.jpeg](https://cdn.hashnode.com/res/hashnode/image/upload/v1598329370822/ROEcjFJvLO.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](https://cdn.hashnode.com/res/hashnode/image/upload/v1598329392676/MflLp5pimk.jpeg)

Next try to access Load balancers public IP address.

![image.jpeg](https://cdn.hashnode.com/res/hashnode/image/upload/v1598329406968/UtLqZ4ml0O.jpeg)

Now we are able to access IIS home page successfully through Load Balancer’s IP.
![image.jpeg](https://cdn.hashnode.com/res/hashnode/image/upload/v1598329414669/tBrfPZc0f.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! 😊