azure-gate: deploy via az rest (nixpkgs az deployment module crashes on NixOS) #154

Merged
trevato merged 1 commit from fix/azure-gate-az-rest into main 2026-08-19 20:18:30 +00:00
Owner

The blocker after the bicep fix (#151). Diagnosed from Forgejo's action-log storage and reproduced on the runner: even with nixpkgs#bicep on PATH and use_binary_from_path=true, az deployment group create crashes on the NixOS runner:

ERROR: 'NoneType' object has no attribute '__name__'

The nixpkgs azure-cli's az deployment command module is broken (same class as the az aks nodepool add SDK crash documented in aks-cost-experiment.md). Confirmed on vxrail that BOTH the .bicep and a pre-compiled .json crash identically and early → it's the command module, not bicep. az rest against the ARM deployments API works (validated on the runner: provisioningState: Succeeded).

Fix (deploy/azure/gate.sh + workflow):

  • deploy() helper: compile the bicep to ARM JSON with nix bicep, submit via az rest PUT, poll provisioningState; dep_output() reads outputs via az rest GET. Both vms + aks deploy sites use it.
  • Off-NixOS laptops (no bicep on PATH) keep using az deployment group create unchanged.
  • workflow: add nixpkgs#python3 (deploy() builds the ARM payload with it).

Note: this supersedes Ben's #153 (which is the same bicep fix already merged as #151) — #153 can be closed. This one goes a layer deeper to the actual deploy crash.

🤖 Generated with Claude Code

The blocker after the bicep fix (#151). Diagnosed from Forgejo's action-log storage and reproduced on the runner: even with `nixpkgs#bicep` on PATH and `use_binary_from_path=true`, `az deployment group create` crashes on the NixOS runner: ``` ERROR: 'NoneType' object has no attribute '__name__' ``` The nixpkgs azure-cli's `az deployment` command module is broken (same class as the `az aks nodepool add` SDK crash documented in `aks-cost-experiment.md`). Confirmed on vxrail that BOTH the `.bicep` and a pre-compiled `.json` crash identically and early → it's the command module, not bicep. **`az rest` against the ARM deployments API works** (validated on the runner: `provisioningState: Succeeded`). **Fix** (`deploy/azure/gate.sh` + workflow): - `deploy()` helper: compile the bicep to ARM JSON with nix bicep, submit via `az rest` PUT, poll `provisioningState`; `dep_output()` reads outputs via `az rest` GET. Both vms + aks deploy sites use it. - Off-NixOS laptops (no `bicep` on PATH) keep using `az deployment group create` unchanged. - workflow: add `nixpkgs#python3` (deploy() builds the ARM payload with it). Note: this supersedes Ben's #153 (which is the same bicep fix already merged as #151) — #153 can be closed. This one goes a layer deeper to the actual deploy crash. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
azure-gate: deploy via az rest — the nixpkgs az deployment module crashes on NixOS
All checks were successful
guard-ppt / no-ppt (push) Successful in 20s
guard-ppt / no-ppt (pull_request) Successful in 20s
fc3225b278
Even with bicep on PATH (#151), 'az deployment group create' crashes on the
NixOS runner with 'NoneType object has no attribute __name__' — the nixpkgs
azure-cli's deployment command module is broken (same class as the az aks
nodepool add crash in the ops runbooks). Proven on the runner: 'az rest'
against the ARM deployments API works.

gate.sh: a deploy() helper compiles the bicep to ARM JSON (nix bicep) and
submits it via 'az rest' PUT, polling provisioningState; dep_output() reads
outputs via 'az rest' GET. Laptops without bicep on PATH keep using
'az deployment group create'. Both vms + aks deploy sites use the helper.
workflow: add nixpkgs#python3 (deploy() builds the ARM payload with it).

Diagnosed from Forgejo's own action-log storage (job-log API 404s) and
reproduced/fixed directly on the vxrail runner via az rest validate.
Sign in to join this conversation.
No description provided.