Skip to content

Interface: Define extension-side ProvisioningProvider interface #7469

Description

@wbreza

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:

  1. No Name() method — the name is set during registration via WithProvisioningProvider(name, factory), not returned by the provider at runtime
  2. Progress reporter parametersDeploy, Preview, Destroy take a ProgressReporter for in-band progress streaming (the core interface doesn't have this because core providers handle progress internally)
  3. 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

  • ProvisioningProvider interface defined with all 7 methods
  • ProvisioningProviderFactory type alias: func() ProvisioningProvider
  • No Name() method on the interface
  • Deploy, Preview, Destroy accept ProgressReporter parameter
  • All parameter/return types use proto-generated types
  • Follows naming conventions of ServiceTargetProvider and FrameworkServiceProvider

Dependencies

Files

  • Create/Modify: pkg/azdext/provisioning_manager.go (interface definition at top of file)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions