Created
January 24, 2019 16:48
-
-
Save smereczynski/c7b248f8a785775cb09c88f0429518dd to your computer and use it in GitHub Desktop.
Policy definition for denying deployments where RG or SA does not have tags values for defined tags keys.
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
{ | |
"if": { | |
"allOf": [ | |
{ | |
"anyOf": [ | |
{ | |
"field": "type", | |
"equals": "Microsoft.Resources/subscriptions/resourceGroups" | |
}, | |
{ | |
"field": "type", | |
"equals": "Microsoft.Storage/storageAccounts" | |
} | |
] | |
}, | |
{ | |
"anyOf": [ | |
{ | |
"field": "tags.env", | |
"exists": false | |
}, | |
{ | |
"field": "tags.bu", | |
"exists": false | |
}, | |
{ | |
"field": "tags.costcenter", | |
"exists": false | |
} | |
] | |
} | |
] | |
}, | |
"then": { | |
"effect": "deny" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment