If I have default value defined at policy level for "effect" parameter, can I overwrite the value at initiative level?

Guo, Jianning 40 Reputation points
2025-06-09T14:02:35.9166667+00:00

I have 'effect' value set as 'deny' at initiative level, which should overwrite policy level default value 'audit'. But it does not. The "effect" is a parameter in the policy. Any suggestion what could be the issue?

Azure Policy
Azure Policy
An Azure service that is used to implement corporate governance and standards at scale for Azure resources.
1,015 questions
0 comments No comments
{count} votes

Accepted answer
  1. Ashok Gandhi Kotnana 10,115 Reputation points Microsoft External Staff Moderator
    2025-06-09T15:02:02.5566667+00:00

    @Guo, Jianning

    Even though you’re setting "effect": "deny" in the initiative definition, if the policy definition itself doesn't allow the effect parameter to be overridden, your initiative-level value will be ignored, and the default (audit) will apply.

     The policy doesn’t define effect as a parameter Check your policy definition (.json). You must explicitly declare "effect" as a parameter:

    "parameters": {
      "effect": {
        "type": "string",
        "allowedValues": [
          "Audit",
          "Deny",
          "Disabled"
        ],
        "defaultValue": "Audit",
        "metadata": {
          "description": "Effect of the policy"
        }
      }
    }
    

    If it’s not a parameter, the initiative can’t override it.

    The initiative isn’t correctly assigning the parameter Ensure your initiative definition includes the parameters block and correctly assigns the new value to the policy reference:

    "policyDefinitions": [
      {
        "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/xxxx",
        "parameters": {
          "effect": {
            "value": "Deny"
          }
        }
      }
    ]
    

    Example:

     Policy Definition with parameter block

    User's image

    Initiative Definition with default value: Deny

    User's image

    Test Results:

    When Effect is Deny

    User's image

    Hope this helps!

    let us know if any help, we will always help as you needed.!

    User's image

    Please do not forget to "Accept the answer” and upvote it wherever the information provided helps you, this can be beneficial to other community members.it would be greatly appreciated and helpful to others.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.