How to Create Azure Windows Virtual Machine with Free Subscription

In this topic. you’ll learn how to create Azure Windows Virtual Machine (compute resources). You’ll also learn how to create and use a free Azure subscription.  I provide walkthrough examples that will help you get some hands-on experiences with Azure cloud. Creating accounts on other cloud platforms like Amazon AWS, Google Cloud and Apple’s iCloud follows a very similar process.



1. How to Create and Use a Microsoft Azure Subscription

In this example, you’ll learn step by step how to create a free Azure subscription.

1. Before you create an Azure subscription, you need to get a free Microsoft account. If you want to use AWS, create a new AWS account. Similarly, if you want to use Google Compute Engine, you must have a Google account. To create a new Microsoft account, navigate to https://signup.live.com and follow the wizard to create a free Microsoft account.

2. To sign up Azure, follow this link: https://signup.azure.com. Use your Microsoft account to sign in. Follow the wizard to complete the sign-up process.

3. In addition to the Microsoft account, you need a cell phone for identity verification, and a credit card for payment verification. Please note your credit card will not be charged unless you explicitly upgrade your free account to a paid offer.

4. Once your subscription is created, you can open the Microsoft Azure Management Portal by navigating to https://portal.zure.com and start using your Azure subscription. See Fig. 1.1.

Microsoft Azure Management Portal
Fig. 1.1: Microsoft Azure Management Portal

Close any pop-up window that may appear. For example, close the Quickstart Center window by clicking the X button on the far-right side of it.

2. How to Create a Windows Virtual Machine (VM)

To create a new virtual machine,

1. click on the +Create a resource link that appear under the Azure services at the upper-left corner of the portal, as shown in Fig 2.1.

Create a new resource under Azure services on the Azure Management Portal
Fig. 2.1: Creating a new resource under Azure services on the Azure Management Portal

2. You are in the Basics section, On the New screen, click on the Windows Server 2016 Datacenter entry, as shown in Fig. 2.2. If you don’t see the entry, you can search for “Windows Server 2016” in the search box near the top of the window and click on the found entry.

The Windows Server 2016 Datacenter entry
Fig. 2.2: click on the Windows Server 2016 Datacenter entry

3a. In the Create a virtual machine window, you need to enter the project detail such as your subscription type. You also need to enter information for your virtual machine, such as the virtual machine name, administrator’s username and password. Please note that you need to create a resource group by clicking on Create new to hold your virtual machine.

Every entity you provision on Azure is called a resource, and you can put one or multiple resources into a resource group. A resource must belong to a single resource group. See Fig. 2.3.

Project details form for creating a virtual machine
Fig. 2.3: Project details form for creating a virtual machine

3b. Under Instance details, type myFirstVM or any similar name you like for the Virtual machine name and choose East US for your Region, and then choose Windows Server 2019 Datacenter for the Image. Leave the other defaults. See the completed entry in Fig. 2.4.

Instance details is completed
Fig. 2.4: Instance details is completed

3c. Under Administrator account, provide a username, such as azureuser (or use your name) and a password. The password must be at least 12 characters long and meet the defined complexity requirements. Entering a strong password is extremely important so you will not have problem when trying to login to your server later. You can generate very strong password on this site: https://passwordsgenerator.net.

Under Inbound port rules, choose Allow selected ports and then select RDP (3389) and HTTP (80) from the drop-down. This allows all IP addresses to access your machine.

If you want a secured virtual machine, select only HTTP (80) and HTTPS (443) or uncheck RDP (Remote Desktop Protocol) and SSH (Secure Socket Shell). However, since this machine is being created for testing (tutorial) purpose only, I can include RDP as shown in Fig. 2.5.

Administrator account detail is completed
Fig. 2.5: Administrator account detail is completed

3d. Click the Next: Disks > button at the bottom of the page. You will be taken to the next section, Disks.

4a. Here, you can choose from various virtual machine sizes. Microsoft Azure provides several series of virtual machines with different memory and CPU core capacities. For this tutorial, you can use the Premium SSD size. Microsoft recommends this disk for high IOPS (input/output operations per second) workloads. Virtual machines with premium SSD disks also qualify for the 99.9% connectivity SLA.

The disks section to be completed
Fig. 2.6: The disks section to be completed

Leave the encryption type and Use managed disks under the Advanced tab at their default settings. See Fig. 2.6.

Use managed disks is left at default
Fig. 2.7: Use managed disks is left at default

Important Note: For best performance, reliability, scalability and access control Microsoft recommends Managed Disks for most virtual machine configurations.

4b. Next, click the Create and attach a new disk link shown in a red box in Fig 2.6. The Create a new disk page opens. See Fig. 2.8.

The Create a new disk section
Fig. 2.8: The Create a new disk section

