How to configure a Disk on a virtual machine from Azure Cloud and Install windows features using PowerShell.
Published: 2024-06-09 12:13:37

**Step 1: Login to Azure portal **

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

**_Click on virtual machines and create _**

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

_**_**Step 2:  
a.	Select the Azure subscription, 
b.	Create or select a unique resource group. 
c.	Create Virtual machine name
d.	Select a region, if you require available options, select any but for this we need no redundancy.
e.	Select Windows 10pro or any you wish 
f.	Create admin details (username and password) 
g.	Select port, RDP, HTTP because we will need to communicate to them
h.	Mark licensing **_**_


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6r4ddymahdnbc6bioon7.png)

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

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

**_Step 3 : Check the Disk information, ensure you select image default or choose anyone you wish 
Better you leave it as default and click review and create_**

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2n5bz67y5gzvyikgohmz.png)

_Once Validation is passed as shown below “Click create” 
_

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

_Once Deployment is completed, ‘Go to resource” _

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

**_Step 4: On the Virtual machine page , search for ‘Disk” under settings_**

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

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

_Give the Disk a name, and choose the size you desire, leave the remaining as default _
_Back to the VM overview page., connect the VM and select “Native RDP” _

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wwbbcatf38qm0qfw0hmj.png)
_
Wait for the Public address to get configured and Download RDP file _

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/30q48twq9g4xrb2c9jtb.png)

**_Step 5: Connect to the VM on your local computer.
On your computer, Connect the Virtual Machine, this is how it will look below _**

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

_Insert your admin details._

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

_Leave the rest information as default, click yes _

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

**_Step 6: Search for ‘Disk Management’ on your VM and an Initialize window will pop up, leave everything as default and select ok _**

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mvlnrsz71co1l4j8fj63.png)
_
On the Disk2 tab , right click anywhere on it and select “ New simple volume” _


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

_Continue selecting the default options and click finish, until the Disk 2 is partitioned _


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


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

**_Congratulations you have partitioned your Disk on your VM. _**

**_Step 7: Lets install windows features on the VM through PowerShell. 

Open PowerShell on your VM and ensure it is in “the name of your VM” 
_**

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

**_Now enter this command “ Enable-WindowsOptionalFeature -Online -FeatureName IIS-WebServerRole”, click enter._**


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


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

**_Once it is done. CONGRATULATIONS, YOU HAVE INSTALLED WINDOWS FEATURES AND MANAGEMENT TOOLS._**


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

_Now let’s confirm this by copying the IP address of the VM and paste it into our browser._ 

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

**_CONGRATULATION, BELOW PAGE CONFIRMS YOU HAVE ATTACHED A DISK TO YOUR VM AND HAVE SUCCESSFULLY INSTALLED WINDOWS FEATURES. _**


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