If you have a list of VMs or you can get a list of possible vms then you might step through that list and search within the ImageReference (in a PowerShell)
"Quick & Dirty"
(get-azvm -name *VMName*).StorageProfile.ImageReference
## or even parts of machine-name are possible
(get-azvm -name *MNam*).StorageProfile.ImageReference
results in:
Publisher : MicrosoftWindowsServer
Offer : WindowsServer
Sku : 2019-Datacenter
Version : latest
ExactVersion : 17763.1282.2006061952
SharedGalleryImageId :
CommunityGalleryImageId :
Id :