azd azure.yaml hooks run C#/.NET files with dotnet run
Introduced 2026-04-15 · score 0.95
HOW TO USE IT
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.
hooks:
postprovision:
run: ./hooks/migrate.cs
azd upWHY THIS HELPS
Run a C#/.NET hook defined in `azure.yaml` as part of an azd project workflow.
REQUIREMENTS AND LIMITATIONS
- 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+.
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/hooks-multi-language
- https://learn.microsoft.com/en-us/azure/developer/azure-developer-cli/azd-schema
Check the installed version and the source before using it. Entry JSON