Create a Windows virtual machine in the Azure portal

Create a Windows virtual machine in the Azure portal

Let's create an Azure Virtual Machine (Windows).

Azure virtual machines are one of several types of?on-demand, scalable computing resources?that Azure offers. Typically, you choose a virtual machine when you need more control over the computing environment than the other choices offer. You will learn about what you should consider before you create a virtual machine, how you make it, how you manage it, and how to attach an additional data disk.

In this article

  1. What do you need to know before creating a virtual machine
  2. Sign in to Azure
  3. Create virtual machine
  4. Connect to the virtual machine
  5. Create and attach a new data disk

An Azure virtual machine gives you the flexibility of virtualization without buying and maintaining the physical hardware that runs it. However, you still need to maintain the virtual machine by performing tasks, such as configuring, patching, and installing the software that runs on it.

What do you need to know before creating a virtual machine?

These aspects of a virtual machine are important to think about before you start:

  • The names of your application resources
  • The location where the resources are stored
  • The size of the virtual machine
  • The maximum number of virtual machines that can be created
  • The operating system that the virtual machine runs
  • The configuration of the virtual machine after it starts
  • The related resources that the virtual machine needs

Create an Azure virtual machine

Azure virtual machines (VMs) can be created through the Azure portal. This method provides a browser-based user interface to create VMs and their associated resources. This quickstart shows you how to use the Azure portal to deploy a virtual machine (VM) in Azure that runs Windows Server 2022. To see your VM in action, you then RDP to the VM.

If you don't have an Azure subscription, create a?free account?before you begin.

Step#1 Sign in to Azure

Sign in to the Azure portal at?https://portal.azure.com

No alt text provided for this image

Step#2 Select Azure virtual machine

  1. Select Virtual machines from Azure services or type?virtual machines?in the search.
  2. Under?Services, select?Virtual machines.
  3. In the?Virtual machines?page, select?Create?and then?Azure virtual machine. The?Create a virtual machine?page opens.

No alt text provided for this image

Step#3 Project Details

Under?project details, select your subscription and resource group if you do not have an existing resource group click on Create new and create a new resource group first (An Azure subscription and a resource group are compulsory).

No alt text provided for this image

Step#4 Instance Details

Under?Instance details, enter?VM1?for the?Virtual machine name?and choose the required Image?(I am using Windows Server 2022 Datacenter - Gen 2). Choose a specific region and size of resources (In my case I am using 4 virtual CPUs and 16 GiB memory), and leave the other defaults.

No alt text provided for this image

Step#5 Provide Administrative Details

Under?the Administrator account, provide a username, such as?azureuser?and a password. The password must be at least 12 characters long and meet the?defined complexity requirements.

Under?Inbound port rules, choose?Allow selected ports?and then select?RDP (3389) (for a remote session)?and?HTTP (80)?(for web access) from the drop-down.

No alt text provided for this image

After Step#5 you can leave the remaining defaults and then select the?Review + create?button at the bottom of the page. After validation runs, select the?Create?button at the bottom of the page to create a Virtual Machine.

To configure custom advanced options follow the next steps.

Step#6 Attach OS Disk

Go to the Disks menu to attach OS Disk first. Under?the OS disk select an OS disk type that best suits your requirements, you can also check the Delete with VM option to delete this disk whenever you want to delete this VM.

No alt text provided for this image

A temporary disk will also be attached to this VM to store additional data but data in this disk will be lost if you restart or shut down the VM. For permanent data storage, you need to create a separate Data Disk.

Step#7 Create and attach a new Data disk

Under?the Data disks for VM1 click on Create and attach a new disk.

No alt text provided for this image

After clicking on Create and attach a new disk this window will open, set a name for the Data disk and select your required disk size and leave the other defaults.

No alt text provided for this image

A new Data disk will be created and get attached to your virtual machine.

No alt text provided for this image

Step#8 Create a virtual network

In the networking section, you can configure network connectivity for your virtual machine.

  1. Under?the Network interface, create a new Virtual Network and a Subnet.
  2. Create a new Public IP you will need this IP to establish an RDP session.
  3. Leave the others default.

