{
  "slug": "azd-azure-yaml-hooks-support-python-scripts-631e39273e97",
  "title": "azd azure.yaml hooks support Python scripts",
  "tools": [
    "azd"
  ],
  "tags": [
    "agent"
  ],
  "introduced_at": "2026-04-11T02:32:52.000Z",
  "announced_at": "2026-04-11T02:32:52.000Z",
  "effective_at": null,
  "date_basis": "source-publication",
  "status": "unknown",
  "how": {
    "incantation": "When an `azure.yaml` hook runs a `.py` file, `azd` detects Python from the extension and runs the script. If `requirements.txt` or `pyproject.toml` is in the script’s directory or a parent directory, `azd` creates a virtual environment and installs dependencies.",
    "examples": [
      "hooks:\n  preprovision:\n    run: ./hooks/setup.py"
    ],
    "gotchas": [
      "Version: 1.23.15",
      "hooks.<event>.run (required): Inline script or relative script path; `.py` extension enables Python detection.",
      "hooks.<event>.kind: Executor kind; allowed values include `python`. Omit for extension-based detection.",
      "hooks.<event>.config.virtualEnvName: Python virtual environment directory name override.",
      "Prerequisite: Install `azd` and Python 3.x.",
      "Prerequisite: For automatic dependency installation, put `requirements.txt` or `pyproject.toml` in the script directory or a parent directory."
    ]
  },
  "why_it_matters": "Run an `azure.yaml` hook implemented as a Python script in the project.",
  "sources": [
    "https://github.com/Azure/azure-dev/releases/tag/azure-dev-cli_1.23.15",
    "https://learn.microsoft.com/en-us/azure/developer/azure-developer-cli/hooks-multi-language",
    "https://learn.microsoft.com/en-us/azure/developer/azure-developer-cli/azd-schema"
  ],
  "rank": 0.93028,
  "judge": {
    "publish": true,
    "judge_model": "codex-cli/gpt-6-luna+typesafe/jev-1.13.0",
    "prompt_version": "extract-v7+enrich-v2+judge-v2x3+jev-publish-v1"
  },
  "review_state": "approved",
  "provenance": {
    "run_id": "wave2a-20261017",
    "verdict_id": "wave2a-20261017:wave2a-20261017-b29cf4b3be9ce4e7-0:gate",
    "evidence_hash": "4da6fade0f77dee06d0dfb18286f9214674ae7c294b14ec0bcb25e1f7c184ed2"
  },
  "review": {
    "draft_hash": "e20593e921a0b6fd81586642708c65d2a7feb51c404cee46deafa4dc4844415e",
    "reviewer": "publication-gate",
    "reviewed_at": "2026-10-07T00:00:00.000Z",
    "decision": "wave2a-20261017:gate",
    "reason": "2 of 3 judge runs approved with p_yes >= 0.9 (mean 0.93 >= 0.9; 2 needed) and Jev gave 0.67 (>= 0.6 needed)."
  }
}
