{
  "schemaVersion": "ebb.rule.v1",
  "id": "serverless.azure-app-service.php-8-1",
  "ecosystem": "serverless",
  "purl": "pkg:generic/azure-app-service/php",
  "affectedVersions": "vers:semver/>=8.1.0|<8.2.0",
  "event": "end-of-life",
  "severity": "high",
  "title": "App Service PHP 8.1 stack is past end of life",
  "summary": "Azure App Service follows the community support timeline for each language stack: past the end-of-support date the app keeps running, but the platform stops providing security patches or related support for that runtime version. php.net lists PHP 8.1 as end-of-life since 2025-12-31, so a PHP|8.1 app no longer receives a patched runtime.",
  "replacement": "App Service PHP 8.3 or later",
  "deadline": "2025-12-31",
  "sources": [
    {
      "title": "Language Runtime Support Policy - Azure App Service",
      "url": "https://learn.microsoft.com/en-us/azure/app-service/language-support-policy",
      "accessedAt": "2026-11-03"
    },
    {
      "title": "PHP: End-of-Life Versions",
      "url": "https://www.php.net/eol.php",
      "accessedAt": "2026-11-03"
    }
  ],
  "provenance": {
    "observedAt": "2026-11-03",
    "reviewedAt": "2026-11-03",
    "reviewer": "arminazimi"
  },
  "migration": {
    "constraints": [
      "App Service follows the community end-of-support date for each language stack and stops providing security patches and related support for that runtime version past the date.",
      "The platform controls the minor and patch version of a managed stack, so raising the stack version is the only way to get a patched runtime.",
      "The stack is declared in siteConfig.linuxFxVersion on Linux and siteConfig.windowsFxVersion on Windows; both are set with az webapp config set."
    ],
    "steps": [
      {
        "id": "raise-app-service-stack",
        "title": "Raise the App Service language stack",
        "instructions": "Set php to a supported stack version (see the replacement) with az webapp config set --linux-fx-version or --windows-fx-version, then redeploy the app.",
        "targets": "all"
      },
      {
        "id": "align-stack-declaration",
        "title": "Align the stack declaration",
        "instructions": "Change the same stack in the deployment source too - the siteConfig resource in an Azure Resource Manager template, the azurerm_linux_web_app linux_fx_version or azurerm_windows_web_app windows_fx_version in Terraform, and the Bicep equivalent - so the next deployment does not reset php.",
        "targets": "declaration"
      }
    ],
    "verification": [
      {
        "command": "az webapp config show --resource-group <group> --name <app> --query linuxFxVersion",
        "purpose": "Confirm the app reports the new stack version."
      },
      {
        "command": "az webapp restart --resource-group <group> --name <app> && az webapp log tail --resource-group <group> --name <app>",
        "purpose": "Restart the app and watch the startup log for runtime errors on the new stack."
      }
    ]
  }
}