No alt text provided for this image

A Virtual network will be created by default but you can customize the Virtual network and subnet mask according to your requirements. Leave the other settings default.

In my case, I named the virtual network as MyVnet and selected the address range or network id 20.0.0.0/16. I have attached this virtual machine to Subnet 1 20.0.1.0/24 an IP address from this range will be assigned to this virtual machine.

No alt text provided for this image

Step#9 Set Management, Monitoring, Advanced and tags options

In the management section, you can configure management options or you can leave them default. Management options are additional settings like Auto-shutdown and Azure AD login.

No alt text provided for this image

In the monitoring section, you can configure monitoring options as per your requirements or leave them default. In monitoring options, you can set Alerts for your virtual machine and other Diagnostics settings.

No alt text provided for this image

In the Advanced section, you can configure advanced settings according to your requirements or leave them default. For example, if you want to install IIS (webserver) with VM installation you will use the Extensions option. If you're going to install VM applications during VM deployment you can use the VM applications option.

No alt text provided for this image

You can set some tags to your virtual machine and other resources associated with the VM for recognition in the Tags section.

No alt text provided for this image

Step#10 Validation, Review + create

Leave the remaining defaults and then select the?Review + create?button at the bottom of the page. After validation runs, select the?Create?button at the bottom of the page. At this stage, if you successfully received the Validation passed notification you can check an overview of all your settings and configuration of your virtual machine. If something is missing you can go back using the previous button or click on a specific section to edit settings.

No alt text provided for this image

Step#11 Go to resource to find and connect the virtual machine.

After the successful deployment of the virtual machine, you will receive a Deployment succeeded notification. To access the VM you can click on Go to resource or you can find it in the Virtual Machines option and also in your Resource group.

No alt text provided for this image

Connect to the virtual machine

Step#12 Connect to the virtual machine

After opening your virtual machine you will see a Connect option in the navigation pane. Create a remote desktop connection to the virtual machine. These directions tell you how to connect to your VM from a Windows computer. On a Mac, you need an RDP client such as this?Remote Desktop Client?from the Mac App Store.

On the overview page for your virtual machine, select Connect?>?RDP.

No alt text provided for this image

In the?Connect with RDP?tab, keep the default options to connect by IP address, over port 3389, and click?Download RDP file.

No alt text provided for this image

Open the downloaded RDP file and click?Connect?when prompted.

No alt text provided for this image

In the?Windows Security?window, select?More choices?and then?Use a different account. Type the username as?localhost\username, enter the password you created for the virtual machine, and then click?OK.

No alt text provided for this image

You may receive a certificate warning during the sign-in process. Click?Yes?or?Continue?to create the connection.

No alt text provided for this image

Finally, a connection will be established successfully.

No alt text provided for this image

Create and attach a new data disk

I have attached a separate disk to store data but in the previous screenshot of the virtual machine Windows explorer, you can see the disk is not listed. We have to format the disk first, to do this we have to access disk management. We can access disk management by simply searching disk management in the Windows search bar.

No alt text provided for this image

Right-click on the unallocated disk and click on New Simple Volume.

No alt text provided for this image

Write the disk name in the Volume label e.g: Data Disk and follow the next steps to format the disk.

No alt text provided for this image

You can access the data disk now.

No alt text provided for this image

I hope you liked this tutorial, do not forget to share your feedback and also share this Article with your connections who might be interested in it.

Zeshan Adil

Sales Coordinator at Arabian International Company | AIC Translift | Heavy Equipment |

1 年

Is there any possibilites to create virtual machine without adding credit or debit card?

回复

要查看或添加评论,请登录

Faraaz Atta的更多文章

  • RIP Windows 7: We’re Going to Miss You

    RIP Windows 7: We’re Going to Miss You

    RIP Windows 7: We’re Going to Miss You More than a decade after its release, Windows 7 support ends today on January…

  • Introducing the New CCNA!

    Introducing the New CCNA!

    Cisco is going to update current CCNA 200-125 into CCNA 200-301 on 24 Feb. 2020.

社区洞察

其他会员也浏览了