Question 40 — AZ-104 Case Study Set
Review the effect portion of Paideffort's policy and its defined parameters.
"parameters": {
"listOfAllowedLocations": {
"type": "Array",
"metadata": {
"displayName": "Allowed locations",
"strongType": "location"
}
}
},
"policyRule": {
"if": {
"allOf": [
{
"field": "location",
"notIn": "[parameters('listOfAllowedLocations')]"
},
{
"field": "location",
"notEquals": "global"
}
]
},
"then": {
"effect": "[parameters('policyEffect')]"
}
}
Paideffort wants the same definition to support audit-oriented validation and deny enforcement through assignment-specific configuration. What should be added? (Select one answer)
Define a
policyEffectparameter with appropriate allowed values such asauditanddeny, then supply the required value at assignment time.Replace the effect expression with
disabledbecause assignments can convert a disabled policy automatically into audit or deny behavior.Move the effect value into metadata because assignment parameters can overwrite metadata properties during policy evaluation.
Define
policyEffectas a policy output so the assignment can determine the effect after compliance evaluation finishes.
Correct answers
Define a
policyEffectparameter with appropriate allowed values such asauditanddeny, then supply the required value at assignment time.
Explanations
Correct Answer:
Define a policyEffect parameter with appropriate allowed values such as audit and deny, then supply the required value at assignment time.
Explanation:
The policy rule references parameters('policyEffect'), but Paideffort's parameters object does not define that parameter. Defining it with constrained effect values makes the definition valid for the intended reusable assignment model and allows different assignments to select audit or deny behavior.
Wrong Answers:
Replace the effect expression with disabled because assignments can convert a disabled policy automatically into audit or deny behavior.
A disabled effect deactivates the policy. It does not act as a dynamic placeholder that automatically becomes audit or deny.
Move the effect value into metadata because assignment parameters can overwrite metadata properties during policy evaluation.
Metadata describes the policy definition. It is not the mechanism for supplying assignment-specific policy-rule values.
Define policyEffect as a policy output so the assignment can determine the effect after compliance evaluation finishes.
Azure Policy definitions use rule conditions and effects rather than ARM-style outputs for selecting enforcement behavior.