I want to list all the tags tied to select VM's (or all if that is easier) in Azure. While the az cli is one option (it works fine), since I have so many of them is there a kql query for this I can use ?
You can use this to list all tags related to a VM.
AzureActivity
| where ResourceProviderValue == "Microsoft.Compute/virtualMachines"
| where ResourceId contains "<VM Resource ID>"
| extend tags = tostring(Properties.Tags)
| project tags
You can also remove the where statement about VM Resource ID to display all tags connected to any VM.