I am trying to create and attach an unmanaged storage disk to Azure. I am unable to specify the storage account while creating the disk.
vm.update().defineUnmanagedDataDisk(diskLabel)
.withNewVhd(lun)
.withLun(lun)
.withCaching(CachingTypes.NONE)
.attach()
.apply();
As mentioned in this official document:
You can follow the tutorial to upload VHD file to your Storage Account,then use
.storeAt(storageAccount.name(), "diskvhds", "datadisk1vhd.vhd")
to specify the storage account.Please refer to the source code from here.Note that
.storeAt(storageAccount.name(), "diskvhds", "datadisk1vhd.vhd")
means
.storeAt(<your account name>, <container name>, <blob name>)