Expose Microsoft.Network/virtualNetworks/subnets/resourceNavigationLinks/linkedResourceType for NSG Deployment Policy
Scenario
We need to ensure that all ASEs created have a specific NSG applied to them. We want to use a deployIfNotExists policy to achieve this. This should be exposed in all clouds, in both Public and Government Clouds.
Alias
The property we would need to expose is Microsoft.Network/virtualNetworks/subnets/resourceNavigationLinks/linkedResourceType.
We would check for the value of Microsoft.Web/hostingEnvironments in linkedResourceType. If this is true, then we would deploy a specific NSG.
Example policy definition
This is a sample audit policy for what we are looking to evaluate. { "mode": "all", "policyRule": { "if": { "allOf": [ { "field": "type", "equals": "Microsoft.Network/virtualNetworks/subnets" }, {
"field": "Microsoft.Network/virtualNetworks/subnets/resourceNavigationLinks/linkedResourceType",
"equals": "Microsoft.Web/hostingEnvironments"
}
]
},
"then": {
"effect": "audit"
}
}
}
Full set of aliases for Microsoft.Networks/virtualNetworks/subnets (including resourceNavigationLinks/linkedResourceType) has been publised to public cloud and government cloud.