{
  "slug": "azd-azure-yaml-hooks-run-c-net-files-with-dotnet-run-ffb9300e167f",
  "title": "azd azure.yaml hooks run C#/.NET files with dotnet run",
  "tools": [
    "azd"
  ],
  "tags": [
    "agent"
  ],
  "introduced_at": "2026-04-15T21:39:10.000Z",
  "announced_at": "2026-04-15T21:39:10.000Z",
  "effective_at": null,
  "date_basis": "source-publication",
  "status": "unknown",
  "how": {
    "incantation": "When an azd workflow reaches a hook that references a `.cs` file, azd detects the .NET hook and runs it with the .NET SDK. A nearby project file enables project mode; standalone scripts require .NET 10 or later.",
    "examples": [
      "hooks:\n  postprovision:\n    run: ./hooks/migrate.cs\n\nazd up"
    ],
    "gotchas": [
      "Version: 1.24.0",
      "run (required): Inline script or relative script path; `.cs` extension enables .NET detection.",
      "kind: Executor kind. Allowed value `dotnet`; can explicitly select .NET execution.",
      "dir: Hook working directory; relative paths resolve from project or service root. Defaults to the script directory.",
      "config.configuration: MSBuild configuration, such as `Debug` or `Release`.",
      "config.framework: Target framework moniker, such as `net8.0` or `net10.0`.",
      "Prerequisite: Install azd and the .NET SDK.",
      "Prerequisite: Standalone `.cs` scripts require .NET 10 or later. Project mode discovers `.csproj`, `.fsproj`, or `.vbproj` files in the script directory or a parent directory.",
      "Single-file scripts require .NET 10+."
    ]
  },
  "why_it_matters": "Run a C#/.NET hook defined in `azure.yaml` as part of an azd project workflow.",
  "sources": [
    "https://github.com/Azure/azure-dev/releases/tag/azure-dev-cli_1.24.0",
    "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.9502,
  "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-284e71cd7c72a6ee-0:gate",
    "evidence_hash": "d88b2f1c499ec503bf6c7ee51ff1e9424339d4d98dcbab99ccc9c9128b54440f"
  },
  "review": {
    "draft_hash": "0d159b37684e719e724eb8d6da094011cffc08387f78c18e7fae17820ec5ea98",
    "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.95 >= 0.9; 2 needed) and Jev gave 0.62 (>= 0.6 needed)."
  }
}
