Policy Compliance error - Current value must not be equal to the target value.

Madhu Rao 40 Reputation points
2024-01-30T01:55:47.7666667+00:00

Hello All, I am deploying a policy to create an NSG rule. The policy does create a new rule, and there are no errors once assigned. But compliance fails with the error below. User's image

I am using the policy from the below link. https://www.azadvertizer.net/azpolicyadvertizer/network_create-nsg-rule.html Why does the Policy state it is non-compliant? Thanks

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

1 answer

Sort by: Most helpful
  1. SwathiDhanwada-MSFT 18,031 Reputation points
    2024-01-30T07:39:13.8133333+00:00

    @Madhu Rao Thanks for reaching out. The compliance reason differs based on the evaluation done on the resources. Here are some articles which can help you to figure out why your policy state is non-compliant.

    1. https://techcommunity.microsoft.com/t5/azure-paas-blog/how-to-debug-unexpected-azure-policy-compliance-status-for-azure/ba-p/2111068
    2. https://learn.microsoft.com/en-us/azure/governance/policy/troubleshoot/general#scenario-compliance-isnt-as-expected

    If you are still facing issue, do revert and comment here. We will assist you accordingly.