Hi Im trying to write up a Policy in Azure to prevent admins to create new app services using any premium_plan and only allow 'standard plans' to be used.
Any help would be great.
App service plan = Standard
Here is what i current have but dont believe it wright:
{
"properties": {
"displayName": "App Service Environment should be provisioned with latest versions",
"policyType": "BuiltIn",
"mode": "Indexed",
"description": "Only allow App Service Environment version 2 or version 3 to be provisioned. Older versions of App Service Environment require manual management of Azure resources and have greater scaling limitations.",
"metadata": {
"version": "1.0.0",
"category": "App Service"
},
"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/hostingEnvironments"
},
{
"field": "kind",
"equals": "ASEV1"
}
]
},
"then": {
"effect": "[parameters('effect')]"
}
},
"versions": [
"1.0.0"
]
},
"id": "/providers/Microsoft.Authorization/policyDefinitions/eb4d34ab-0929-491c-bbf3-61e13da19f9a",
"type": "Microsoft.Authorization/policyDefinitions",
"name": "eb4d34ab-0929-491c-bbf3-61e13da19f9a"
}
Can someone pelase correct the and let me know
This
policy definitionwill deploy. But I am not sure it will do what you want.ASEv1andASEv2is on deprecation path.You might want to just replace the
kindwith this to block v1 and v2.