Add multiple managed disks to Azure RM VM

Add multiple managed disks to Azure RM VM

In this post I have created a PowerShell script to help add multiple managed disks to an Azure RM Virtual Machine.

The script to add multiple managed disks will prompt you to login to an Azure RM account, then it will query the subscriptions and ask you to select the desired. After that it will query the available VMs and promt to select the target VM from the VM list.

At this point I am checking the OS disk and define the storage type of the data disk. If we need to change the storage type we can check the comments at step 4. e.g. If the OS disk is Premium and you want Standard data disks.

The next step is to ask for disk size. You can check the sizes and billing here:

Finally it will ask for the number of the disk we need to create. After this input the script will create the disks, attach them to the VM and update it.

The Script:

You can download the script from here: AddManagedDisks



  1. Hi ,

    This script is very cool and helps me to add disk multiple disks at one shot. But this script doesn’t work if you wanted to add additional disks later to the same vm. Basically, this won’t add the disk based on free Lun. It would be great if you can add some function to check and add.

Leave a Reply