last sync: 2020-Sep-25 13:37:27 UTC

Azure Policy

[Deprecated]: Ensure that 'PHP version' is the latest, if used as a part of the Function app

Policy DisplayName [Deprecated]: Ensure that 'PHP version' is the latest, if used as a part of the Function app
Policy Id ab965db2-d2bf-4b64-8b39-c38ec8179461
Policy Category App Service
Policy Description PHP cannot be used with Function apps.
Policy Mode Indexed
Policy Type BuiltIn
Policy in Preview FALSE
Policy Deprecated True
Policy Effect Default: AuditIfNotExists
Allowed: (AuditIfNotExists,Disabled)
Roles used none
Policy Changes
Date/Time (UTC ymd) (i) Change Change detail
2020-09-02 14:03:46 change: DisplayName previous DisplayName: Ensure that 'PHP version' is the latest, if used as a part of the Function app
2019-11-12 19:11:12 add: Policy ab965db2-d2bf-4b64-8b39-c38ec8179461
Used in Policy Initiative(s) none
Policy Rule
{
  "properties": {
  "displayName": "[Deprecated]: Ensure that 'PHP version' is the latest, if used as a part of the Function app",
    "policyType": "BuiltIn",
    "mode": "Indexed",
    "description": "PHP cannot be used with Function apps.",
    "metadata": {
      "version": "1.0.0-deprecated",
      "category": "App Service",
      "deprecated": true
    },
    "parameters": {
      "effect": {
        "type": "String",
        "metadata": {
        "displayName": "[Deprecated]: Effect",
          "description": "Enable or disable the execution of the policy"
        },
        "allowedValues": [
          "AuditIfNotExists",
          "Disabled"
        ],
        "defaultValue": "AuditIfNotExists"
      },
      "PHPLatestVersion": {
        "type": "String",
        "metadata": {
        "displayName": "[Deprecated]: Latest PHP version",
          "description": "Latest supported PHP version for App Services"
        },
        "defaultValue": "7.3"
      }
    },
    "policyRule": {
      "if": {
        "allOf": [
          {
            "field": "type",
            "equals": "Microsoft.Web/sites"
          },
          {
            "field": "kind",
            "like": "functionapp*"
          }
        ]
      },
      "then": {
      "effect": "[parameters('effect')]",
        "details": {
          "type": "Microsoft.Web/sites/config",
          "name": "web",
          "existenceCondition": {
            "anyOf": [
              {
                "allOf": [
                  {
                    "field": "Microsoft.Web/sites/config/web.linuxFxVersion",
                    "notContains": "PHP"
                  },
                  {
                    "field": "Microsoft.Web/sites/config/web.phpVersion",
                    "equals": ""
                  }
                ]
              },
              {
                "allOf": [
                  {
                    "field": "Microsoft.Web/sites/config/web.linuxFxVersion",
                  "equals": "[concat('PHP|', parameters('PHPLatestVersion'))]"
                  },
                  {
                    "field": "Microsoft.Web/sites/config/web.phpVersion",
                    "equals": ""
                  }
                ]
              },
              {
                "allOf": [
                  {
                    "field": "Microsoft.Web/sites/config/web.linuxFxVersion",
                    "equals": ""
                  },
                  {
                    "field": "Microsoft.Web/sites/config/web.phpVersion",
                  "equals": "[parameters('PHPLatestVersion')]"
                  }
                ]
              }
            ]
          }
        }
      }
    }
  },
  "id": "/providers/Microsoft.Authorization/policyDefinitions/ab965db2-d2bf-4b64-8b39-c38ec8179461",
  "type": "Microsoft.Authorization/policyDefinitions",
  "name": "ab965db2-d2bf-4b64-8b39-c38ec8179461"
}