Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save andrewmatveychuk/7d8f587b20008d4432321caf8218f198 to your computer and use it in GitHub Desktop.
Save andrewmatveychuk/7d8f587b20008d4432321caf8218f198 to your computer and use it in GitHub Desktop.
Sample Azure Policy rule to match the Email pattern
"policyRule": {
"if": {
"field": "[[concat('tags[', parameters('tagName'), ']')]", // For example, 'owner' as the tag name
"notLike": "*@contoso.com" // To match the corporate email address pattern
// The 'notLike'operator doesn't support multiple wildcards, so '*.*@contoso.com' won't work if you want to use the pattern like 'Name.Surname@contoso.com'.
},
"then": {
// Some policy effect...
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment