I have Azure policy which refuses to evaluate expression of with error below. I assume the problem is that when you provide tag values in portal they passed as a string to ARM even though integer value is intended passed. Trying to figure out how do I enforce integer value for a tag a result
{
"field": "tags['Longevity']",
"less": 1
}
Error
"The policy assignment 'd9c1d0b06de841559a1cbafe' associated with the policy definition 'dee67dc2-7393-4c02-916f-92511146c970' could not be evaluated.
A 'less' or 'lessOrEquals' or 'greater' or 'greaterOrEquals' expression expects operands of same type for comparison. The supported types are string, integer, float, ISO 8601 datetime. Please either fix the
policy or remove the policy assignment to unblock. See https://aka.ms/policy-conditions for usage details."
Microsoft support provided an answer Answer is below which works as expected. Have to use concat() function looks like to escape complain about square brackets inside square brackets