Last active
May 12, 2023 13:25
-
-
Save andrewmatveychuk/177625cfc131e4982335cd24a24ca925 to your computer and use it in GitHub Desktop.
Sample Azure Policy rule to match the URL 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, 'documentation' as the tag name | |
"notLike": "https://wiki.contoso.com/*" // To match the URL pattern to an internal Wiki | |
// The 'notLike'operator doesn't support multiple wildcards, so 'https://*.contoso.com/*' won't work. | |
// If your internal documentation is spread across different sources, then use 'https://*' as a pattern or provide a few possible patterns using logical operators | |
}, | |
"then": { | |
// Some policy effect... | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment