Create a virtual machine in the portal

In this walkthrough, we will create a virtual machine in the Azure portal, connect to the virtual machine, install the web server role and test.

Note: Take time during this walk-through to click and read the Informational icons.

Task 1: Create the virtual machine

In this task, we will create a Windows Server 2019 Datacenter – Gen1 virtual machine.

1. Sign in to the Azure portal (
2. From the All services blade, search for and select Virtual machines, and then click + Add and choose +Virtual machine.
3. On the Basics tab, fill in the following information (leave the defaults for everything else):

Switch to the Networking tab, and look for the Select inbound ports:

4. Switch to the Management tab, and in its Monitoring section, select the following setting:

  1. Leave the remaining defaults and then click the Review + create button at the bottom of the page.
  2. Once Validation is passed click the Create button. It can take anywhere from five to seven minutes to deploy the virtual machine.
  3. You will receive updates on the deployment page and via the Notifications area (the bell icon in the top menu).

Verify Port 80 was opened

Task 2: Connect to the virtual machine

In this task, we will connect to our new virtual machine using RDP.

  1. Search for myVM and select your new virtual machine.
    Note: You could also use the Go to resource link on the deployment page or the link to the resource in the Notification area.
  2. On the virtual machine Overview blade, click the Connect button and choose RDP.

Note: The following 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 and on a Linux computer you can use an open source RDP client.

  1. In the Connect to virtual machine page, keep the default options to connect with the public IP address over port 3389 and click Download RDP File.
  2. Open the downloaded RDP file and click Connect when prompted.

  1. In the Windows Security window, select More choices and then Use a different account. Provide the username (.azureuser) and the password (Pa$$w0rd1234). Click OK to connect.

6. You may receive a certificate warning during the sign-in process. Click Yes or to create the connection and connect to your deployed VM. You should connect successfully.

Congratulations! You have deployed and connected to a Windows Server virtual machine in Azure

Task 3: Install the web server role and test

In this task, install the Web Server role on the server and ensure the default IIS welcome page can be displayed.

1. Open up a PowerShell command prompt on the virtual machine, by clicking the Start button, typing PowerShell, right clicking Windows PowerShell, and selecting Run as administrator in the right-click menu.

2. Install the Web-Server feature in the virtual machine by running the following command in the PowerShell command prompt. You can copy and paste this command.

Install-WindowsFeature -name Web-Server -IncludeManagementTools

3. When completed there will be a prompt stating Success with a value True. You do not need to restart the virtual machine to complete the installation. Close the RDP connection to the VM.

4. Back in the portal, navigate back to the Overview blade of myVM and, use the Click to clipboard button to copy the public IP address of myVM, open a new browser tab, paste the public IP address into the URL text box, and press the Enter key to browse to it.

5. The default IIS Web Server welcome page will open.

Congratulations! You have created a web server that is accessible via its public IP address. If you had a web application to host, you could deploy application files to the virtual machine and host them for public access on the deployed virtual machine.

Note: To avoid additional costs, you can remove this resource group. Search for resource groups, click your resource group, and then click Delete resource group. Verify the name of the resource group and then click Delete. Monitor the Notifications to see verify that the deletion completed successfully.

One Comment

  1. Mustapha 5 mai 2024 at 16h20 - Reply

    بسم الله الرحمن الرحيم

Leave A Comment

Certifs IT Library

Explore our comprehensive web library to Find a wealth of invaluable resources, including extensive documentation and hands-on labs.

Inscription ouverte pour la formation Vmware VCP-DCV 2024
Mai 2024