Add configuration and framework config to .NET hook executor
Background & Motivation
The .NET hook executor builds with an empty configuration (SDK default = Debug), while the framework service hardcodes Release. Users need control over the build configuration for hook scripts, especially for production seed/migration hooks. Multi-targeting users also need to specify a target framework moniker. Issue #7653 explicitly calls out both properties.
User Story
As a .NET developer, I want to specify configuration and framework in my hook config so that my .NET hooks build and run with the correct settings.
Solution Approach
- Define a strongly-typed
dotnetHookConfig struct and unmarshal from execCtx.Config:
type dotnetHookConfig struct {
Configuration string `json:"configuration"` // Debug, Release, or custom
Framework string `json:"framework"` // net8.0, net10.0, etc.
}
- Read config in
dotnet_executor.go Prepare() phase via execCtx.Config
- Pass
Configuration to dotnetCli.Build() instead of empty string
- Pass
Framework as --framework flag to dotnet run in Execute() phase
- Validate both are strings (no enum restriction for
Configuration — MSBuild allows custom values like Staging)
Example azure.yaml
hooks:
postprovision:
run: ./hooks/migrate.cs
kind: dotnet
config:
configuration: Release
framework: net10.0
Acceptance Criteria
Defaults when omitted:
configuration: empty string (SDK default, typically Debug)
framework: not set (auto-detected from project file)
Out of Scope
- Custom dotnet run arguments — future enhancement
- Suppressing DOTNET_NOLOGO — low priority
- Runtime identifier (
-r) support — future enhancement
Testing Expectations
- Unit tests: table-driven tests for config unmarshalling and dotnet CLI argument construction
- Test that configuration is passed to both Build() and Run() commands
- Test that framework is passed as
--framework flag to Run() command
Related Issues
Add
configurationandframeworkconfig to .NET hook executorBackground & Motivation
The .NET hook executor builds with an empty configuration (SDK default = Debug), while the framework service hardcodes
Release. Users need control over the build configuration for hook scripts, especially for production seed/migration hooks. Multi-targeting users also need to specify a target framework moniker. Issue #7653 explicitly calls out both properties.User Story
As a .NET developer, I want to specify
configurationandframeworkin my hook config so that my .NET hooks build and run with the correct settings.Solution Approach
dotnetHookConfigstruct and unmarshal fromexecCtx.Config:dotnet_executor.goPrepare()phase viaexecCtx.ConfigConfigurationtodotnetCli.Build()instead of empty stringFrameworkas--frameworkflag todotnet runinExecute()phaseConfiguration— MSBuild allows custom values likeStaging)Example azure.yaml
Acceptance Criteria
config.configuration: Releasebuilds hook script in Release modeconfig.configuration: Debugexplicitly builds in Debug modeconfig.framework: net10.0targets specific framework for both build and runconfigurationpreserves current behavior (empty string → SDK default)frameworkpreserves current behavior (auto-detected from project)Defaults when omitted:
configuration: empty string (SDK default, typically Debug)framework: not set (auto-detected from project file)Out of Scope
-r) support — future enhancementTesting Expectations
--frameworkflag to Run() commandRelated Issues
Config map[string]anyonExecutionContext