Skip to content

Instantly share code, notes, and snippets.

@andrewmatveychuk
Last active May 12, 2023 13:25
Show Gist options
  • Save andrewmatveychuk/177625cfc131e4982335cd24a24ca925 to your computer and use it in GitHub Desktop.
Save andrewmatveychuk/177625cfc131e4982335cd24a24ca925 to your computer and use it in GitHub Desktop.
Sample Azure Policy rule to match the URL pattern
"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