An organization is designing a governance and compliance strategy for its Azure landing zones. The resource hierarchy consists of a parent Management Group named MG-LandingZones, which contains three subscriptions: Sub-App1, Sub-App2, and Sub-Shared.
You need to design an Azure Policy strategy that meets the following requirements:
1. All Azure Key Vaults deployed within MG-LandingZones must have diagnostic settings configured to send logs to a central Log Analytics workspace. If a Key Vault is deployed without these settings, they must be automatically created without blocking the deployment of the Key Vault itself.
2. Virtual machines deployed in the Sub-Shared subscription must be prevented from using public IP addresses. However, virtual machines deployed in a specific resource group named RG-Edge-Inbound within Sub-Shared must be allowed to have public IP addresses.
Which two Azure Policy configurations should you recommend to meet these requirements?
- Assign an Azure Policy definition with the DeployIfNotExists effect at the MG-LandingZones management group to deploy diagnostic settings on Key Vaults.Answer
- Assign an Azure Policy definition with the Deny effect at the Sub-Shared subscription to block virtual machines with public IP addresses, and configure the RG-Edge-Inbound resource group in the notScopes property of the assignment.Answer
- CAssign an Azure Policy definition with the Deny effect at the MG-LandingZones management group to block the creation of Key Vaults if diagnostic settings are not defined in the deployment request.
- DAssign an Azure Policy definition with the Modify effect at the Sub-Shared subscription to remove public IP address configurations from virtual machines during deployment, and apply a policy exemption to the RG-Edge-Inbound resource group.