How to create and attach a data disk to a windows 11 VM on Azure
Tags: azurefunctions, azure, linux
Published: 2024-04-15 14:44:13

A data disk is a managed disk that's attached to a virtual machine to store application data, or other data you need to keep.

How to go about creating and attaching data disk to a Windows 11 VM on Azure?

Firstly, login to your azure account and create a windows 11 virtual machine following the easy steps:
1 - Click on virtual machine

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

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ewbpjjcqxpvuruq29t5d.png)
Then click on azure virtual machine

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/h6ucvqt29ljbp47m5jd2.png)
3 - Choose your subscription
4 - Create new resource group 
5 - Type your virtual machine name
6 - Choose your region

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bty8js9in0vy8h8bdce2.png)
7 - Choose a particular zone
8 - Choose a security type
9 - Choose an image in this case windows 11 

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/r2ltolntuwv88kw4y5yk.png) 
10 - Choose a size from the drop-down of your choice
11 - Pick a username
12 - Input password
13 - Confirm your password
14 - Click on 'allow selected ports'

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/agnnh01r7g3c1mpvsprf.png)
15 - Choose any port under select inbound ports
16 - Click on box for confirmation

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jt7hlb8l025e1fkec4hu.png)
17 - Click on disks to go to the next page
18 - Choose an OS Disk size
19 - Choose an OS disk type
20 - Click on delete with VM

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9tyj99i3qtpjkef64vwg.png)
_Creating a disk data_
24 - Click on 'Create and attach a new disk'

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xomjzbmp16xpx3oh5gn0.png)
25 - Name your data disk
26 - Choose disk size
27 - Click delete with VM
28 - Click on OK

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cw98zdufftq6rzckrwr6.png)
29 - Go to review and create page
30 - Click on create

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4jyc1wdo1q2wy0nttdx4.png)
Wait until the deploying process is complete...

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ls28zw3surectl27i01w.png)
31 - Once the deployment is complete, click on ' Go to resource'

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p063jnvaz63mbftoubq2.png)
32 - Click on connect

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1fjwdau92hdf10122lhr.png)
33 - Next, click on download RDP file

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xjihs94yqa9d3ktcsxah.png)
34 - open the location of the downloaded file

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/puur9nzm3ot05zdjmpi9.png)
35 - Double click on the downloaded file

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/onngrh9yt39bp5ei3j9z.png)
36 - Click on connect

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9iq5ugujnodhlknvglhe.png)
37 - Enter your password

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

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jjl44e0vj81dncowx59u.png)
39 - Click on next
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ahu28nr9flo0ew78pd3x.png)
40 - Click on accept

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/twe23uoazeywvjh1nas8.png)
41 - Right click on the windows icon on your newly opened windows 11 VM

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qjtl9x9ljm0v32l142y0.png)
42 - Then click on disk management

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3co4bruvrasedb2fsu12.png)
43 - Click on OK

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rn1369dj6gx5glv3vgmj.png)
44 - Scroll down to disk 2, right click on the box and select new simple volume

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yu17odehn37k9nabpakh.png)
45 - Click on next about 3 times on the wizard box

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ptfqkdnzcceerm2r736s.png)
46 - Click on finish

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/eweaftgobk9qgq31fwpt.png)
You will notice a new volume F. That's the newly created data disk as shown in the image below

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pgi7hy7u60dldrxait39.png)
47 - Open your file explorer on your Windows 11 VM, then click on this PC to access the data disk

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cwj28vndxnaibjx9l9wb.png)
You now see the new data disk we've created as shown in the image below

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0pdv7h9vojji2wwdj9m6.png)
To rename your data disk, right click on the new volume F and click show more options

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sqmmmcuoc3z7putqd9vj.png)
And then rename it ... 

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vozh4hfq9wzwdeiw51i8.png)
And there you have it! 
A data disk for storing application data and other forms of data. 

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/m7fkrzaive0d1gjd7e5x.png)
NOTE: In the image above, the disk labelled A is the OS Disk, the disk labelled B is the temporary disk while the one labelled C is called the data disk.

**What though is the difference between the OS disk, Data disk and Temporary disk?**

_OS disk_ - It only contains the OS information including the boot volume. It is not advised to store application information here.

_Data disk_ - A data disk is a managed disk that's attached to a virtual machine to store application data, or other data you need to keep. The size of the virtual machine determines how many data disks you can attach to it and the type of storage you can use to host the disks. 

_Temporary disk_ - The temporary disk provides short-term storage for applications and processes, and is intended to only store data such as page files, swap files, or SQL Server tempdb. Data on the temporary disk may be lost during a maintenance event, when you redeploy a VM, or when you stop the VM. 

To learn more about storage disks, click [here](https://learn.microsoft.com/en-us/azure/virtual-machines/managed-disks-overview).

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

Please drop your comment on this post below. Hope this post has proved helpful to you. Thanks!