Back

Explore Courses Blog Tutorials Interview Questions
0 votes
1 view
in Azure by (13.1k points)
I have an image which consists of OS disk as well it consists of multiple data disks as well, but when I use Azure PowerShell for creating VM using the private image I can able to set name for OS disk but was not able to set the names for data disks. Do anyone have a solution for doing it?

1 Answer

0 votes
by (26.7k points)

You can use the below code or powershell cmdlet for your problem:

Add-AzVMDataDisk -VM $vm -Name %name_goes_here% -Lun $Lun `

    -DiskSizeInGB 127 -CreateOption Empty

I hope this help.

Want to become Azure expert? join azure certification now!!

Related questions

0 votes
1 answer
0 votes
1 answer

Browse Categories

...