I am trying to get all data disks present on VM from Azure Resource Graph Query. I am able to get specific data disk by specifying the index( for example properties.storageProfile.dataDisks[0].name for first disk) but but how do I get this dynamically as some has more than 1 data disks. if VM has 3 disks, is it possible to get details and put it in new column with value as "disk1,disk2,disk3,etc". Using below I am able to extract first disk.
resources
| where ['type'] == 'microsoft.compute/virtualmachines'
| extend DataDiskName = properties.storageProfile.dataDisks[0].name
| extend DataDiskSizeGB = properties.storageProfile.dataDisks[0].diskSizeGB
| extend DataDiskSizeType = properties.storageProfile.dataDisks[0].managedDisk.storageAccountType