I'm using Bicep, but I understand the older ARM JSON syntax enough to adapt a solution if someone knows one but not the other. Anyway, I can easily tell if a parameter value is an empty string by just doing this inside of one of my policyRule objects:
policyRule: {
if: {
{
field: '[concat(\'tags[\', parameters(\'tagName\'), \']\')]'
equals: ''
}
}
...rest of rule and then statement
}
or testing existence with exists: false
But how would I check if the value is just a bunch of whitespaces like " "
? I tried modifying the field: value to be this:
[trim(concat(\'tags[\', parameters(\'tagName\'), \']\'))]
But it doesn't appear to work. I can still enter a bunch of spaces and have it pass verification.