sincecutoff.com
← all changes

azd azure.yaml hooks support Python scripts

Introduced 2026-04-11 · score 0.93

HOW TO USE IT

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.

hooks: preprovision: run: ./hooks/setup.py

WHY THIS HELPS

Run an `azure.yaml` hook implemented as a Python script in the project.

REQUIREMENTS AND LIMITATIONS

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

FIRST-PARTY EVIDENCE

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

Report a problem with this card