Help us shape the future of Go! Take the 2026 Go Developer Survey

cmd

package
v1.37.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 21, 2026 License: MIT Imports: 65 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AINotValid = "is not valid according to the validation procedure"
)

Variables

View Source
var NonPersistentGlobalFlags = []string{"help", "docs"}

NonPersistentGlobalFlags are flags that appear on all commands but are generated per-command rather than being defined as persistent flags on the root command.

Functions

func AzurePortalLink(portalUrlBase, subscriptionId, resourceGroupName string) string

func GetCmdDeployHelpDescription

func GetCmdDeployHelpDescription(*cobra.Command) string

func GetCmdDeployHelpFooter

func GetCmdDeployHelpFooter(*cobra.Command) string

func GetCmdProvisionHelpDescription

func GetCmdProvisionHelpDescription(c *cobra.Command) string

func GetCmdPublishHelpDescription

func GetCmdPublishHelpDescription(*cobra.Command) string

func GetCmdPublishHelpFooter

func GetCmdPublishHelpFooter(*cobra.Command) string

func MapError

func MapError(err error, span tracing.Span)

MapError maps the given error to a telemetry span, setting status (the AppInsights ResultCode), a small set of error.* attributes, and the full wrapped-type chain. The classification ladder lives in classify; this function is responsible only for stamping its result onto the span.

func NewDeployAction

func NewDeployAction(
	flags *DeployFlags,
	args []string,
	projectConfig *project.ProjectConfig,
	projectManager project.ProjectManager,
	serviceManager project.ServiceManager,
	resourceManager project.ResourceManager,
	azdCtx *azdcontext.AzdContext,
	environment *environment.Environment,
	envManager environment.Manager,
	accountManager account.Manager,
	cloud *cloud.Cloud,
	azCli *azapi.AzureClient,
	commandRunner exec.CommandRunner,
	console input.Console,
	formatter output.Formatter,
	writer io.Writer,
	alphaFeatureManager *alpha.FeatureManager,
	importManager *project.ImportManager,
) actions.Action

func NewDeployCmd

func NewDeployCmd() *cobra.Command

func NewProvisionAction

func NewProvisionAction(
	args []string,
	flags *ProvisionFlags,
	provisionManager *provisioning.Manager,
	projectManager project.ProjectManager,
	importManager *project.ImportManager,
	resourceManager project.ResourceManager,
	projectConfig *project.ProjectConfig,
	env *environment.Environment,
	envManager environment.Manager,
	console input.Console,
	commandRunner exec.CommandRunner,
	serviceLocator ioc.ServiceLocator,
	formatter output.Formatter,
	writer io.Writer,
	subManager *account.SubscriptionsManager,
	alphaFeatureManager *alpha.FeatureManager,
	cloud *cloud.Cloud,
	defaultProvider provisioning.DefaultProviderResolver,
	fileShareService storage.FileShareService,
) actions.Action

func NewProvisionCmd

func NewProvisionCmd() *cobra.Command

func NewPublishAction

func NewPublishAction(
	flags *PublishFlags,
	args []string,
	projectConfig *project.ProjectConfig,
	projectManager project.ProjectManager,
	serviceManager project.ServiceManager,
	resourceManager project.ResourceManager,
	azdCtx *azdcontext.AzdContext,
	environment *environment.Environment,
	accountManager account.Manager,
	cloud *cloud.Cloud,
	azCli *azapi.AzureClient,
	commandRunner exec.CommandRunner,
	console input.Console,
	formatter output.Formatter,
	writer io.Writer,
	alphaFeatureManager *alpha.FeatureManager,
	importManager *project.ImportManager,
	serviceLocator ioc.ServiceLocator,
) actions.Action

func NewPublishCmd

func NewPublishCmd() *cobra.Command

Types

type DeployAction

type DeployAction struct {
	// contains filtered or unexported fields
}

func (*DeployAction) Run

type DeployFlags

type DeployFlags struct {
	ServiceName string
	All         bool
	Timeout     int

	*internal.EnvFlag
	// contains filtered or unexported fields
}

func NewDeployFlags

func NewDeployFlags(cmd *cobra.Command, global *internal.GlobalCommandOptions) *DeployFlags

func NewDeployFlagsFromEnvAndOptions

func NewDeployFlagsFromEnvAndOptions(envFlag *internal.EnvFlag, global *internal.GlobalCommandOptions) *DeployFlags

func (*DeployFlags) Bind

func (d *DeployFlags) Bind(local *pflag.FlagSet, global *internal.GlobalCommandOptions)

func (*DeployFlags) BindNonCommon

func (d *DeployFlags) BindNonCommon(
	local *pflag.FlagSet,
	global *internal.GlobalCommandOptions)

func (*DeployFlags) SetCommon

func (d *DeployFlags) SetCommon(envFlag *internal.EnvFlag)

type DeploymentPreviewResult added in v1.35.0

type DeploymentPreviewResult struct {
	Timestamp time.Time                                      `json:"timestamp"`
	Services  map[string]*project.ServiceDeployPreviewResult `json:"services"`
}

DeploymentPreviewResult is the JSON output of `azd deploy --preview`.

type DeploymentResult

type DeploymentResult struct {
	Timestamp time.Time                               `json:"timestamp"`
	Services  map[string]*project.ServiceDeployResult `json:"services"`
	Messages  []commandresult.ServiceEventMessage     `json:"messages,omitempty"`
}

type ProvisionAction

type ProvisionAction struct {
	// contains filtered or unexported fields
}

func (*ProvisionAction) Run

