Summary
Update ParseProvider() in pkg/infra/provisioning/provisioning.go to accept any non-empty string as a valid provider kind (not just hardcoded Bicep/Terraform/Test). Also add a Config map[string]any field to the Options struct for extension-specific configuration pass-through via azure.yaml.
Parent Epic
Part of #7465 — Provisioning Providers in the AZD Extension Framework
Context
Current Behavior
func ParseProvider(kind ProviderKind) (ProviderKind, error) {
switch kind {
case NotSpecified, Bicep, Terraform, Test:
return kind, nil
}
return ProviderKind(""), fmt.Errorf("unsupported IaC provider '%s'", kind)
}
This rejects any provider name that isn't in the hardcoded list, blocking external providers.
Required Behavior
When azure.yaml specifies infra.provider: myprov, ParseProvider("myprov") must return ("myprov", nil) — the IoC container will resolve the provider by name at runtime.
Config Pass-Through
Extensions need arbitrary configuration from azure.yaml:
infra:
provider: myprov
path: ./infra
config:
scripts:
- shell: bash
run: setup.sh
The config field needs to be in the Options struct and marshaled to google.protobuf.Struct for the proto.
Detailed Requirements
ParseProvider Update
func ParseProvider(kind ProviderKind) (ProviderKind, error) {
// Accept any non-empty provider name
// Known providers still work unchanged
// NotSpecified still defaults correctly via DefaultProviderResolver
return kind, nil
}
Options.Config Field
type Options struct {
// ...existing fields...
Config map[string]any `yaml:"config,omitempty"`
}
Acceptance Criteria
Dependencies
- None (can be done in parallel with other work)
Files
- Modify:
pkg/infra/provisioning/provisioning.go
- Modify:
pkg/infra/provisioning/provider.go
- Modify:
pkg/infra/provisioning/provisioning_test.go (if exists)
Summary
Update
ParseProvider()inpkg/infra/provisioning/provisioning.goto accept any non-empty string as a valid provider kind (not just hardcoded Bicep/Terraform/Test). Also add aConfig map[string]anyfield to theOptionsstruct for extension-specific configuration pass-through viaazure.yaml.Parent Epic
Part of #7465 — Provisioning Providers in the AZD Extension Framework
Context
Current Behavior
This rejects any provider name that isn't in the hardcoded list, blocking external providers.
Required Behavior
When
azure.yamlspecifiesinfra.provider: myprov,ParseProvider("myprov")must return("myprov", nil)— the IoC container will resolve the provider by name at runtime.Config Pass-Through
Extensions need arbitrary configuration from
azure.yaml:The
configfield needs to be in theOptionsstruct and marshaled togoogle.protobuf.Structfor the proto.Detailed Requirements
ParseProvider Update
Options.Config Field
Acceptance Criteria
ParseProvider()accepts any non-empty stringNotSpecifiedstill defaults correctlyOptions.Config map[string]anyfield added with yaml tagParseProviderwith arbitrary provider namesDependencies
Files
pkg/infra/provisioning/provisioning.gopkg/infra/provisioning/provider.gopkg/infra/provisioning/provisioning_test.go(if exists)