Kusto query for checking that certain tag does NOT exist

Viewed 1167

I'm building a Kusto query for Azure Resource Graph that will return me all items for which a specific tag does NOT exist. What would be the query for checking this?

2 Answers

It depends on how the tags are represented in the table's schema.

  • If they are all in a single string (separated by one or more characters), then use where Tags !has "UnwantedTag"
  • If they are stored in a dynamic column, then use where set_has_element(Tags, "UnwantedTag") == false

found the solution: if we want it to have the tag '| where tags contains' if we don't want it to have the tag '| where tags !contains'

Related