Nebula Diagnostics is designing an Azure governance solution. The compliance team mandates that all newly created Azure Virtual Machines must have the Azure Monitor Agent installed. The virtual machine deployment must not be blocked if the agent is missing at the time of creation; instead, the agent must be deployed and configured automatically post-deployment.
Which Azure Policy effect should you recommend to meet these requirements?
- DeployIfNotExistsAnswer
- BModify
- CDeny
- DAudit
Answer
DeployIfNotExists
The DeployIfNotExists effect is the correct choice because it evaluates compliance after a resource is created or updated, and then deploys a template (such as the Azure Monitor Agent extension) if the resource is found to be non-compliant. This ensures that the virtual machine deployment is not blocked and compliance is achieved automatically.
Step-by-Step Solution
Key Concept
Azure Policy Effects for Automated Remediation