sincecutoff.com
← all changes

azd hooks run supports per-layer hooks

Introduced 2026-04-04 · score 0.97

HOW TO USE IT

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>`.

azd hooks run <hook-name> --layer <layer-name>
infra: layers: - name: <layer-name> path: <infra-path> hooks: postprovision: shell: sh run: <script-path>

WHY THIS HELPS

Run hooks for a specific infrastructure layer or configure hooks to run during provisioning.

REQUIREMENTS AND LIMITATIONS

  • 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`.

FIRST-PARTY EVIDENCE

Check the installed version and the source before using it. Entry JSON

Report a problem with this card