How to deploy a Windows Server (with IIS web server role) in Azure Portal on MacOS

tundeiness

Tunde Oretade

Posted on May 26, 2024

How to deploy a Windows Server (with IIS web server role) in Azure Portal on MacOS

Introduction

This post is about deploying a Windows Server in Azure Portal on MacOS. Previously, I have written about deploying a Windows 11 OS in the Azure portal here. Before you start following this guide, get a Microsoft account and an Azure account. If you have followed this post, deploying a Windows Server in Azure Portal will be a walk in the park. Let's get to it!!

Step 1

Create a Virtual Machine.

  • Access the Azure portal As shown in the image below. Azure portal
  • Search for "virtual machines" in the search bar at the top level of the page. Select virtual machines from the list of results.

Search bar Search

  • Select either the + Create option at the top left side of the page displayed, or click the Create button with a dropdown arrow at the bottom of the page. create
  • Select Azure virtual machine from the list, list and then it will navigate to the "create a virtual machine" configuration page. create a virtual machine

Basics Tab

Under the Basics Tab supply information for the Windows Server virtual machine as follows:

Project Details
  • By now the Subscription label under project details should have a name, otherwise give Subscription a title.
  • At the Resource group label select Create new to either create a new resource group or use an existing group from the list of resource group earlier created. Resource group label naming a resource group
  • Click the "ok" button to accept the given name. Accept name
Instance Details
  • At the Instance Details subhead, provide a name for the virtual machine at the Virtual machine name label.

virtual machine name

  • For the Region label select a suitable datacenter region.

virtual machine naming

  • For the Availability options label, select Availability zone as the preferred option. This permits the selection of data center zone(s) in the preceding label.

Availability options

  • Next, move to the Availability zone. This label allows for selecting multiple zones, but for the post, I selected only one zone. Selecting multiple zones means there is a need for a load balancer.

Availability zone

  • For the Security type label, select Trusted launch virtual machinnes option.

Security type

  • At the Image label, select the preferred Windows server option from the dropdown list.

Image label

Windows Server data center edition

  • The VM architecture should be kept at x64, and keep Run with Azure Spot discount unticked.
  • At the Size label, select Standard_B1s - 1 vcpu, 1 GiB memory size and do not tick the Enable Hibernationn box.

Size

Administrator account
  • Create a Username for the Windows Server and a Password

Administrator Account details

Administrator Account filled

Inbound port rules

Inbound port rules

  • Allow selected ports at the Public inbound ports options Allow selected ports
  • From the Select inbound ports drop down list, select both HTTP (80) and RDP (3389) as the ports of communication. Select inbound ports

Monitoring Tab

Monitoring Tab
Under the Monitoring Tab it is desirable to disable Boot diagnostics.

Diagnostics
  • At the Boot Diagnostics label, set it to Disable Boot Diagnostics

Tag Tab

Tag Tab
Under the Tag Tab it is ideal that name and value are created for the resources.

  • At the annotated part of the image below, give the resource a name and value. Both the name and value are called Tags and they help to categorize resources. Name/value pair

Name/value pair filled

  • The next step is to click the Review + Create button at the bottom of the page or the Review + Create tab at the top. Review + Create

validating

  • When it has completed validation, there is a pale green banner and a green check mark at the top of the page saying "Validation passed"

validation passed

  • click the create button at the bottom of the page to initialize deployment.

create button

initialise deployment

deployment in progress

  • When the deployment is completed there is a notification at the top page that says "Your deployment is complete"

deployment complete

  • click the Go to resource button to go to the newly created resource page.

Go to resource

resource page

  • At the right-hand side of the page, look for the "Public IP address" label, and click on the IP address.

IP address

  • This navigates to a page to increase the idle timeout from 4 minutes to the maximum (usually 30 minutes)

Idle Timeout

Maximum Idle timmeout

  • Click on the save icon at the top of the page.

Save

saved changes

  • you can then close the IP configuration page after making these changes by clicking the close button at the top right part of the page.
    close page

  • Back at the Virtual Machine overview page, select Connect at the top level part of the page or the left-hand side of the page.
    Connect
    This directs to the connect page.

  • Click the Select button at the local machine card with the heading "Most common".
    Select

  • On clicking select, several processes are triggered to validate prerequisites before configuration. Until there is a green check mark and
    "configured" at the annotated arrow in the image below, the next step can't start.

validation process

  • Once the processes are completed and there are green check marks and "configured" at the annotated locations in the image above, click on the Download RDP file as shown below.

Dowload RDP file

  • This downloads the RDP file required for powering the Windows server Virtual machine that has been created. Check your default download location in your local machine for this file.

downloaded RDP file

Step 2

Launch the Virtual Machine.

  • To check if the Windows Server virtual machine works, log in using previously created credentials at the Administrator Account section above. Before signing in, Mac users need to go to the App Store, download and install the Microsoft Remote Desktop app. After installing the Microsoft Remote Desktop app, double-click the downloaded RDP file.

Login

  • Supply the password as required.
  • Click continue at the next prompt

continue

  • If the correct login credentials are submitted there will be a Windows Server starting page like below.

starting page

  • This automatically launches the Server manager

Server Manager

  • This is followed by a setup page below.

server manager setup page

  • There is a need to also install a Windows server iis role in the server and there are two ways to do this. The first approach is using the server manager setup and the second one is via the terminal. In this post, I will be using the terminal.

  • Close the server setup page and search PowerShell at the hand lens icon at the bottom of the virtual machine page. Type "PowerShell" to search.

Search

-Right-click to launch the PowerShell terminal as an Administrator

powershell

powershell launching

  • type in the following command in the PowerShell terminal: install-WindowsFeature -name Web-Server -IncludeManagementTools This creates the iis role in this server.

iis role

Installing role

  • When the role installation is complete, go to the Azure portal Windows Server Virtual Machine page, copy the Public IP address, and paste it on the browser.

Public IP address

  • if the virtual machine is properly configured following these instructions, you should see something like below:

welcome page

Conclusion

With all the steps listed above, I have created a Windows Server virtual machine in an Azure portal. It is advised that the resource group in the Azure portal be deleted. However, before deleting the resource group in the Azure portal, there is a need to shut down the Windows Server virtual machine on the MacOS.
This post describes a high-level approach to creating a Windows Server virtual machine on a MacOS computer. More posts on cloud DevOps with Azure will be coming up during my journey into cloud development.

cover image by Taylor Vick on Unsplash

💖 💪 🙅 🚩
tundeiness
Tunde Oretade

Posted on May 26, 2024

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related