How to deploy a Windows Server (with IIS web server role) in Azure Portal on MacOS
Tunde Oretade
Posted on May 26, 2024
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.
- Search for "virtual machines" in the search bar at the top level of the page. Select virtual machines from the list of results.
- 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.
- Select Azure virtual machine from the list, and then it will navigate to the "create a virtual machine" configuration page.
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.
- Click the "ok" button to accept the given name.
Instance Details
- At the Instance Details subhead, provide a name for the virtual machine at the Virtual machine name label.
- For the Region label select a suitable datacenter region.
- 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.
- 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.
- For the Security type label, select Trusted launch virtual machinnes option.
- At the Image label, select the preferred Windows server option from the dropdown list.
- 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.
Administrator account
- Create a Username for the Windows Server and a Password
Inbound port rules
- Allow selected ports at the Public inbound ports options
- From the Select inbound ports drop down list, select both HTTP (80) and RDP (3389) as the ports of communication.
Monitoring Tab
Under the Monitoring Tab it is desirable to disable Boot diagnostics.
Diagnostics
- At the Boot Diagnostics label, set it to Disable
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.
- The next step is to click the Review + Create button at the bottom of the page or the Review + Create tab at the top.
- 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"
- click the create button at the bottom of the page to initialize deployment.
- When the deployment is completed there is a notification at the top page that says "Your deployment is complete"
- click the Go to resource button to go to the newly created resource page.
- At the right-hand side of the page, look for the "Public IP address" label, and click on the IP address.
- This navigates to a page to increase the idle timeout from 4 minutes to the maximum (usually 30 minutes)
- Click on the save icon at the top of the page.
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.
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.
This directs to the connect page.Click the Select button at the local machine card with the heading "Most common".
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.
- 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.
- 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.
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.
- Supply the password as required.
- Click continue at the next prompt
- If the correct login credentials are submitted there will be a Windows Server starting page like below.
- This automatically launches the Server manager
- This is followed by a setup page below.
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.
-Right-click to launch the PowerShell terminal as an Administrator
- type in the following command in the PowerShell terminal: install-WindowsFeature -name Web-Server -IncludeManagementTools This creates the iis role in this server.
- 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.
- if the virtual machine is properly configured following these instructions, you should see something like below:
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
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
May 26, 2024