Skip to content

Azure custom Policy definition to deny VNET Subnet size and address space with same size

Notifications You must be signed in to change notification settings

PieterbasNagengast/AzurePolicy-DenyEqualSubnetSizeAndAddressSpace

Repository files navigation

bicepBuild

Azure Policy: Deny VNETs that have equal subnet and address space size

Description

Deny VNETs that have equal subnet and address space size. Compares if any subnet size matches any addres space on VNET.

Background/Use case

Used in scenraio's where you want to deny the creation of VNETs that have a equal Subnet size and Address space. Example: Landing-zone VNETs have all /24 address spaces and you don't want to the creation of /24 subnets. If this policy is assigned:

  • Creation of VNETs with equal Address space and Subnet size is denied
  • Creation of smaller subnets is allowed
  • Works Creating new VNET's

NOTE: This policy allows the creation of subnets to existing VNET's with equal Address space and Subnet size. VNET will be marked as non-compliant in Azure Policy dash.

Deploy

  1. Deploy Policy to Management Group or Subscription level.
  2. Assign policy
Description Bicep Template
Deploy to Azure Management Group Deploy to Azure
Deploy to Azure Subscription Deploy to Azure

About

Azure custom Policy definition to deny VNET Subnet size and address space with same size

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages