Hello people, Is there any Kusto query to get the OS disk type of all VMs, if it is a standard HDD or premium ? Please help.
Thanks for reaching out! To get the OS disk type of all VMs (if it is a standard HDD or premium), I believe the better way is using Azure Resource Graph because it is the one that helps to explore all of your cloud resources and more effectively manage your cloud inventory. So I recommend to go to Resource Graph Explorer from your Azure Portal and run kusto query something like shown below.
resources | where type == "microsoft.compute/virtualmachines" | extend OSDiskStorageAccountType = tostring(properties.['storageProfile'].osDisk.managedDisk.storageAccountType)
Or you may even leverage Az PowerShell cmdlet Get-AzVM and get the OS disk type of all VMs (if it is a standard HDD or premium) by below command.
(Get-AzVM).StorageProfile.OsDisk.ManagedDisk|Select StorageAccountType, Id
3 people are following this question.