This section explains how to create and manage Azure virtual machines. Setting up an Azure virtual machine is much easier than setting up a server in Hyper-V . When you build a new virtual machine in Hyper- V, you create the virtual machine and then you install the guest operating system. So, if I wanted to create a new Windows Server 2022 VM, I would create the new virtual machine in Hyper- V. Once that is done, I would start the VM and install Windows Server 2022.
When you choose the guest operating system in Azure, the operating system is automatically created after you set your option— no need to install the actual server software. Azure builds the VM exactly as you want it built. You choose the disk size, management options, networking options, advanced options, and then choose to create the VM. Microsoft will give you all the information that you need so that you can remote into the VM. Once you are logged into the VM, you can then work on the server the same way you work on any other VM.
Creating a Virtual Machine in Azure
There’s one very important thing to consider when building virtual machines or anything in Azure: Azure is a consumption- based model. This means the more you use, the more you pay. Be careful. As you are building the VM and see all the available options, be sure to choose only what you need.
When you’re working in Azure, you’re going to feel like a kid in a candy store. Everything they offer looks good and they always try to make you think that you need the extras. But for every extra option that you choose, your monthly charges increase.
Exercise 12.5 will walk you through the process of building a new VM in Azure. We will build a new VM with Windows Server 2022 Datacenter as the guest operating system. The creation process is simple, as Exercise 12.5 demonstrates. If there are any fields that you are not sure about setting, click the information icon (the small circle with an I in the center). This will explain what that option does for your setup.
EXERCISE 12.5
Creating an Azure Virtual Machine
- Log into the Azure portal at https://portal.azure.com.
- Choose Deploy A Virtual Machine, as shown in Figure 12.16.
FIGURE 12.16 Deploy a virtual machine
3. We are going to create a new Windows VM. Click the Create button under Create A Windows Virtual Machine (see Figure 12.17).
FIGURE 12.17 Create the Windows VM
4. The Create A Virtual Machine screen opens. On this screen (see Figure 12.18), we can choose which subscription we will add to this VM. You also name your virtual machine (I used WinSrv2022 as my VM name), choose your region, image (the operating system you want to use), admin username and password, and other information. Fill in all the fields and the region. Once all the fields are completed, we can create the VM or we can choose the components for the VM (disks, network, etc.) that we want to set up. We are going to go through each screen, but I will leave the defaults for the rest of my options.
Click the Next: Disks button.
FIGURE 12.18 Create A Virtual Machine page
5. On the Disks page (shown in Figure 12.19), review the disk information. Make any changes for your VM. I am leaving the defaults. After you choose your disk options, click Next: Networking.
FIGURE 12.19 VM Disks page
6. On the Networking page (see Figure 12.20), you can choose your virtual network, IP address, NIC security, and any ports that can connect to this VM. Once you have made your choices, click Next: Management.
FIGURE 12.20 Networking page
7. On the Management page, choose the options that you want set for your VM and then click Next: Monitoring.
8. On the Monitoring page, you can choose to set up alert rules and diagnostic data (see Figure 12.21). Make any changes that you wish and then click Next: Advanced.
FIGURE 12.21 Monitoring page
9. On the Advanced page, you can choose if you want any applications automatically installed, scripts, user settings for accessing the VM, and other VM settings. Choose any additional options and then click Next: Tags.
10. The Tags page will appear. Tags are user- defined key- value pairs that can be directly placed on a resource or a resource group. Azure currently supports up to 50 tags per resource and resource group. Tags may be placed on a resource at the time of creation or added to an existing resource. Once you choose your Tags options, click the Next: Review And Create button.
11. On the Review and Create page, review all the options that you chose. If everything is correct, click Create. The VM will be created (as shown in Figure 12.22).
FIGURE 12.22 Deployment Is In Progress page
12. Once the VM is created, you will see a screen stating that your deployment is complete (as shown in Figure 12.23). Click the Go To Resource button. The VM is built and ready to start. You can start the VM, connect to the guest operating system, and start your server.
FIGURE 12.23 Your Deployment Is Complete
After the virtual machine is created, you will be shown the information for your new Azure virtual server (see Figure 12.24). Make sure you copy or print this information. As part of the information presented, you will be given an IP address so that you can use options like Remote Desktop to make the connection. I will be deleting this VM but I still used xxxx over my private information for this VM.