How to Create a Window Server Virtual Machine and install and IIS Web server role on the VM
Published: 2024-06-08 12:33:24


In this article we will be creating a virtual machine and also we wuill install an IIS weber sever role on the virtual machine.

**Lets Begin**

Search for Virtual Machine and select Virtual machine 
![Search for Virtual Machine](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vvmz65wrpqbjozwfp88x.png)

Click on  +create  on your extreme left 
![+create](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/561hzlyhkrja4ut8xrng.png)

Select Azure Virtual Machine from the options. 
![Select Azure Virtual Machine](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jvp0e6wg4ligkjv7cuvn.png)

Under project details for resource group  click on  Create New and give it a name (make it a special name or name of a project)
![Create New](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0p7uh9hinr91pzg4dk3k.png)

Under the Instance details give your virtual machine a name of your choice.
![name of your choice](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j9ns0pvk1b8nf24ns6ca.png)

Select a region of your choice 
![region ](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nkox95522esa5ntmd4qt.png)

Select the availability zones (this is dependent on how highly available you want the virtual machine to be you can choose zone1 and zone2 if you want the VM to be highly available and you can choose zone1,zone2 and zone3 if you want your VM to be very highly available its all dependent on your budget, the higher the availability the higher the cost)
![availability zones](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n9hinvycfyfrenuwsoyf.png)

Because you are creating a Linux VM for image you will select Window Server 
![select Window Server ](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/agxgh8lxm3mvj8z0csph.png)

Leave every other things at default then go to Administrator Account and Create a User Name and  Password of your choice 
![Create a User Name and  Password](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9a3fgfnxvc8t5733cpfh.png)

Under select inbound port SELECT HTTP   this will enable us to view our virtual machine as a web page. 
![ SELECT HTTP](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j1p7eksauwur4tl78zjg.png)

Select Licencing 
![Select Licencing](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kq76hzxikgazug0hhyri.png)

Click on the Monitoring tab and disable boot diagnostic  
![disable boot diagnostic ](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uaopdkgcft0b7vrg2kgo.png)

Then click on tags tab and tag the VM by putting your name or company name. 
![click on tags ](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o2i9lyuy9yvpi8kxi62l.png)

Click on create and Review wait for it to validate or show green. 
![create and Review](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i4jjo46sl3th86oxetet.png)

Once Validation is passed Select Create 
![Validation is passed](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tr3tv4bkkct8p8qbbblh.png)

Once the deployment is complete, click on Go to Resource 
![deployment is complete](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/91h67zq96z0p9lv6kdwu.png)

Click connect to connect to the VM 
![connect](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p4sa0v5ej7i5dk2i9480.png)

Click on Select on the Native RDP Local Machine 
![Select on the Native RDP](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hpx23m0udfz2kps64wd1.png)


It will pop up on the right, wait for it to validate and show configured then download the RDP file 
![configured](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u248c89autgltof7l3ya.png)

When it has finished downloading then you click on the downloaded file then click connect NB! If you are using a MAC book you need to download and install Microsoft Remote Desktop App 
![click connectn](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sjnpsihy943881wr2xu8.png)
 
Enter the Password we created during Administrator Settings 
![ Password](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/oujxu8x1vz7sqfikqg4g.png)

Click on Yes 
![Click on Yes ](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qchnfee14t1m0p6phdv7.png)

Our Window Server2019 data center edition is ready  
![Window Server2019 ](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/liv8mctaqmgcz2lgrpir.png)

Click on the Start menu.
Type PowerShell and open Windows PowerShell or Windows PowerShell ISE as an administrator (right-click and select Run as administrator). 
![PowerShell](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2a2mtlfnv3058ezfav0o.png)

Install IIS:

Run the following command to install the IIS role and management tools:
Install-WindowsFeature -name Web-Server –IncludeManagementTools  (you can copy and paste the command) 
![Install-WindowsFeature](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sa5ofzkm31e9qzughwdn.png)

This is what you get if the command installs successfully  (it shows that something has been installed on the window web server)
![command installs successfully](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4lwoud5v4ilz79c6zeou.png)

 


Verify Installation:
You can verify that IIS has been installed by opening a web browser and navigating to http://localhost. You should see the default IIS welcome page.
or Just paste the ip address of the VM in a browser and verifiy that you installed the webserver.

Click on iP address on the Azure page 
![Click on iP](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/22cyov4xzoarq8c1zsvt.png)

Paste it to browser to know if you have installed a Web Server or not. 

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

As you can see from the browser that we have successfully installed a web server