azd azure.yaml hooks accept executor-specific config
Introduced 2026-04-15 · score 0.90
HOW TO USE IT
When configuring a JavaScript/TypeScript, Python, or .NET hook, add `config:` to its hook in `azure.yaml` and set the option for that executor. Specify `kind` when needed to identify the executor; provide `run` because it is required when `config` is set.
hooks:
postdeploy:
kind: ts
run: ./hooks/<script>.ts
config:
packageManager: pnpmhooks:
postprovision:
kind: python
run: ./hooks/<script>.py
config:
virtualEnvName: <directory>hooks:
postprovision:
kind: dotnet
run: ./hooks/<script>.cs
config:
configuration: Release
framework: net10.0WHY THIS HELPS
Configure runtime-specific options for hooks in an `azure.yaml` project.
REQUIREMENTS AND LIMITATIONS
- Version: 1.24.0
- run (required): Hook script or relative script path; required when `config` is specified.
- kind: Hook executor kind: `js`, `ts`, `python`, `dotnet`, `sh`, or `pwsh`. If omitted, azd infers it from the script file extension.
- config: Object for executor-specific configuration. Its available properties depend on `kind`.
- config.packageManager: For `js` or `ts`: dependency package manager; overrides lock-file auto-detection. Allowed: `npm`, `pnpm`, `yarn`.
- config.virtualEnvName: For `python`: virtual environment directory name. Defaults to auto-detection (`.venv`, `venv`) or `{baseName}_env`.
- config.configuration: For `dotnet`: MSBuild configuration, for example `Debug` or `Release`.
- config.framework: For `dotnet`: target framework moniker, for example `net8.0` or `net10.0`.
- Prerequisite: For JavaScript/TypeScript hooks, place `package.json` in the script directory or a parent directory.
- Prerequisite: For .NET project mode, a `.csproj`, `.fsproj`, or `.vbproj` must be in the script directory or a parent directory. Standalone `.cs` script mode requires .NET 10+.
FIRST-PARTY EVIDENCE
- 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/azd-schema
- https://learn.microsoft.com/en-us/azure/developer/azure-developer-cli/hooks-multi-language
Check the installed version and the source before using it. Entry JSON