Azure Virtual Network Manager uses Azure Policy to automate the application of security and routing rules across many virtual networks at once. You define the rules you want, such as which ports to block or how traffic should be routed, and then assign those rules to logical collections of networks called network groups. This allows you to manage configurations for hundreds of networks spread across different subscriptions and regions from a single place, ensuring consistent security and routing everywhere.
After a policy is assigned, it doesn't just apply to new resources; it also evaluates all existing virtual networks within its scope. You need to validate that the policy has correctly propagated to all the intended networks. Azure provides tools to monitor the compliance state of each network, showing you which ones follow the rules and which ones do not. This ongoing monitoring is crucial for maintaining a secure posture, as it alerts you to any configuration drift or newly created non-compliant resources.
A key feature is the ability to use Conditional statements to define network group membership dynamically. Instead of manually adding each virtual network to a group, you can set a rule, like "all virtual networks with a tag of Environment=Production". Any network that matches this condition is automatically added to the group, and the security and routing policies assigned to that group are instantly applied to it. This makes management flexible and responsive, especially in large, changing environments.
To automate adding networks to groups, you use a specific Azure Policy effect called addToNetworkGroup. You write a custom policy definition that uses this effect. When this policy is assigned, it automatically adds any virtual network that meets the policy's conditions into a specified network group. This bridges the gap between general governance with Azure Policy and the specific network configurations managed by Azure Virtual Network Manager.
For advanced scenarios, you can create Custom policy definitions. These are written in JSON and target specific Azure resource providers, such as Microsoft.Network.Data. This allows you to enforce very precise rules tailored to your organization's needs, going beyond the built-in policy definitions. These custom policies ensure that every virtual network, regardless of how or when it was created, conforms to your required security and operational standards.
Are you a guardian of your domain? Lean how to leverage your aptitude in security to protect Microsoft Azure technologies, with a goal of earning the Microsoft Certified: Azure Security Engineer Associate certification!
Prepare and test your skills

Prepare and test your skills

Azure Virtual Network Manager leverages Azure Policy to automate the application of security and routing rules across many virtual networks at once. You define rules such as which ports to block or how traffic should be routed, then assign those rules to logical network groups, enabling consistent management across subscriptions and regions.
Dynamic network group membership allows you to use conditional statements to define network groups automatically. For example, you can set a rule like "all virtual networks with a tag of Environment=Production", and any matching network is automatically added to the group, instantly applying the assigned security and routing policies.
The addToNetworkGroup effect is a specific Azure Policy effect used to automate adding virtual networks to a specified network group. You write a custom policy definition that uses this effect, and when assigned, it automatically adds any qualifying virtual network to the group, bridging general governance with Azure Virtual Network Manager's network configurations.