Gallery › Mission › Azure built-in policies
App Service apps should enable configuration routing to Azure Virtual Network.
Converted Policy Audit Deny Disabled Mode Indexed Version 1.1.0
This policy applies exclusively to Mission Platform products and services; usage outside of these scopes is not supported. App Service apps should enable configuration routing to Azure Virtual Network.
ConvertTo-Bylaw converted this policy, and proved that the file compiles back to the same definition.
Azure Policy JSONAppVnetRouting_Audit.json · 79 lines
{
"properties": {
"displayName": "App Service apps should enable configuration routing to Azure Virtual Network.",
"policyType": "BuiltIn",
"mode": "Indexed",
"description": "This policy applies exclusively to Mission Platform products and services; usage outside of these scopes is not supported. App Service apps should enable configuration routing to Azure Virtual Network.",
"metadata": {
"version": "1.1.0",
"category": "Mission"
},
"version": "1.1.0",
"parameters": {
"effect": {
"type": "String",
"metadata": {
"displayName": "Effect",
"description": "Enable or disable the execution of the policy"
},
"allowedValues": [
"Audit",
"Deny",
"Disabled"
],
"defaultValue": "Audit"
}
},
"policyRule": {
"if": {
"allOf": [
{
"field": "type",
"equals": "Microsoft.Web/sites"
},
{
"exists": "false",
"field": "Microsoft.Web/sites/hostingEnvironmentProfile.id"
},
{
"anyOf": [
{
"allOf": [
{
"field": "Microsoft.Web/sites/vnetImagePullEnabled",
"notEquals": true
},
{
"field": "Microsoft.Web/sites/outboundVnetRouting.imagePullTraffic",
"notEquals": true
}
]
},
{
"allOf": [
{
"field": "Microsoft.Web/sites/vnetContentShareEnabled",
"notEquals": true
},
{
"field": "Microsoft.Web/sites/outboundVnetRouting.contentShareTraffic",
"notEquals": true
}
]
}
]
}
]
},
"then": {
"effect": "[parameters('effect')]"
}
},
"versions": [
"1.1.0",
"1.0.0"
]
},
"id": "/providers/Microsoft.Authorization/policyDefinitions/86b1d4f9-358c-407c-9bb0-52bf287b222f",
"name": "86b1d4f9-358c-407c-9bb0-52bf287b222f"
}Bylaw86b1d4f9-358c-407c-9bb0-52bf287b222f.bylaw.ps1 · 42 lines
# Converted from AppVnetRouting_Audit.json by ConvertTo-Bylaw.
Policy '86b1d4f9-358c-407c-9bb0-52bf287b222f' {
Properties @{
DisplayName = 'App Service apps should enable configuration routing to Azure Virtual Network.'
Description = 'This policy applies exclusively to Mission Platform products and services; usage outside of these scopes is not supported. App Service apps should enable configuration routing to Azure Virtual Network.'
Version = '1.1.0'
Category = 'Mission'
PolicyVersion = '1.1.0'
Mode = 'Indexed'
}
Parameter Effect @{
AllowedValues = @('Audit', 'Deny', 'Disabled')
Default = 'Audit'
DisplayName = 'Effect'
Description = 'Enable or disable the execution of the policy'
}
Resource 'Microsoft.Web/sites' {
When {
Field hostingEnvironmentProfile.id | Must -Not -Exist
}
Require 'vnetImagePullEnabled and outboundVnetRouting.imagePullTraffic are as required' {
AnyOf {
Field vnetImagePullEnabled | Must -Be $true
Field outboundVnetRouting.imagePullTraffic | Must -Be $true
}
}
Require 'vnetContentShareEnabled and outboundVnetRouting.contentShareTraffic are as required' {
AnyOf {
Field vnetContentShareEnabled | Must -Be $true
Field outboundVnetRouting.contentShareTraffic | Must -Be $true
}
}
}
Effect (Param Effect)
}Source: built-in-policies/policyDefinitions/Mission/AppVnetRouting_Audit.json in Azure/azure-policy, under the MIT licence.
Bylaw