A financial services firm, FinSecure Corp, is designing an Azure governance framework for its production subscriptions. The security team establishes two compliance mandates:
1. Prevent the deployment of any virtual machines that have public IP addresses directly associated with their network interfaces.
2. Ensure that all newly deployed virtual networks are automatically configured with diagnostic settings that send all network metrics to a central Log Analytics workspace.
You need to recommend the appropriate Azure Policy effects to satisfy these mandates with the least administrative effort.
Which two policy effects should you recommend?
- The DeployIfNotExists effect for the virtual network diagnostic settings mandateAnswer
- The Deny effect for the virtual machine public IP mandateAnswer
- CThe Deny effect for the virtual network diagnostic settings mandate
- DThe Audit effect for the virtual machine public IP mandate
Answer
DeployIfNotExists for the virtual network diagnostic settings mandate, and Deny for the virtual machine public IP mandate.
The correct options are DeployIfNotExists for the virtual network diagnostics mandate and Deny for the virtual machine public IP mandate. The Deny effect blocks the creation of resources that violate policy definitions, making it ideal for preventing public IP association on virtual machines. The DeployIfNotExists effect evaluates the resource configuration and automatically deploys secondary resources (such as diagnostic settings linked to a Log Analytics workspace) if they are missing, ensuring automated governance without blocking primary resource deployment.
Step-by-Step Solution
Key Concept
Azure Policy effects determine how resources are evaluated and governed, using Deny to block non-compliant resources and DeployIfNotExists to automate secondary resource creation.