You are given 1.024 TB of premium SSD disk space. You can click on the Change size button to change the size. Leave the Source type at default (empty disk) to ensure you are selecting an empty disk for your machine, unless you have another disk in your subscription that you would like to use. Also leave the encryption type at default. The disk name in this example is myFirstVM_DataDisk_0 as you can see in Fig. 2.8.

2.9: Select a disk size section showing available disk sizes and features
Fig. 2.9: Select a disk size section showing available disk sizes and features

4c. Click on the OK button in Fig. 2.9 to go back to the previous page to see detail of your disk. See Fig. 2.10.

The disks section is now completed showing the details of the disk
Fig. 2.10: The disks section is now completed showing the details of the disk

5a. There are other sections on this screen that you may want to configure, especially if you are a network or system administrator: Netwoking, Management, Advanced and Tags sections. These sections are automatically created for you so accepting all defaults should work just fine. Now just click on the Review + Create button.

When the review page opens you should see validation passed with a check mark on the top of the page. See Fig. 2.11.

An Overview of your project showing it has passed validation
Fig. 2.11: An Overview of your project showing it has passed validation

If you scroll down this page you will see an overview of your project. Fig. 2.12. Note the You have set RDP port(s)… warning message in Fig. 2.11. It is showing because I deliberately checked RDP (3389) as explained in step 3c above.

An Overview of the virtual machine project
Fig. 2.12: An Overview of the virtual machine project

5b. Click the Create button to create your virtual machine. At the time of writing, the VM creation wizard has been updated. Machine creation takes a few minutes. You will see “Your deployment is underway” as the page is updated. See Fig. 2.13.

Our Virtual machine is being created
Fig. 2.13: Our Virtual machine is being created

Once the machine is created, the “Your deployment is complete” page will automatically open, as shown in Fig. 2.14.

Our Virtual machine has been created (deployment is complete)
Fig. 2.14: Our Virtual machine has been created (deployment is complete)

To go to the machine overview page, click on the Go to resource button at the bottom of the screen. A virtual machine tile should also have been added to your portal home page.

Our Virtual machine overview has been created and is now running
Fig. 2.15: Our Virtual machine overview has been created and is now running

6. Click on the Connect link shown on the left panel in Fig. 2.15 to go the page where you can connect to your virtual machine via your RDP. Fig. 2.16.

Our Virtual machine connection page is open
Fig. 2.16: Our Virtual machine connection page is open

7. Click on the Download RDP File. It will be downloaded and saved to your computer, for example, on your desktop. See Fig. 2.17.

RDP is saved to my computer’s desktop
Fig. 2.17: RDP is saved to my computer’s desktop

Double click on the downloaded RDP file to open the log in screen. If you get a connection warning from Windows security wizard, like that shown in Fig. 2.18, check the optional “Don’t ask me again…” check box to hide this window next time you try to connect. Now click the Connect button.

Remote desktop connection warning
Fig. 2.18: Remote desktop connection warning

A small dialog window pops up on your desktop where you can use your administrator credential to login. Just enter the username and password you created in step 3c above. See Fig. 2.19.

Enter credentials here to login
Fig. 2.19: Enter credentials here to login

You should see the remote desktop of the machine right on your desktop, as shown in Fig. 2.20.

Virtual Machine remote desktop
Fig. 2.20: Virtual Machine remote desktop

Virtual machines are charged by the actual time they are kept running. To save cost, you should shut it down your when you are not using them. Azure also provides an auto-shutdown feature you can configure on the VM’s overview page. For example, you can schedule your machine to be shutdown at specific time, and configure a notification hook to notify you 15 minutes before that happens.

3. How to Create a Linux Virtual Machine (VM)

You will follow the same steps to create a Linux VM. The only difference here is that at step 2 above where you need to select a Linux image such as Ubuntu Server 18.04 LTS. See Fig. 3.1.

Click on the Ubuntu Server18.04 LTS entry
Fig. 3.1: Click on the Ubuntu Server18.04 LTS entry

Then follow the same wizard to complete the provisioning process. You need to enable port 22 for SSH in this case. If you want to put your Linux virtual machine on the same virtual network as your Windows machine, you need to make the following few different choices:

1. Reuse the same resource group you used the other time instead of creating a new one.

2. Don’t create a new virtual network when you get to the Networking page. You should pick the one that was created when the Windows virtual machine was provisioned.

Once the machine is provisioned, you can use a SSH terminal to connect to the Linux VM just like how you’d connect to any other remote Linux machines.

Congratulations!

You just reached another milestone! You’ve just learned how to create azure windows virtual machine (VM). Now I know it may not feel like much, but there are still other things to learn in cloud computing. If you’ve never  had any hands-on experience with Gcloud before, it’s now time to do so.

I want you to go to my Google Cloud platform tutorial because it will help you learn how to become a Google cloud certified Associate Cloud Engineer. Good luck!

Leave a Comment