DEMO: Creating and Attaching a Data Disk
Start course

This course covers disks, snapshots, and images in Azure. We'll explore the benefits of managed disks and the types of encryption you can use with them, before moving on to look at the different disk types that are available in Microsoft Azure. A guided demo from the Azure portal will show you how to add a data disk to an Azure VM.

We'll then dive into snapshots and images, where you'll learn about disk snapshots, custom images, and the differences between them. We’ll wrap things up with a few demos, where you'll get to see how to restore a VM from a snapshot and how to create a VM from a generalized image.

Learning Objectives

  • Learn about the benefits of managed disks, the different disks available in Azure, and how to add a disk to an Azure VM
  • Learn about snapshots and images and their characteristics
  • Restore a VM from a Snapshot
  • Create a VM from a Generalized Image

Intended Audience

This course is intended for those who wish to learn about disks, snapshots, and images in Microsoft Azure.


To get the most out of this course, you should have some basic knowledge of working with Azure.


Hello and welcome back. In this brief demonstration, I just wanted to walk you through the process of creating and attaching a data disk for a virtual machine in Microsoft Azure through the Azure portal.

Now on the screen here, I'm logged into my Azure portal as an admin, and I'm at my homepage. What I'm going to do is create and attach a disk to an existing virtual machine. So to do that from my homepage, what I'm going to do is select virtual machines here and this will show me I do have a running VM called MyVMO1.

To create and attach a data disk, I simply select my VM here, go into disks, and then from here, I can add a data disk. I'm going to leave the LUN number at its default value. And if I select the drop down here for name, I can see I have some existing disks already that I can choose from. But what I'm going to do is create a disk instead. So we'll select create a disk and we'll just call this DISC1 and I'll leave it in my VMLab resource group.

Now, since I'm attaching to my VM, my location is grayed out because the VM is in Central US. Now, if I select the source type dropdown, I can see I can create my disk from a snapshot, from a storage blob or none. Now, none is what I'll select if I'm creating a brand new empty disk, so we'll leave none selected, and then we can specify the type and size here of our disk.

So we'll click change size here, and I'm going to change this to standard HDD. I'm trying to save on costs here. And then what I can do is select a pre-configured size, or I can create a custom size here. So I'll just create a five gig disk and we'll OK it. And then in the encryption type box here, we have two different options, the default and encryption at rest with a platform managed key or I can do the same with a customer managed key. I'll let the platform manage my key for encryption so I'll leave that at the default and I'll go ahead and create the disk.

Now, once this disk is created, I can attach it to my VM. So we'll let this do its thing here. So now we have a DISC1, it's five gig in size, and then the host caching here, I have a couple different options, read only and read/write. The names are pretty self-explanatory. The none option configures no caching for the disk.

Read-only configures read caching, and the read/write option obviously configures read/write disk caching. I'll leave caching off for this disk. And then what I'll do is save my new disk. Now what it's doing here is updating. And now I can see, I have Disk1 attached to my virtual machine.

Now, I'm not going to get into the formatting of it because it's a pretty straightforward process. When you add a data disk to an existing virtual machine, the process for formatting that disk is no different than if you're on a physical server.

You need to log into the OS, open up disk manager and format that disk. You need to initialize it, partition it, and then format it. I am going to trust that you know how to do that so we're not going to get into formatting a disk. That's pretty basic, that's a pretty basic skill here. So at this point, you now know how to create a data disk into the Azure portal and you know how to attach it to an existing virtual machine.

About the Author
Learning Paths

Tom is a 25+ year veteran of the IT industry, having worked in environments as large as 40k seats and as small as 50 seats. Throughout the course of a long an interesting career, he has built an in-depth skillset that spans numerous IT disciplines. Tom has designed and architected small, large, and global IT solutions.

In addition to the Cloud Platform and Infrastructure MCSE certification, Tom also carries several other Microsoft certifications. His ability to see things from a strategic perspective allows Tom to architect solutions that closely align with business needs.

In his spare time, Tom enjoys camping, fishing, and playing poker.