Gallery › App Service › Azure built-in policies
[Deprecated]: App Service should disable public network access
Converted Policy Audit Disabled Mode Indexed Version 1.0.0-deprecated Deprecated
Disabling public network access improves security by ensuring that the app service is not exposed on the public internet. Creating private endpoints can limit exposure of the app service. Learn more at: https://aka.ms/app-service-private-endpoint.
ConvertTo-Bylaw converted this policy, and proved that the file compiles back to the same definition.
Azure Policy JSONApp_PrivateEndpoint_Audit_Deprecated.json · 50 lines
{
"properties": {
"displayName": "[Deprecated]: App Service should disable public network access",
"policyType": "BuiltIn",
"mode": "Indexed",
"description": "Disabling public network access improves security by ensuring that the app service is not exposed on the public internet. Creating private endpoints can limit exposure of the app service. Learn more at: https://aka.ms/app-service-private-endpoint.",
"metadata": {
"version": "1.0.0-deprecated",
"category": "App Service",
"deprecated": true
},
"version": "1.0.0",
"parameters": {
"effect": {
"type": "string",
"defaultValue": "Audit",
"allowedValues": [
"Audit",
"Disabled"
],
"metadata": {
"displayName": "Effect",
"description": "Enable or disable the execution of the policy"
}
}
},
"policyRule": {
"if": {
"allOf": [
{
"field": "type",
"equals": "Microsoft.Web/sites/config"
},
{
"field": "Microsoft.Web/sites/config/PublicNetworkAccess",
"notEquals": "Disabled"
}
]
},
"then": {
"effect": "[parameters('effect')]"
}
},
"versions": [
"1.0.0"
]
},
"id": "/providers/Microsoft.Authorization/policyDefinitions/d79ab062-dffd-4318-8344-f70de714c0bc",
"name": "d79ab062-dffd-4318-8344-f70de714c0bc"
}Bylawd79ab062-dffd-4318-8344-f70de714c0bc.bylaw.ps1 · 30 lines
# Converted from App_PrivateEndpoint_Audit_Deprecated.json by ConvertTo-Bylaw.
Policy 'd79ab062-dffd-4318-8344-f70de714c0bc' {
Properties @{
DisplayName = '[Deprecated]: App Service should disable public network access'
Description = 'Disabling public network access improves security by ensuring that the app service is not exposed on the public internet. Creating private endpoints can limit exposure of the app service. Learn more at: https://aka.ms/app-service-private-endpoint.'
Version = '1.0.0-deprecated'
Category = 'App Service'
Deprecated = $true
PolicyVersion = '1.0.0'
Mode = 'Indexed'
}
Parameter Effect @{
Type = 'string'
AllowedValues = @('Audit', 'Disabled')
Default = 'Audit'
DisplayName = 'Effect'
Description = 'Enable or disable the execution of the policy'
}
Resource 'Microsoft.Web/sites/config' {
Require 'publicNetworkAccess is Disabled' {
Field publicNetworkAccess | Must -Be 'Disabled'
}
}
Effect (Param Effect)
}Source: built-in-policies/policyDefinitions/App Service/App_PrivateEndpoint_Audit_Deprecated.json in Azure/azure-policy, under the MIT licence.
Bylaw