{
  "slug": "azd-hooks-run-supports-per-layer-hooks-32dfc7115981",
  "title": "azd hooks run supports per-layer hooks",
  "tools": [
    "azd"
  ],
  "tags": [
    "agent"
  ],
  "introduced_at": "2026-04-04T06:20:12.000Z",
  "announced_at": "2026-04-04T06:20:12.000Z",
  "effective_at": null,
  "date_basis": "source-publication",
  "status": "unknown",
  "how": {
    "incantation": "When a project defines infrastructure layers, put the hook under `infra.layers[].hooks` in `azure.yaml` to run it during `azd provision`. To run a named hook for one layer, use `azd hooks run <hook-name> --layer <layer-name>`.",
    "examples": [
      "azd hooks run <hook-name> --layer <layer-name>",
      "infra:\n  layers:\n    - name: <layer-name>\n      path: <infra-path>\n      hooks:\n        postprovision:\n          shell: sh\n          run: <script-path>"
    ],
    "gotchas": [
      "Version: 1.23.14",
      "<hook-name> (required): Name of the hook to run.",
      "--layer <layer-name>: Restricts execution to the specified provisioning layer.",
      "infra.layers[].name (required): Name of the provisioning layer.",
      "infra.layers[].path (required): Path to the layer's IaC templates.",
      "infra.layers[].hooks.<event>: Hook definition for a lifecycle event, such as `postprovision`; hook definitions support `run` and optional `shell`.",
      "Prerequisite: Install `azd`. The docs specify no additional prerequisite for layer hooks or `azd hooks run --layer`."
    ]
  },
  "why_it_matters": "Run hooks for a specific infrastructure layer or configure hooks to run during provisioning.",
  "sources": [
    "https://github.com/Azure/azure-dev/releases/tag/azure-dev-cli_1.23.14",
    "https://learn.microsoft.com/en-us/azure/developer/azure-developer-cli/reference",
    "https://learn.microsoft.com/en-us/azure/developer/azure-developer-cli/layered-provisioning",
    "https://learn.microsoft.com/en-us/azure/developer/azure-developer-cli/azd-schema"
  ],
  "rank": 0.97026,
  "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-397232f60f64381d-1:gate",
    "evidence_hash": "c9a0a213eb5fc13859189d781fa66c516753edadfca461d6121762cb26282382"
  },
  "review": {
    "draft_hash": "6afc3905c2f6459573ae3dfc3c086aefa9374ff429d2ed0238ece0c5cf629ada",
    "reviewer": "publication-gate",
    "reviewed_at": "2026-10-07T00:00:00.000Z",
    "decision": "wave2a-20261017:gate",
    "reason": "3 of 3 judge runs approved with p_yes >= 0.9 (mean 0.97 >= 0.9; 2 needed) and Jev gave 0.74 (>= 0.6 needed)."
  }
}
