
A short meaning full of Azure policy easier to understand:
What is Azure policy?
Azure Policy allows you to define rules and guidelines for how your resources should be configured and used within your Azure environment.
We may have cross lot of policy which is cracking our mind about which one we should use, below is the definition for each policy.
There are several policy rules to make your resources complaint, and I have them listed below.
- Deny
- Audit
- Append
- Modify
- Deployifnotexists
Policy - "Deny"
In Azure Policy, the deny effect is used to block or prevent resources from being created or modified if they violate the policy rule defined in the policy definition. When a policy with a deny effect is assigned, any resource that violates the policy rule will be prevented from being created or updated.
For example, suppose you have a policy that prohibits the creation of virtual machines with less than four CPU cores. If a user attempts to create a virtual machine with only two CPU cores, the deny effect will prevent the virtual machine from being created.
The deny effect can be used to enforce compliance and ensure that resources adhere to organizational policies and standards. It can also help prevent security vulnerabilities and ensure that resources are configured correctly.
It's worth noting that the deny effect is more restrictive than the audit effect. While the audit effect only logs policy violations without taking any action, the deny effect prevents the resource from being created or modified.
Policy - "Audit"
In Azure Policy, the "audit effect" determines what happens when a resource violates a policy. When the audit effect is set to "audit", the policy evaluation will only log the non-compliant resources but will not prevent them from being created or modified. This means that the resource can still be deployed or modified, but a log entry will be generated indicating that the resource is non-compliant with the policy.
The "audit" effect is useful for monitoring compliance with policies without enforcing them. It allows organizations to gradually enforce policies, as they can first audit the resources that would be impacted by a policy before applying it with a more restrictive effect like "deny" or "deployIfNotExists".
On the other hand, if the audit effect is set to "deny", resources that violate the policy will be prevented from being created or modified. This effect is useful for enforcing compliance with policies immediately and preventing non-compliant resources from being created.
Overall, the audit effect in Azure Policy provides a way for organizations to monitor and enforce compliance with policies, depending on their specific needs and requirements.
Policy - "Append"
In Azure Policy, the append effect is used to add or modify properties on a resource if they do not already exist or if they are not already set to a specific value. This effect is typically used to ensure that a specific configuration setting or tag is present on a resource.

Prathap ReddyPosted May 7, 2023, 4:52 PM
Nice article bro