azure-policy
azure-policy copied to clipboard
Microsoft.Web/sites/config/VnetName
Scenario
I need to create an Azure Policy that audits web sites without associated Virtual Networks. This is to ensure that sites created can be accessed internally only. This needs to be available in Azure Gov as well as Azure Cloud.
Alias
Microsoft.Web/sites/config/VnetName as well as VNet details.
Example policy definition
{ "mode": "all", "policyRule": { "if": { "allOf": [ { "field": "type", "equals": "Microsoft.Web/sites" }, { "anyOf": [ { "field": "Microsoft.Web/sites/config/VnetName", "notlike": "*" } ] } ] }, "then": { "effect": "Audit" } } }
Full set of Microsoft.Web aliases (including this one) has been published to public and government clouds.