Summary
Define the ProvisioningProvider interface and ProvisioningProviderFactory type in pkg/azdext/ that extension authors implement to provide custom provisioning providers. This mirrors the core provisioning.Provider contract but uses proto types and adds explicit progress reporter parameters.
Parent Epic
Part of #7465 — Provisioning Providers in the AZD Extension Framework
Context
Extension authors need a clean Go interface to implement. The interface mirrors the core provisioning.Provider but differs in key ways:
- No
Name() method — the name is set during registration via WithProvisioningProvider(name, factory), not returned by the provider at runtime
- Progress reporter parameters —
Deploy, Preview, Destroy take a ProgressReporter for in-band progress streaming (the core interface doesn't have this because core providers handle progress internally)
- Proto types — all parameters and return values use proto-generated types, not core domain types
Existing Patterns
ServiceTargetProvider interface in pkg/azdext/service_target_manager.go
FrameworkServiceProvider interface in pkg/azdext/framework_service_manager.go
Detailed Requirements
type ProvisioningProvider interface {
Initialize(ctx context.Context, projectPath string, options *ProvisioningOptions) error
State(ctx context.Context, options *ProvisioningStateOptions) (*ProvisioningStateResult, error)
Deploy(ctx context.Context, progress ProgressReporter) (*ProvisioningDeployResult, error)
Preview(ctx context.Context, progress ProgressReporter) (*ProvisioningDeployPreviewResult, error)
Destroy(ctx context.Context, options *ProvisioningDestroyOptions, progress ProgressReporter) (*ProvisioningDestroyResult, error)
EnsureEnv(ctx context.Context) error
Parameters(ctx context.Context) ([]*ProvisioningParameter, error)
}
type ProvisioningProviderFactory func() ProvisioningProvider
Where ProgressReporter is the same type used by service targets/framework services (typically a function that sends progress messages).
Acceptance Criteria
Dependencies
Files
- Create/Modify:
pkg/azdext/provisioning_manager.go (interface definition at top of file)
Summary
Define the
ProvisioningProviderinterface andProvisioningProviderFactorytype inpkg/azdext/that extension authors implement to provide custom provisioning providers. This mirrors the coreprovisioning.Providercontract but uses proto types and adds explicit progress reporter parameters.Parent Epic
Part of #7465 — Provisioning Providers in the AZD Extension Framework
Context
Extension authors need a clean Go interface to implement. The interface mirrors the core
provisioning.Providerbut differs in key ways:Name()method — the name is set during registration viaWithProvisioningProvider(name, factory), not returned by the provider at runtimeDeploy,Preview,Destroytake aProgressReporterfor in-band progress streaming (the core interface doesn't have this because core providers handle progress internally)Existing Patterns
ServiceTargetProviderinterface inpkg/azdext/service_target_manager.goFrameworkServiceProviderinterface inpkg/azdext/framework_service_manager.goDetailed Requirements
Where
ProgressReporteris the same type used by service targets/framework services (typically a function that sends progress messages).Acceptance Criteria
ProvisioningProviderinterface defined with all 7 methodsProvisioningProviderFactorytype alias:func() ProvisioningProviderName()method on the interfaceDeploy,Preview,DestroyacceptProgressReporterparameterServiceTargetProviderandFrameworkServiceProviderDependencies
Files
pkg/azdext/provisioning_manager.go(interface definition at top of file)