what about use split
first to get the number section of the tag. then use int
to parse the value and see if value is greater than 0?
something like below. sorry, did not get change to test it out. but probably you can use split
and last
and int
to do it.
{
"value": "[int(last(split(field(concat('tags[', 'tagName', ']')))))]",
"greater": 0
},
refer to:
How do you policy enforce integer number of tag value in Azure
How to enforce naming pattern such as "*-*-asp" using Azure policy?