STEPS TO CREATE A WINDOWS VIRTUAL MACHINE, RDP INTO IT, INSTALL A WEB SERVER AND ADD A DATA DISK TO IT USING MacOS
Tags: virtualmachine, azure, tutorial
Published: 2023-05-07 13:04:56

**STEP 1**
a. On your Azure portal, Go on the search bar and search for "Virtual machine".
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ac9srirr5mq30fwm7976.png)

**STEP 2**
a. Click on "Create" and in the options given from the search, choose "Azure virtual machine.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gzvefg4ukha3ktduxlc0.png)

**step 3**
a. Under BASICS, fill in the required details.
b. Choose your subscription and choose a resource group or create a new one.
c. Give the virtual machine a name.
d. Choose windows 11 server for your image, change the public key to password.
e. Choose a username and password for your administrators account.
f. Select RDP and HTTP(80) for the inbound port and tick your licensing box.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jmbjs10cfr28pghh6osq.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6901xz4335yye3q9jy24.png)

**STEP 4** 
a. Go to MONITORING, disable Boot diagnostics.
b. Click on review+create 
C. Once validation has passed, click on create
d. After deployment is complete, click on "Go to resource" 
* Your Virtual machine has been created.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uq59ne8qjwy7kzbf5yzo.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rnrle90p7o9w80danu0d.png)

**STEP 5**
a. Click on connect

**STEP 6**
a. Choose RDP then click on download to. Download the file.
b. Click on the file you just downloaded to open it.
c. Type in the username and password you used to register your administrators account in Step 3.
d. Click on continue. Once this is done, your virtual machine has been created and connected.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vgowcon2iv79ujnv1jbz.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e7fqzaqn69qnqlltkbss.png)

**STEP 7** Notice how your vm interphase is different  from your systems interphase.

a. On the vm you just created, go on the search bar and type in POWER SHELL, then choose "windows powershell app" from the options to install it.![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3whmpnvkdqj41b3jdth8.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/f4h2z387eiv8jc06sq84.png)

**STEP 8** 
a. Once the powershell has loaded, type in the command Install-WindowsFeature Web-Server 
b Click on ENTER to install the web server role. Your web server has been successfully installed.
* To test your web server,Go back to your Azure portal, click on OVERVIEW
b. Copy the public ip address, paste it on your system browser and hit enter to see if the web server is running.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dnh64g1hs2sc9vtcmkoj.png)

**STEP 9**
a. Go back to your azure portal page
b Click on Disks
c. Click on "create and attach a new disk"
d. Give the Data disk a name also change the size to a higher Gb
e. Click on "save"

**STEP 10**
a. Go back to that virtual machine you created so you can format the new disk you just created.
b. Search for Disk on the search bar 
c. Choose "create and format hard disk partitions" from the options given.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g3wmdjtbp4vxfbypjedw.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dc3l7dl6you87ur6yhvu.png)

**STEP 11**
a. A pop-up "initialize the Disk" will show, click on OK
b. Scroll down to Disk 2. 
* Disk 1 is a default disk in a new vm.
c. Click on it, then click on "New Simple Volume" from the options  given.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ee9hhry9ox10h0mkx27y.png)

**STEP 12**
a. Follow through with all the defaults for the next few pages by clicking on "NEXT"
b. Once you reach the "Format partition" page, change the "volume label" to the name you gave your datadisk earlier in step 9
c. Click on "next
d. Click on "finish
* Your Data disk has been added successfully.