How to deploy a Windows Server (with IIS web server role) in Azure Portal on MacOS
Tags: winndowsserver, azure
Published: 2024-05-26 15:38:02

---
title: How to deploy a Windows Server (with IIS web server role) in Azure Portal on MacOS
published: true
description: setting up a Windows server in Azure
tags: winndowsserver, Azure
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/aqjwdais8yq4mtohidyj.jpg
# Use a ratio of 100:42 for best results.
# published_at: 2024-05-19 18:06 +0000
---

#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](https://dev.to/tundeiness/setting-up-a-windows-11-virtual-machine-with-azure-on-a-macos-88m). Before you start following this guide, get a Microsoft account and an Azure account. If you have followed this [post](https://dev.to/tundeiness/setting-up-a-windows-11-virtual-machine-with-azure-on-a-macos-88m), 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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/673rcakn5tao059hs2eq.png)
- 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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8nv3pxl5qy45mgpabw2k.png)
- 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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kp9evsjb96cy3yr0qg68.png)
- Select **Azure virtual machine** from the list, 
![list](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sacclshddpa0wr7ao5ek.png)
and then it will navigate to the "create a virtual machine" configuration page.
![create a virtual machine](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4obw1pvddy6eot74w8u0.png)

#### 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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ezjjxbdzofbcu6lutpsu.png)
 ![naming a resource group](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kutfn6mzdkjlzayk1odz.png)
- Click the "ok" button to accept the given name.
![Accept name](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2q7wnm3w23foz9sfl6mr.png)

#####Instance Details

- At the Instance Details subhead, provide a name for the virtual machine at the **Virtual machine name** label.

![virtual machine name](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xdhijyce2frcou2zzh93.png)
- For the **Region** label select a suitable datacenter region.

![virtual machine naming](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nge93mrigbz3u3c6j2t5.png)

- 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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8pgtniqb0z8ubt47qk99.png)

- 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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6r0yorss3td54r0dp9br.png)

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

![Security type](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0o3y2rzz190roiw3n51f.png)


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

![Image label](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/utnla9jp4wel1l4nq0wq.png)

![Windows Server data center edition](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7kq7v6j4bse48b3n4b1c.png)


- 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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dhd5clqg4dk1opnnijpj.png)


#####Administrator account

- Create a **Username** for the Windows Server and a **Password**

![Administrator Account details](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xtlxa6htokd3646r5m8e.png)

![Administrator Account filled](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/72d2a75fija1haxxe961.png)


#####Inbound port rules
![Inbound port rules](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fehanrupsz0e32eglvym.png)
- **Allow selected ports** at the **Public inbound ports** options
![Allow selected ports](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ufcfhu2hsuyyb021w0kl.png)
- From the **Select inbound ports** drop down list, select both **HTTP (80)** and **RDP (3389)** as the ports of communication. 
![Select inbound ports](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n2qtu9kvw8a0zv9wpcv4.png)



#### Monitoring Tab
![Monitoring Tab](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3pdmcgl300ep5p0ovvyn.png)
Under the **Monitoring Tab** it is desirable to disable Boot diagnostics. 
#####Diagnostics
- At the **Boot Diagnostics** label, set it to **Disable**
![Boot Diagnostics](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/owm1n8dc3itmzlk34tda.png)



#### Tag Tab
![Tag Tab](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b7xkrdsez30nxe3skh4e.png)
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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3m0eo3x3h48zeh09o1l9.png)

![Name/value pair filled](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xwtmou7uz0igcgaghhik.png)

- 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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6arimmku81odzxszimgz.png)

![validating](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e20q0mb23k1m8w130wgb.png)

- 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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k94njiycnip6wpgr93n0.png)

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

![create button](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xflf5ylh8j24et4deutf.png)

![initialise deployment](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s3y246pz79ga64138b9f.png)

![deployment in progress](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lx852952a8hdb0wb3o7f.png)

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

![deployment complete](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8tureu0jcg0knb1uxh2n.png)

- click the **Go to resource** button to go to the newly created resource page.

![Go to resource](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/17vrqn48dto5ae0u9fb8.png)

![resource page](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kuxeo2cncr4wlwqn5m4d.png)

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

![IP address](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/860z6py9btmegkkxkqoc.png)

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

![Idle Timeout](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j7tkx3ln4izg7wbqlg3z.png)

![Maximum Idle timmeout](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7ka2a18xlxpi1jniqurz.png)

- Click on the **save** icon at the top of the page.

![Save](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bm43xz7ndai8algpysrq.png)

![saved changes](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sidcawr7bdu8ufyvweov.png)

- 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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qg6e7dkitnqrnpy78jc9.png)


- 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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5bonka8fs3gvu7gjuk1v.png)
This directs to the connect page.
- Click the **Select** button at the local machine card with the heading "Most common". 
![Select](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2dc3vl9gzmknnvgsojlw.png)


- 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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/baav91be1xnrcutjkm1g.png)
 
- 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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/06oz5cge71mkqmzgbtn9.png)


- 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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4p28leisxysalc06pc9w.png)



##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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pa8kn9hra8jkl1ia25tl.png)

- Supply the password as required.
- Click **continue** at the next prompt

![continue](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wxq47xe93a31vylhuxrr.png)
 
- If the correct login credentials are submitted there will be a Windows Server starting page like below.

![starting page](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pvtqd78d70slq7y6kbyn.png)

- This automatically launches the **Server manager**

![Server Manager](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fksg3rov4wpa02t5tz61.png)

- This is followed by a setup page below. 

![server manager setup page](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ognc6xezvn2thcs37qv8.png)

- 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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/617uw660yyv0t3iyjav1.png)

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

![powershell](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uivvn8trp9rjwec8pqvi.png)

![powershell launching](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wxid236ub4nkdzql6ur6.png)

- 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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/36nokb0sei9ehi9wc5iw.png)

![Installing role](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/64tya7ydsjmtl5v9bfj1.png)

- 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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gli80703foe3tm31azsa.png)


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

![welcome page](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u6o3sxxmma3550qaheuf.png)


#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 <a href="https://unsplash.com/@tvick?utm_content=creditCopyText&utm_medium=referral&utm_source=unsplash">Taylor Vick</a> on <a href="https://unsplash.com/photos/cable-network-M5tzZtFCOfs?utm_content=creditCopyText&utm_medium=referral&utm_source=unsplash">Unsplash</a>