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:
I have to clean up unused resources and I have to search per resource name.
has_any
is currently not supported.Resources
| where type == 'microsoft.sql/servers/databases'
// | where name has_cs "old" or name has_cs "dev" or name has_cs "test"
| parse-where kind=regex name with ".*[._]" suffix
| where suffix in ("old", "dev", "test")