I’m new to KQL and I’m trying to list all Azure SQL Databases with the word "_old" in their name.
My protoquery is this and it works:
// Find "_old" Databases
Resources
| where type =~ 'microsoft.sql/servers/databases'
| where * contains "old"
| project resourceName = name,type,sku.name,sku.tier,tags.createdBy,tags.customerCode,tags.managedBy, resourceGroup, subscriptionId, location
But here the WHERE
clause is bombing everywhere across all columns.
Is there a more fashionable way to search into Azure ideally with more words like:
- _old
- .old
- _test
- .test
- _dev
- .dev
I have to clean up unused resources and I have to search per resource name.
2
Answers
Thank you @PeterBonz, the
name
is what I was missing.My code now works this way:
I also found the clause
has_any
but I couldn't make it work:has_any
is currently not supported.