Gallery › Mission › Azure built-in policies
Do not allow delete on App Service slot network configuration
Converted Policy DenyAction Disabled Mode All Version 1.0.0
This policy applies exclusively to Mission Platform products and services; usage outside of these scopes is not supported. App Slots network configuration should not be deleted.
ConvertTo-Bylaw converted this policy, and proved that the file compiles back to the same definition.
Azure Policy JSONAppSlotDenyNetDelete_DenyAction.json · 46 lines
{
"properties": {
"displayName": "Do not allow delete on App Service slot network configuration",
"policyType": "BuiltIn",
"mode": "All",
"description": "This policy applies exclusively to Mission Platform products and services; usage outside of these scopes is not supported. App Slots network configuration should not be deleted.",
"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": [
"DenyAction",
"Disabled"
],
"defaultValue": "DenyAction"
}
},
"policyRule": {
"if": {
"field": "type",
"equals": "Microsoft.Web/sites/slots/networkConfig"
},
"then": {
"effect": "[parameters('effect')]",
"details": {
"actionNames": [
"delete"
]
}
}
},
"versions": [
"1.0.0"
]
},
"id": "/providers/Microsoft.Authorization/policyDefinitions/d349a603-3f16-4a04-88ac-9db1ca4013d1",
"name": "d349a603-3f16-4a04-88ac-9db1ca4013d1"
}Bylawd349a603-3f16-4a04-88ac-9db1ca4013d1.bylaw.ps1 · 23 lines
# Converted from AppSlotDenyNetDelete_DenyAction.json by ConvertTo-Bylaw.
Policy 'd349a603-3f16-4a04-88ac-9db1ca4013d1' {
Properties @{
DisplayName = 'Do not allow delete on App Service slot network configuration'
Description = 'This policy applies exclusively to Mission Platform products and services; usage outside of these scopes is not supported. App Slots network configuration should not be deleted.'
Version = '1.0.0'
Category = 'Mission'
PolicyVersion = '1.0.0'
Mode = 'All'
}
Parameter Effect @{
AllowedValues = @('DenyAction', 'Disabled')
Default = 'DenyAction'
DisplayName = 'Effect'
Description = 'Enable or disable the execution of the policy'
}
Resource 'Microsoft.Web/sites/slots/networkConfig'
DenyAction Delete -Effect (Param Effect)
}Source: built-in-policies/policyDefinitions/Mission/AppSlotDenyNetDelete_DenyAction.json in Azure/azure-policy, under the MIT licence.
Bylaw