Created
May 14, 2023 15:58
-
-
Save andrewmatveychuk/7d8f587b20008d4432321caf8218f198 to your computer and use it in GitHub Desktop.
Sample Azure Policy rule to match the Email pattern
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"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