How to Create Virtual Machine Scale Set.
Tags: azure, balancer, vmss, load
Published: 2024-07-05 02:20:16

- Login to Azure
- Create a Virtual Machine Scale Set
- Clean Up Resource 

This article steps through using Azure portal to create a Virtual Machine Scale Set.

## Loging To Azure
Sign in to the Azure portal.

## Create a Virtual Machine Scale Set
You can deploy a scale set with a Windows Server image or Linux image such as RHEL, Ubuntu, or SLES.

- Type Scale set in the search box. In the results, under Marketplace, select Virtual Machine Scale Sets.

- Select Create on the Virtual Machine Scale Sets page, which opens the Create a Virtual Machine Scale Set page.

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

- In the Basics tab, under Project details, make sure the correct subscription is selected and create a new resource group called myVMSSResourceGroup.

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

- Under Scale set details, set myScaleSet for your scale set name and select a Region that is close to your area

- Under Orchestration, select Uniform.

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

- Under Instance details, select a marketplace image for Image. Select any of the Supported Distros.

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

- Under Administrator account configure the admin username and set up an associated password or SSH public key.

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

A Password must be at least 12 characters long and meet three out of the four following complexity requirements: one lower case character, one upper case character, one number, and one special character.

If you select a Linux OS disk image, you can instead choose SSH public key. You can use an existing key or create a new one.

- Select Next: Disks to move the disk configuration options
leave the default disk configurations.

- Select Next: Networking to move the networking configuration options.

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

- On the Networking page, under Load balancing, select the Use a load balancer checkbox to put the scale set instances behind a load balancer.

- In Load balancing options, select Azure load balancer.

- In Select a load balancer, select a load balancer or create a new one.

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

- For Select a backend pool, select Create new, type myBackendPool, then select Create.

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

Select Next: Scaling to move to the scaling configurations.

On the Scaling page, set the initial instance count field to 5. You can set this number up to 1000.

For the Scaling policy, selete custom autoscale

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


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


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

- When you're done, select Review + create.

After it passes validation, select Create to deploy the scale set.


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


## Clean Up Resources

**Delete Resource**

When no longer needed, you can delete the resource group, virtual machine, and all related resources.

- On the Overview page for the VM, select the Resource group link

- At the top of the page for the resource group, select Delete resource group.

- A page will open warning you that you are about to delete resources. Type the name of the resource group and select Delete to finish deleting the resources and the resource group