Hello Satish B,
Thank you for reaching out to the Microsoft Q&A forum.
When investigated we see you want to take the built-in Azure Policy “Ensure that public network access is disabled in managed disks” and bake it into your Microsoft Accelerator Landing Zone (ALZ) Terraform deployment. Here’s a high-level approach you can follow:
Identify the built-in policy definition You can either look it up in the portal under Policy → Definitions (the built-in name is something like “Disk_PublicNetworkAccess_ShouldBeDisabled”) or use Terraform’s data source:
data "azurerm_policy_definition" "disable_disk_public_network" {
display_name = "Ensure that public network access is disabled in managed disks"
}
Add a policy assignment in your ALZ module The ALZ accelerator exposes a “policy_assignments” variable in the management-group landing zone. In your landing_zone.mgmt_group.tfvars (or wherever you drive your ALZ config), append an entry like this:
policy_assignments = {
disable_disk_public_network = {
display_name = "Disable public network access for managed disks"
description = "Ensure public network access is disabled on all Managed Disks"
policy_definition_id = data.azurerm_policy_definition.disable_disk_public_network.id
enforcement_mode = "Enabled" # or "Default"
parameters = {} # this built-in has no parameters
# scope = var.management_group_id # defaults to the MG this landing zone targets
}
}
Run Terraform
cd landingzones/mgmtgroup
terraform init
terraform plan -var-file=landing_zone.mgmt_group.tfvars
terraform apply -var-file=landing_zone.mgmt_group.tfvars
That will push the new assignment into your management group (and down to all subscriptions under it).
Verify
-
- Allow ~15–30 minutes for Azure Policy to propagate.
- In the portal, go to Policy → Assignments and look for your new “Disable public network access for managed disks” assignment under the target scope.
- Check the Compliance tab to confirm no new “Allowed resources” are found with public endpoints.
Reference list
• ALZ Terraform Accelerator GitHub: https://github.com/Azure/alz-terraform-accelerator
• Quickstart: Assign a policy using Terraform: https://learn.microsoft.com/azure/governance/policy/assign-policy-terraform
• Azure Policy concepts & assignment structure: https://learn.microsoft.com/azure/governance/policy/concepts/assignment-structure
Hope this helps! Let me know if you have any follow-ups.