Creating an Azure Virtual Machine
With a virtual machine on Azure, you can enjoy the benefits of virtualization without investing in and managing the hardware that powers it. Nonetheless, it is essential to maintain the virtual machine by setting it up, updating it, and installing the necessary software. There are four methods to create a VM, including Azure Portal, PowerShell, Rest API, or Azure CLI, but the most recommended option is the Azure Portal.
To create an Azure virtual machine in the Azure portal
- Sign in to the Azure Portal account where VM needs to be created.
The Azure Portal Home pane appears. - Under Azure Services, click Create a Resource.
The Create a resource pane appears. - Under Virtual machine, click Create.
The Create a virtual machine pane appears.
Basics
You can use Basics pane to add project details, instance details, create administrator account, and Inbound port rules.
- Under Project details, do the following:
- In the Subscription list, choose the required subscription.
- In the Resource group list , choose the required resource group.
If you do not have one, click Create new, enter the name, and click OK.
- Under Instance details, do the following:
- In the Virtual machine name box, type virtual machine name.
- In the Region list, choose the required region.
- In the Availability options list, choose the required option.
- In the Availability zone list, choose the required zone. You can select multiple zones and it creates VM for each zone.
- In the Security type list, choose the required security. The default security type is Standard.
- In the Image list, choose the required Windows image.
- For the VM architecture, click the required option.
- For Run with Azure Spot discount, select the checkbox if you need a spot discount. Click the information icon for more details on the spot discount.
- In the Size list, choose the required VM size. If you want to see all sizes, click See all sizes to compare the sizes and prices.
- Under the Administrator account, do the following:
- In the Username box, type username.
- In the Password box, type a strong password.
- In the Confirm password box, retype the password to confirm.
- Under Inbound port rules, do the following:
- For Public inbound ports, click Allow selected ports.
- In the Select inbound ports list, choose RDP (3389) port.
- Under Licensing, leave the checkbox unselected.
- Click Next: Disks. The Disks pane appears.
Disks
You can use Disks pane to select the disk type, size and other details.
To configure disks
- Under VM disk encryption, leave the VM disk encryption checkbox unselected.
- Under the OS disk, do the following:
- In the OS Disk type list, choose Premium SSD (locally-redundant-storage).
- Select the Delete with VM checkbox.
- In the Key management list, choose Platform-managed key.
- Leave the Enable Ultra Disk compatibility checkbox unselected.
- Click Next : Networking >. The Networking pane appears.
Networking
You can use networking pane to add virtual network, subnet, public IP, network security group and other details. Azure automatically creates a network interface when creating a VM.
To add details in the networking pane
- Under Network interface, do the following:
- In the Virtual network list, choose a virtual network.
- In the Subnet list, choose the default subnet.
- In the Public IP list, choose the public IP.
- For NIC network security group option, click Basic.
- For Public inbound ports option, click Allow selected ports.
- In the Select inbound ports list, choose RDP (3389).
- Select the Delete public IP and NIC when VM is deleted checkbox.
- Leave the Load Balancing section to its default value.
- Click Next : Management >.
The Management pane appears.
Management
You can use Management pane to enable auto-shutdown and select OS updates option.
To set up management
- Under Auto-shutdown, do the following:
- Select Enable auto-shutdown checkbox.
- In the Shutdown time box, enter the timings.
- In the Time zone list, choose the required time zone.
- Under Guest OS updates, in the Patch orchestration options list box, choose Automatic by OS (Windows Automatic Updates).
- Click Next : Monitoring >.
The Monitoring pane appears.
Monitoring
You can use the Monitoring pane to set up alert rules and diagnostic settings. By default, boot diagnostic is enabled with a managed storage account.
To configure alerts and diagnostics
- In the Monitoring pane, under Alerts, select Enable recommended alert rules
- Under Diagnostics, click the required option.
- Click Next : Advanced >. The Advanced pane appears.
Advanced
You can use the Advanced pane to install VM applications, add custom data, user data and other advanced settings.
- In the Advanced pane, choose the required options and click Next : Tags >. The Tags pane appears.
Tags
- In the Tags pane, enter a name for the tag in the Name box.
- In the Value box, enter a value.
- Choose the number of resources from the Resource list box.
- Click Next : Review + create >. The Review + create pane appears.
Review + create
- Once the validation is passed, review the VM details and click Create.