Created
December 19, 2022 15:31
-
-
Save andrewmatveychuk/02fc8cedf53e98730b02da8e98853f7b to your computer and use it in GitHub Desktop.
Defining Azure Policy effect as a parameter
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
//... | |
"parameters": { | |
"effect": { | |
"type": "String", | |
"metadata": { | |
"displayName": "Effect", | |
"description": "Enable or disable the execution of the policy" | |
}, | |
"allowedValues": [ | |
"Audit", | |
"Deny", | |
"Disabled" | |
], | |
"defaultValue": "Audit" | |
} | |
}, | |
//... | |
// Other policy properties | |
//... | |
"policyRule": { | |
"if": { | |
// Rule conditions | |
}, | |
"then": { | |
"effect": "[[parameters('effect')]" | |
} | |
} | |
//... |
Hi @OlegMudryak!
Try refreshing the portal page or do a complete logoff/logon. It might be a caching issue in your browser.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello!
I have used this approach and override effect during assignment a policy (from default audit to deny) but see weirdness behavior - I see in assignment "Audit" (that should be Deny) and in fact it's Deny.
Have you faced with that? is it my misunderstanding or Azure's bug?