@BHATT, KANHA Thank you for your email!!!
You can try to run below on Azure CLI which will give information about OS version and other details as well. This will give information about all the VM irrespective of OS in your subscription
az vm list --query '[].{ offer:storageProfile.imageReference.offer,publisher:storageProfile.imageReference.publisher, sku:storageProfile.imageReference.sku,version:storageProfile.imageReference.version}' -o json | ConvertFrom-Json | export-csv -Path E:\test.csv -NoTypeInformation
Output will look something like below in csv file:
Hope it helps!!!
Please "Accept as Answer" if it helped so it can help others in community looking for help on similar topics.