Gallery › Mission › Azure built-in policies
Webapps should use App Service Environment.
Converted Policy Audit Deny Disabled Mode Indexed Version 1.0.0
This policy applies exclusively to Mission Platform products and services; usage outside of these scopes is not supported. Require the use of App Service Environment for Webapps.
ConvertTo-Bylaw converted this policy, and proved that the file compiles back to the same definition.
Azure Policy JSONASERequiredForWebapps_Audit.json · 50 lines
{
"properties": {
"displayName": "Webapps should use App Service Environment.",
"policyType": "BuiltIn",
"mode": "Indexed",
"description": "This policy applies exclusively to Mission Platform products and services; usage outside of these scopes is not supported. Require the use of App Service Environment for Webapps.",
"metadata": {
"version": "1.0.0",
"category": "Mission"
},
"version": "1.0.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"
}
]
},
"then": {
"effect": "[parameters('effect')]"
}
},
"versions": [
"1.0.0"
]
},
"id": "/providers/Microsoft.Authorization/policyDefinitions/60ada4fc-e576-433c-923b-1f7bd61af33d",
"name": "60ada4fc-e576-433c-923b-1f7bd61af33d"
}Bylaw60ada4fc-e576-433c-923b-1f7bd61af33d.bylaw.ps1 · 28 lines
# Converted from ASERequiredForWebapps_Audit.json by ConvertTo-Bylaw.
Policy '60ada4fc-e576-433c-923b-1f7bd61af33d' {
Properties @{
DisplayName = 'Webapps should use App Service Environment.'
Description = 'This policy applies exclusively to Mission Platform products and services; usage outside of these scopes is not supported. Require the use of App Service Environment for Webapps.'
Version = '1.0.0'
Category = 'Mission'
PolicyVersion = '1.0.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' {
Require 'hostingEnvironmentProfile.id exists' {
Field hostingEnvironmentProfile.id | Must -Exist
}
}
Effect (Param Effect)
}Source: built-in-policies/policyDefinitions/Mission/ASERequiredForWebapps_Audit.json in Azure/azure-policy, under the MIT licence.
Bylaw