func (*ProvisionAction) SetFlags

func (p *ProvisionAction) SetFlags(flags *ProvisionFlags)

SetFlags sets the flags for the provision action. Panics if `flags` is nil

type ProvisionFlags

type ProvisionFlags struct {
	*internal.EnvFlag
	// contains filtered or unexported fields
}

func NewProvisionFlags

func NewProvisionFlags(cmd *cobra.Command, global *internal.GlobalCommandOptions) *ProvisionFlags

func NewProvisionFlagsFromEnvAndOptions

func NewProvisionFlagsFromEnvAndOptions(envFlag *internal.EnvFlag, global *internal.GlobalCommandOptions) *ProvisionFlags

func (*ProvisionFlags) Bind

func (i *ProvisionFlags) Bind(local *pflag.FlagSet, global *internal.GlobalCommandOptions)

func (*ProvisionFlags) BindNonCommon

func (i *ProvisionFlags) BindNonCommon(local *pflag.FlagSet, global *internal.GlobalCommandOptions)

func (*ProvisionFlags) Location

func (i *ProvisionFlags) Location() string

Location returns the value of the --location flag.

func (*ProvisionFlags) SetCommon

func (i *ProvisionFlags) SetCommon(envFlag *internal.EnvFlag)

func (*ProvisionFlags) Subscription

func (i *ProvisionFlags) Subscription() string

Subscription returns the value of the --subscription flag.

type PublishAction

type PublishAction struct {
	// contains filtered or unexported fields
}

func (*PublishAction) Run

type PublishFlags

type PublishFlags struct {
	ServiceName string
	All         bool
	To          string
	FromPackage string

	*internal.EnvFlag
	// contains filtered or unexported fields
}

func NewPublishFlags

func NewPublishFlags(cmd *cobra.Command, global *internal.GlobalCommandOptions) *PublishFlags

func (*PublishFlags) Bind

func (f *PublishFlags) Bind(local *pflag.FlagSet, global *internal.GlobalCommandOptions)

type PublishResult

type PublishResult struct {
	Timestamp time.Time                                `json:"timestamp"`
	Services  map[string]*project.ServicePublishResult `json:"services"`
}

type UpGraphAction added in v1.25.0

type UpGraphAction struct {
	// contains filtered or unexported fields
}

UpGraphAction is the single implementation of `azd up`'s default path: it builds a unified execution graph covering project-level command hooks (`preprovision`, `postprovision`, `predeploy`, `postdeploy`), every provision layer, every service's package → publish → deploy chain, and the project-level deploy lifecycle events.

The graph structure for `n` provision layers and `m` services is:

cmdhook-preprovision ──▶ provision-<L0..Ln> ──▶ cmdhook-postprovision
   ──▶ cmdhook-predeploy ──▶ event-predeploy ──▶ publish-<svc>
   ──▶ deploy-<svc> ──▶ event-postdeploy ──▶ cmdhook-postdeploy
                                                ▲
  cmdhook-prepackage ──▶ event-prepackage ──▶ package-<svc>
     ──▶ event-postpackage ──▶ cmdhook-postpackage
         (cmdhook-postpackage gates event-predeploy so prepackage→
          postpackage→predeploy ordering matches the old workflow)

Hook semantics:

  • Middleware fires `preup`/`postup` around this action. The graph never duplicates those.
  • `cmdhook-*` nodes fire the project-level shell hooks that the cobra hooks middleware fires for stand-alone `azd package` / `azd provision` / `azd deploy` invocations. They are no-ops (~µs) when the project declares no such hooks — structurally identical to the existing `event-*` nodes.
  • `event-prepackage`/`event-postpackage` fire project.ProjectEventPackage pre/post handlers (the Go event dispatcher path that stand-alone `azd package` invokes via projectConfig.Invoke).
  • `event-predeploy`/`event-postdeploy` fire project.ProjectEventDeploy pre/post handlers (the Go event dispatcher path used by e.g. the .NET Aspire publisher).
  • `provisionSingleLayer` continues to fire layer hooks + per-layer `ProjectEventProvision` events internally.

func NewUpGraphAction added in v1.25.0

func NewUpGraphAction(
	projectConfig *project.ProjectConfig,
	env *environment.Environment,
	envManager environment.Manager,
	console input.Console,
	alphaFeatureManager *alpha.FeatureManager,
	importManager *project.ImportManager,
	serviceManager project.ServiceManager,
	projectManager project.ProjectManager,
	serviceLocator ioc.ServiceLocator,
	defaultProvider provisioning.DefaultProviderResolver,
	fileShareService storage.FileShareService,
	cloud *cloud.Cloud,
	commandRunner exec.CommandRunner,
	formatter output.Formatter,
	writer io.Writer,
	provisionManager *provisioning.Manager,
) *UpGraphAction

NewUpGraphAction creates a new UpGraphAction. Dependencies are resolved via the IoC container.

func (*UpGraphAction) Run added in v1.25.0

func (u *UpGraphAction) Run(
	ctx context.Context,
	layers []provisioning.Options,
	deployFlags *DeployFlags,
	parentFlags *pflag.FlagSet,
	startTime time.Time,
) (*actions.ActionResult, error)

Run builds and executes the unified `azd up` graph. `layers` may be empty, in which case a zero-layer graph (cmdhook-* + service steps + deploy events) is built and executed. `deployFlags` is consulted by [resolveDeployTimeout] so that `AZD_DEPLOY_TIMEOUT` and `--timeout` behave identically to stand-alone `azd deploy`.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL