I suggest you ...

Azure Policy - Support for RegEx in Match Conditions

Right now, the "Match" and "notMatch" conditions only support # for digit placeholders and ? for letters. This is okay, but it would be much more useful to support regex expressions. This would needed for define complex naming policies and tagging standards.

67 votes
Vote
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    DanM shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

    5 comments

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      Signed in as (Sign out)
      Submitting...
      • Marcio Parente commented  ·   ·  Flag as inappropriate

        I'm trying to apply the following regex expression and no success.
        [a-z0-9]{1,10}mgd-(?:sb|dv|ts|rt)-[a-z0-9]{1,5}-(?:aes|ase|usc|use|use2|usw|uscn|uscs|eun|euw|jpw|jpe|brs|aue|aus|ins|inc|inw|cac|cae|uks|ukw|uscw|usw2|korc|kors|frc|frs)-rg-[0-9]{3}

      • Jan commented  ·   ·  Flag as inappropriate

        One would expect regex when it is named match.
        Current options cannot be used to match our naming standard. At least more complex conditions needed, for example multiple asterisks.
        But why invent something new, when there is a good and relative standard way of doing this (already supported by .net).

      • Steve Keeler commented  ·   ·  Flag as inappropriate

        Please consider implement basic regular expression pattern matching. If ReDoS is a concern, then limit so extensions such as back-tracking not implemented. I have multiple customers requesting this functionality.

      • Nick C commented  ·   ·  Flag as inappropriate

        I second this idea. Either allow more complex conditions, or allow regular expressions. Even allowing two wildcards within a 'like' condition would be enormously helpful. Right now, enforcing naming policy is cumbersome.

      Feedback and Knowledge Base