An organization manages its cloud resources using an Azure Management Group hierarchy. A management group named CoreServices-MG contains subscriptions used for shared network infrastructure. The security team mandates that all virtual networks deployed within CoreServices-MG must have diagnostic settings configured to send traffic metrics to a central Log Analytics workspace. The deployment of virtual networks must proceed without interruption even if the diagnostic settings are not defined during creation, but the diagnostic settings must be automatically configured immediately after deployment. Which Azure Policy effect should you specify in the policy definition to meet these requirements?
- ADeny
- BModify
- DeployIfNotExistsAnswer
- DAudit
Answer
DeployIfNotExists
The DeployIfNotExists effect is the correct choice because it evaluates a resource during creation or update, and if the resource does not have the specified sub-resource (in this case, diagnostic settings), it automatically deploys the template to create it. This ensures compliance without blocking the deployment of the parent resource.
Step-by-Step Solution
Key Concept
Azure Policy effects determine the action taken when compliance rules are evaluated. DeployIfNotExists is used for automated remediation of missing child or extension resources without blocking parent deployments.
Estimated Time:1m 30s