diff --git a/cli/azd/cmd/auto_install.go b/cli/azd/cmd/auto_install.go index 73b0f698f3b..a0082383735 100644 --- a/cli/azd/cmd/auto_install.go +++ b/cli/azd/cmd/auto_install.go @@ -624,6 +624,11 @@ func CreateGlobalFlagSet() *pflag.FlagSet { false, "Alias for --no-prompt.") _ = globalFlags.MarkHidden("non-interactive") + globalFlags.Bool( + "fail-on-prompt", + false, + "Fails with an actionable error whenever a prompt is encountered, even if a default exists."+ + " Implies --no-prompt.") globalFlags.StringP(internal.EnvironmentNameFlagName, "e", "", "The name of the environment to use.") // The telemetry system is responsible for reading these flags value and using it to configure the telemetry @@ -725,10 +730,22 @@ func ParseGlobalFlags(args []string, opts *internal.GlobalCommandOptions) error } } - // Agent Detection: If no explicit flag or env var was set and we detect an AI coding - // agent as the caller, automatically enable no-prompt mode for non-interactive execution. - if !flagExplicitlySet && !envVarPresent && agentdetect.IsRunningInAgent() { + if boolVal, err := globalFlagSet.GetBool("fail-on-prompt"); err == nil { + opts.FailOnPrompt = boolVal + if boolVal { + // --fail-on-prompt implies --no-prompt + opts.NoPrompt = true + } + } + + // Agent Detection: If --no-prompt was not explicitly set and we detect an AI coding agent + // as the caller, automatically enable fail-on-prompt mode for strict non-interactive execution. + failOnPromptFlag := globalFlagSet.Lookup("fail-on-prompt") + failOnPromptExplicitlySet := failOnPromptFlag != nil && failOnPromptFlag.Changed + if !flagExplicitlySet && !failOnPromptExplicitlySet && + !envVarPresent && agentdetect.IsRunningInAgent() { opts.NoPrompt = true + opts.FailOnPrompt = true } return nil diff --git a/cli/azd/cmd/auto_install_test.go b/cli/azd/cmd/auto_install_test.go index 5875e005ada..847bd459f33 100644 --- a/cli/azd/cmd/auto_install_test.go +++ b/cli/azd/cmd/auto_install_test.go @@ -340,58 +340,90 @@ func TestCheckForMatchingExtension_Unit(t *testing.T) { func TestParseGlobalFlags_AgentDetection(t *testing.T) { tests := []struct { - name string - args []string - envVars map[string]string - expectedNoPrompt bool + name string + args []string + envVars map[string]string + expectedNoPrompt bool + expectedFailOnPrompt bool }{ { - name: "no agent detected, no flag", - args: []string{"up"}, - envVars: map[string]string{}, - expectedNoPrompt: false, + name: "no agent detected, no flag", + args: []string{"up"}, + envVars: map[string]string{}, + expectedNoPrompt: false, + expectedFailOnPrompt: false, }, { - name: "agent detected via env var, no flag", - args: []string{"up"}, - envVars: map[string]string{"CLAUDE_CODE": "1"}, - expectedNoPrompt: true, + name: "agent detected via env var, no flag", + args: []string{"up"}, + envVars: map[string]string{"CLAUDE_CODE": "1"}, + expectedNoPrompt: true, + expectedFailOnPrompt: true, }, { - name: "agent detected but --no-prompt=false explicitly set", - args: []string{"--no-prompt=false", "up"}, - envVars: map[string]string{"CLAUDE_CODE": "1"}, - expectedNoPrompt: false, + name: "agent detected but --no-prompt=false explicitly set", + args: []string{"--no-prompt=false", "up"}, + envVars: map[string]string{"CLAUDE_CODE": "1"}, + expectedNoPrompt: false, + expectedFailOnPrompt: false, }, { - name: "agent detected but --no-prompt explicitly set true", - args: []string{"--no-prompt", "up"}, - envVars: map[string]string{"GEMINI_CLI": "1"}, - expectedNoPrompt: true, + name: "agent detected but --no-prompt explicitly set true", + args: []string{"--no-prompt", "up"}, + envVars: map[string]string{"GEMINI_CLI": "1"}, + expectedNoPrompt: true, + expectedFailOnPrompt: false, }, { - name: "no agent, --no-prompt explicitly set", - args: []string{"--no-prompt", "deploy"}, - envVars: map[string]string{}, - expectedNoPrompt: true, + name: "no agent, --no-prompt explicitly set", + args: []string{"--no-prompt", "deploy"}, + envVars: map[string]string{}, + expectedNoPrompt: true, + expectedFailOnPrompt: false, }, { - name: "Gemini agent detected", - args: []string{"init"}, - envVars: map[string]string{"GEMINI_CLI": "1"}, - expectedNoPrompt: true, + name: "Gemini agent detected", + args: []string{"init"}, + envVars: map[string]string{"GEMINI_CLI": "1"}, + expectedNoPrompt: true, + expectedFailOnPrompt: true, }, { - name: "GitHub Copilot CLI agent detected", - args: []string{"deploy"}, - envVars: map[string]string{"GITHUB_COPILOT_CLI": "true"}, - expectedNoPrompt: true, + name: "GitHub Copilot CLI agent detected", + args: []string{"deploy"}, + envVars: map[string]string{"GITHUB_COPILOT_CLI": "true"}, + expectedNoPrompt: true, + expectedFailOnPrompt: true, }, { - name: "OpenCode agent detected", - args: []string{"provision"}, - envVars: map[string]string{"OPENCODE": "1"}, - expectedNoPrompt: true, + name: "OpenCode agent detected", + args: []string{"provision"}, + envVars: map[string]string{"OPENCODE": "1"}, + expectedNoPrompt: true, + expectedFailOnPrompt: true, + }, + { + name: "fail-on-prompt flag implies no-prompt", + args: []string{"--fail-on-prompt", "up"}, + envVars: map[string]string{}, + expectedNoPrompt: true, + expectedFailOnPrompt: true, + }, + { + name: "no-prompt alone does not set fail-on-prompt", + args: []string{"--no-prompt", "up"}, + envVars: map[string]string{}, + expectedNoPrompt: true, + expectedFailOnPrompt: false, + }, + { + name: "fail-on-prompt explicit overrides agent detection", + args: []string{"--fail-on-prompt", "up"}, + envVars: map[string]string{ + "CLAUDE_CODE": "1", + }, + expectedNoPrompt: true, + expectedFailOnPrompt: true, }, } @@ -422,6 +454,8 @@ func TestParseGlobalFlags_AgentDetection(t *testing.T) { assert.Equal(t, tt.expectedNoPrompt, opts.NoPrompt, "NoPrompt should be %v for test case: %s", tt.expectedNoPrompt, tt.name) + assert.Equal(t, tt.expectedFailOnPrompt, opts.FailOnPrompt, + "FailOnPrompt should be %v for test case: %s", tt.expectedFailOnPrompt, tt.name) // Clean up for next test agentdetect.ResetDetection() diff --git a/cli/azd/cmd/container.go b/cli/azd/cmd/container.go index 0f1f5d467a3..061d491ad12 100644 --- a/cli/azd/cmd/container.go +++ b/cli/azd/cmd/container.go @@ -150,11 +150,16 @@ func registerCommonDependencies(container *ioc.NestedContainer) { } } - return input.NewConsole(rootOptions.NoPrompt, isTerminal, input.Writers{Output: writer}, input.ConsoleHandles{ - Stdin: cmd.InOrStdin(), - Stdout: cmd.OutOrStdout(), - Stderr: cmd.ErrOrStderr(), - }, formatter, externalPromptCfg) + return input.NewConsole( + rootOptions.NoPrompt, + rootOptions.FailOnPrompt, + isTerminal, + input.Writers{Output: writer}, + input.ConsoleHandles{ + Stdin: cmd.InOrStdin(), + Stdout: cmd.OutOrStdout(), + Stderr: cmd.ErrOrStderr(), + }, formatter, externalPromptCfg) }) container.MustRegisterSingleton( diff --git a/cli/azd/cmd/external_prompt_test.go b/cli/azd/cmd/external_prompt_test.go index 2425fc291ce..e3f5302ff9f 100644 --- a/cli/azd/cmd/external_prompt_test.go +++ b/cli/azd/cmd/external_prompt_test.go @@ -79,6 +79,7 @@ func TestExternalPromptFromEnvironmentVariables(t *testing.T) { // Create the console with external prompting configured console := input.NewConsole( rootOptions.NoPrompt, + rootOptions.FailOnPrompt, isTerminal, input.Writers{Output: writer}, input.ConsoleHandles{ diff --git a/cli/azd/cmd/testdata/TestFigSpec.ts b/cli/azd/cmd/testdata/TestFigSpec.ts index 4bfa4786c03..8a027a45cec 100644 --- a/cli/azd/cmd/testdata/TestFigSpec.ts +++ b/cli/azd/cmd/testdata/TestFigSpec.ts @@ -3681,6 +3681,11 @@ const completionSpec: Fig.Spec = { }, ], }, + { + name: ['--fail-on-prompt'], + description: 'Fails with an actionable error whenever a prompt is encountered, even if a default exists. Implies --no-prompt.', + isPersistent: true, + }, { name: ['--no-prompt'], description: 'Accepts the default value instead of prompting, or it fails if there is no default.', diff --git a/cli/azd/cmd/testdata/TestUsage-azd-add.snap b/cli/azd/cmd/testdata/TestUsage-azd-add.snap index 11209d07544..c87eb3a14dd 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-add.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-add.snap @@ -9,6 +9,7 @@ Global Flags --debug : Enables debugging and diagnostics logging. --docs : Opens the documentation for azd add in your web browser. -e, --environment string : The name of the environment to use. + --fail-on-prompt : Fails with an actionable error whenever a prompt is encountered, even if a default exists. Implies --no-prompt. -h, --help : Gets help for add. --no-prompt : Accepts the default value instead of prompting, or it fails if there is no default. diff --git a/cli/azd/cmd/testdata/TestUsage-azd-ai-agent.snap b/cli/azd/cmd/testdata/TestUsage-azd-ai-agent.snap index e62da61e30b..32181eac312 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-ai-agent.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-ai-agent.snap @@ -9,6 +9,7 @@ Global Flags --debug : Enables debugging and diagnostics logging. --docs : Opens the documentation for azd ai agent in your web browser. -e, --environment string : The name of the environment to use. + --fail-on-prompt : Fails with an actionable error whenever a prompt is encountered, even if a default exists. Implies --no-prompt. -h, --help : Gets help for agent. --no-prompt : Accepts the default value instead of prompting, or it fails if there is no default. diff --git a/cli/azd/cmd/testdata/TestUsage-azd-ai-finetuning.snap b/cli/azd/cmd/testdata/TestUsage-azd-ai-finetuning.snap index 2d078b0f730..c6451d39694 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-ai-finetuning.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-ai-finetuning.snap @@ -9,6 +9,7 @@ Global Flags --debug : Enables debugging and diagnostics logging. --docs : Opens the documentation for azd ai finetuning in your web browser. -e, --environment string : The name of the environment to use. + --fail-on-prompt : Fails with an actionable error whenever a prompt is encountered, even if a default exists. Implies --no-prompt. -h, --help : Gets help for finetuning. --no-prompt : Accepts the default value instead of prompting, or it fails if there is no default. diff --git a/cli/azd/cmd/testdata/TestUsage-azd-ai-models.snap b/cli/azd/cmd/testdata/TestUsage-azd-ai-models.snap index d1327bec7f6..6e73868a78d 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-ai-models.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-ai-models.snap @@ -9,6 +9,7 @@ Global Flags --debug : Enables debugging and diagnostics logging. --docs : Opens the documentation for azd ai models in your web browser. -e, --environment string : The name of the environment to use. + --fail-on-prompt : Fails with an actionable error whenever a prompt is encountered, even if a default exists. Implies --no-prompt. -h, --help : Gets help for models. --no-prompt : Accepts the default value instead of prompting, or it fails if there is no default. diff --git a/cli/azd/cmd/testdata/TestUsage-azd-ai.snap b/cli/azd/cmd/testdata/TestUsage-azd-ai.snap index b7cba1c07ba..7a86874d0ca 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-ai.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-ai.snap @@ -14,6 +14,7 @@ Global Flags --debug : Enables debugging and diagnostics logging. --docs : Opens the documentation for azd ai in your web browser. -e, --environment string : The name of the environment to use. + --fail-on-prompt : Fails with an actionable error whenever a prompt is encountered, even if a default exists. Implies --no-prompt. -h, --help : Gets help for ai. --no-prompt : Accepts the default value instead of prompting, or it fails if there is no default. diff --git a/cli/azd/cmd/testdata/TestUsage-azd-appservice.snap b/cli/azd/cmd/testdata/TestUsage-azd-appservice.snap index 316fd405aac..4af3abc9059 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-appservice.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-appservice.snap @@ -9,6 +9,7 @@ Global Flags --debug : Enables debugging and diagnostics logging. --docs : Opens the documentation for azd appservice in your web browser. -e, --environment string : The name of the environment to use. + --fail-on-prompt : Fails with an actionable error whenever a prompt is encountered, even if a default exists. Implies --no-prompt. -h, --help : Gets help for appservice. --no-prompt : Accepts the default value instead of prompting, or it fails if there is no default. diff --git a/cli/azd/cmd/testdata/TestUsage-azd-auth-login.snap b/cli/azd/cmd/testdata/TestUsage-azd-auth-login.snap index 8cc44be7014..f77405fe827 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-auth-login.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-auth-login.snap @@ -20,6 +20,7 @@ Global Flags --debug : Enables debugging and diagnostics logging. --docs : Opens the documentation for azd auth login in your web browser. -e, --environment string : The name of the environment to use. + --fail-on-prompt : Fails with an actionable error whenever a prompt is encountered, even if a default exists. Implies --no-prompt. -h, --help : Gets help for login. --no-prompt : Accepts the default value instead of prompting, or it fails if there is no default. diff --git a/cli/azd/cmd/testdata/TestUsage-azd-auth-logout.snap b/cli/azd/cmd/testdata/TestUsage-azd-auth-logout.snap index d9087aac6cd..4544c058148 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-auth-logout.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-auth-logout.snap @@ -9,6 +9,7 @@ Global Flags --debug : Enables debugging and diagnostics logging. --docs : Opens the documentation for azd auth logout in your web browser. -e, --environment string : The name of the environment to use. + --fail-on-prompt : Fails with an actionable error whenever a prompt is encountered, even if a default exists. Implies --no-prompt. -h, --help : Gets help for logout. --no-prompt : Accepts the default value instead of prompting, or it fails if there is no default. diff --git a/cli/azd/cmd/testdata/TestUsage-azd-auth-status.snap b/cli/azd/cmd/testdata/TestUsage-azd-auth-status.snap index cc345fc049c..42c0b15ce7e 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-auth-status.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-auth-status.snap @@ -9,6 +9,7 @@ Global Flags --debug : Enables debugging and diagnostics logging. --docs : Opens the documentation for azd auth status in your web browser. -e, --environment string : The name of the environment to use. + --fail-on-prompt : Fails with an actionable error whenever a prompt is encountered, even if a default exists. Implies --no-prompt. -h, --help : Gets help for status. --no-prompt : Accepts the default value instead of prompting, or it fails if there is no default. diff --git a/cli/azd/cmd/testdata/TestUsage-azd-auth.snap b/cli/azd/cmd/testdata/TestUsage-azd-auth.snap index 9729ccd7ddb..87bb92d7e59 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-auth.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-auth.snap @@ -14,6 +14,7 @@ Global Flags --debug : Enables debugging and diagnostics logging. --docs : Opens the documentation for azd auth in your web browser. -e, --environment string : The name of the environment to use. + --fail-on-prompt : Fails with an actionable error whenever a prompt is encountered, even if a default exists. Implies --no-prompt. -h, --help : Gets help for auth. --no-prompt : Accepts the default value instead of prompting, or it fails if there is no default. diff --git a/cli/azd/cmd/testdata/TestUsage-azd-coding-agent.snap b/cli/azd/cmd/testdata/TestUsage-azd-coding-agent.snap index 061ae82d4ce..c3d29b3ec4d 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-coding-agent.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-coding-agent.snap @@ -9,6 +9,7 @@ Global Flags --debug : Enables debugging and diagnostics logging. --docs : Opens the documentation for azd coding-agent in your web browser. -e, --environment string : The name of the environment to use. + --fail-on-prompt : Fails with an actionable error whenever a prompt is encountered, even if a default exists. Implies --no-prompt. -h, --help : Gets help for coding-agent. --no-prompt : Accepts the default value instead of prompting, or it fails if there is no default. diff --git a/cli/azd/cmd/testdata/TestUsage-azd-completion-bash.snap b/cli/azd/cmd/testdata/TestUsage-azd-completion-bash.snap index cf52d0c75e0..4381946d06a 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-completion-bash.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-completion-bash.snap @@ -12,6 +12,7 @@ Global Flags --debug : Enables debugging and diagnostics logging. --docs : Opens the documentation for azd completion bash in your web browser. -e, --environment string : The name of the environment to use. + --fail-on-prompt : Fails with an actionable error whenever a prompt is encountered, even if a default exists. Implies --no-prompt. -h, --help : Gets help for bash. --no-prompt : Accepts the default value instead of prompting, or it fails if there is no default. diff --git a/cli/azd/cmd/testdata/TestUsage-azd-completion-fig.snap b/cli/azd/cmd/testdata/TestUsage-azd-completion-fig.snap index ec79fe09e40..5bbbbeb2769 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-completion-fig.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-completion-fig.snap @@ -9,6 +9,7 @@ Global Flags --debug : Enables debugging and diagnostics logging. --docs : Opens the documentation for azd completion fig in your web browser. -e, --environment string : The name of the environment to use. + --fail-on-prompt : Fails with an actionable error whenever a prompt is encountered, even if a default exists. Implies --no-prompt. -h, --help : Gets help for fig. --no-prompt : Accepts the default value instead of prompting, or it fails if there is no default. diff --git a/cli/azd/cmd/testdata/TestUsage-azd-completion-fish.snap b/cli/azd/cmd/testdata/TestUsage-azd-completion-fish.snap index 8b9098a5ad5..d2fd2310284 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-completion-fish.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-completion-fish.snap @@ -9,6 +9,7 @@ Global Flags --debug : Enables debugging and diagnostics logging. --docs : Opens the documentation for azd completion fish in your web browser. -e, --environment string : The name of the environment to use. + --fail-on-prompt : Fails with an actionable error whenever a prompt is encountered, even if a default exists. Implies --no-prompt. -h, --help : Gets help for fish. --no-prompt : Accepts the default value instead of prompting, or it fails if there is no default. diff --git a/cli/azd/cmd/testdata/TestUsage-azd-completion-powershell.snap b/cli/azd/cmd/testdata/TestUsage-azd-completion-powershell.snap index 9fd63435228..1612a4ce62e 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-completion-powershell.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-completion-powershell.snap @@ -9,6 +9,7 @@ Global Flags --debug : Enables debugging and diagnostics logging. --docs : Opens the documentation for azd completion powershell in your web browser. -e, --environment string : The name of the environment to use. + --fail-on-prompt : Fails with an actionable error whenever a prompt is encountered, even if a default exists. Implies --no-prompt. -h, --help : Gets help for powershell. --no-prompt : Accepts the default value instead of prompting, or it fails if there is no default. diff --git a/cli/azd/cmd/testdata/TestUsage-azd-completion-zsh.snap b/cli/azd/cmd/testdata/TestUsage-azd-completion-zsh.snap index 1963126b802..a3ea19d974f 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-completion-zsh.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-completion-zsh.snap @@ -13,6 +13,7 @@ Global Flags --debug : Enables debugging and diagnostics logging. --docs : Opens the documentation for azd completion zsh in your web browser. -e, --environment string : The name of the environment to use. + --fail-on-prompt : Fails with an actionable error whenever a prompt is encountered, even if a default exists. Implies --no-prompt. -h, --help : Gets help for zsh. --no-prompt : Accepts the default value instead of prompting, or it fails if there is no default. diff --git a/cli/azd/cmd/testdata/TestUsage-azd-completion.snap b/cli/azd/cmd/testdata/TestUsage-azd-completion.snap index 36db73ecdee..be910b93be3 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-completion.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-completion.snap @@ -16,6 +16,7 @@ Global Flags --debug : Enables debugging and diagnostics logging. --docs : Opens the documentation for azd completion in your web browser. -e, --environment string : The name of the environment to use. + --fail-on-prompt : Fails with an actionable error whenever a prompt is encountered, even if a default exists. Implies --no-prompt. -h, --help : Gets help for completion. --no-prompt : Accepts the default value instead of prompting, or it fails if there is no default. diff --git a/cli/azd/cmd/testdata/TestUsage-azd-concurx.snap b/cli/azd/cmd/testdata/TestUsage-azd-concurx.snap index 8e8936fc252..e0b76672a27 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-concurx.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-concurx.snap @@ -9,6 +9,7 @@ Global Flags --debug : Enables debugging and diagnostics logging. --docs : Opens the documentation for azd concurx in your web browser. -e, --environment string : The name of the environment to use. + --fail-on-prompt : Fails with an actionable error whenever a prompt is encountered, even if a default exists. Implies --no-prompt. -h, --help : Gets help for concurx. --no-prompt : Accepts the default value instead of prompting, or it fails if there is no default. diff --git a/cli/azd/cmd/testdata/TestUsage-azd-config-get.snap b/cli/azd/cmd/testdata/TestUsage-azd-config-get.snap index 33fdd98a47c..c7cfb9f030c 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-config-get.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-config-get.snap @@ -9,6 +9,7 @@ Global Flags --debug : Enables debugging and diagnostics logging. --docs : Opens the documentation for azd config get in your web browser. -e, --environment string : The name of the environment to use. + --fail-on-prompt : Fails with an actionable error whenever a prompt is encountered, even if a default exists. Implies --no-prompt. -h, --help : Gets help for get. --no-prompt : Accepts the default value instead of prompting, or it fails if there is no default. diff --git a/cli/azd/cmd/testdata/TestUsage-azd-config-list-alpha.snap b/cli/azd/cmd/testdata/TestUsage-azd-config-list-alpha.snap index 0094122eaf0..e7f97812c84 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-config-list-alpha.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-config-list-alpha.snap @@ -9,6 +9,7 @@ Global Flags --debug : Enables debugging and diagnostics logging. --docs : Opens the documentation for azd config list-alpha in your web browser. -e, --environment string : The name of the environment to use. + --fail-on-prompt : Fails with an actionable error whenever a prompt is encountered, even if a default exists. Implies --no-prompt. -h, --help : Gets help for list-alpha. --no-prompt : Accepts the default value instead of prompting, or it fails if there is no default. diff --git a/cli/azd/cmd/testdata/TestUsage-azd-config-options.snap b/cli/azd/cmd/testdata/TestUsage-azd-config-options.snap index 8fa858952df..4315ff971ec 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-config-options.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-config-options.snap @@ -9,6 +9,7 @@ Global Flags --debug : Enables debugging and diagnostics logging. --docs : Opens the documentation for azd config options in your web browser. -e, --environment string : The name of the environment to use. + --fail-on-prompt : Fails with an actionable error whenever a prompt is encountered, even if a default exists. Implies --no-prompt. -h, --help : Gets help for options. --no-prompt : Accepts the default value instead of prompting, or it fails if there is no default. diff --git a/cli/azd/cmd/testdata/TestUsage-azd-config-reset.snap b/cli/azd/cmd/testdata/TestUsage-azd-config-reset.snap index 83c41f51be0..5897dc3a9e8 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-config-reset.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-config-reset.snap @@ -12,6 +12,7 @@ Global Flags --debug : Enables debugging and diagnostics logging. --docs : Opens the documentation for azd config reset in your web browser. -e, --environment string : The name of the environment to use. + --fail-on-prompt : Fails with an actionable error whenever a prompt is encountered, even if a default exists. Implies --no-prompt. -h, --help : Gets help for reset. --no-prompt : Accepts the default value instead of prompting, or it fails if there is no default. diff --git a/cli/azd/cmd/testdata/TestUsage-azd-config-set.snap b/cli/azd/cmd/testdata/TestUsage-azd-config-set.snap index 1c0bf8acbb3..8eb0fc7743c 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-config-set.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-config-set.snap @@ -9,6 +9,7 @@ Global Flags --debug : Enables debugging and diagnostics logging. --docs : Opens the documentation for azd config set in your web browser. -e, --environment string : The name of the environment to use. + --fail-on-prompt : Fails with an actionable error whenever a prompt is encountered, even if a default exists. Implies --no-prompt. -h, --help : Gets help for set. --no-prompt : Accepts the default value instead of prompting, or it fails if there is no default. diff --git a/cli/azd/cmd/testdata/TestUsage-azd-config-show.snap b/cli/azd/cmd/testdata/TestUsage-azd-config-show.snap index 518483f35ea..1414de1b579 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-config-show.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-config-show.snap @@ -9,6 +9,7 @@ Global Flags --debug : Enables debugging and diagnostics logging. --docs : Opens the documentation for azd config show in your web browser. -e, --environment string : The name of the environment to use. + --fail-on-prompt : Fails with an actionable error whenever a prompt is encountered, even if a default exists. Implies --no-prompt. -h, --help : Gets help for show. --no-prompt : Accepts the default value instead of prompting, or it fails if there is no default. diff --git a/cli/azd/cmd/testdata/TestUsage-azd-config-unset.snap b/cli/azd/cmd/testdata/TestUsage-azd-config-unset.snap index 14bc744972c..f97dbb04acb 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-config-unset.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-config-unset.snap @@ -9,6 +9,7 @@ Global Flags --debug : Enables debugging and diagnostics logging. --docs : Opens the documentation for azd config unset in your web browser. -e, --environment string : The name of the environment to use. + --fail-on-prompt : Fails with an actionable error whenever a prompt is encountered, even if a default exists. Implies --no-prompt. -h, --help : Gets help for unset. --no-prompt : Accepts the default value instead of prompting, or it fails if there is no default. diff --git a/cli/azd/cmd/testdata/TestUsage-azd-config.snap b/cli/azd/cmd/testdata/TestUsage-azd-config.snap index c6812a024f5..d29ec5d111b 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-config.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-config.snap @@ -22,6 +22,7 @@ Global Flags --debug : Enables debugging and diagnostics logging. --docs : Opens the documentation for azd config in your web browser. -e, --environment string : The name of the environment to use. + --fail-on-prompt : Fails with an actionable error whenever a prompt is encountered, even if a default exists. Implies --no-prompt. -h, --help : Gets help for config. --no-prompt : Accepts the default value instead of prompting, or it fails if there is no default. diff --git a/cli/azd/cmd/testdata/TestUsage-azd-copilot-consent-grant.snap b/cli/azd/cmd/testdata/TestUsage-azd-copilot-consent-grant.snap index 0d99f6023b7..7134ad3b708 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-copilot-consent-grant.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-copilot-consent-grant.snap @@ -18,6 +18,7 @@ Global Flags --debug : Enables debugging and diagnostics logging. --docs : Opens the documentation for azd copilot consent grant in your web browser. -e, --environment string : The name of the environment to use. + --fail-on-prompt : Fails with an actionable error whenever a prompt is encountered, even if a default exists. Implies --no-prompt. -h, --help : Gets help for grant. --no-prompt : Accepts the default value instead of prompting, or it fails if there is no default. diff --git a/cli/azd/cmd/testdata/TestUsage-azd-copilot-consent-list.snap b/cli/azd/cmd/testdata/TestUsage-azd-copilot-consent-list.snap index a42511a47d9..09fa6bf49bb 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-copilot-consent-list.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-copilot-consent-list.snap @@ -16,6 +16,7 @@ Global Flags --debug : Enables debugging and diagnostics logging. --docs : Opens the documentation for azd copilot consent list in your web browser. -e, --environment string : The name of the environment to use. + --fail-on-prompt : Fails with an actionable error whenever a prompt is encountered, even if a default exists. Implies --no-prompt. -h, --help : Gets help for list. --no-prompt : Accepts the default value instead of prompting, or it fails if there is no default. diff --git a/cli/azd/cmd/testdata/TestUsage-azd-copilot-consent-revoke.snap b/cli/azd/cmd/testdata/TestUsage-azd-copilot-consent-revoke.snap index 2997175ea57..303b92d136a 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-copilot-consent-revoke.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-copilot-consent-revoke.snap @@ -16,6 +16,7 @@ Global Flags --debug : Enables debugging and diagnostics logging. --docs : Opens the documentation for azd copilot consent revoke in your web browser. -e, --environment string : The name of the environment to use. + --fail-on-prompt : Fails with an actionable error whenever a prompt is encountered, even if a default exists. Implies --no-prompt. -h, --help : Gets help for revoke. --no-prompt : Accepts the default value instead of prompting, or it fails if there is no default. diff --git a/cli/azd/cmd/testdata/TestUsage-azd-copilot-consent.snap b/cli/azd/cmd/testdata/TestUsage-azd-copilot-consent.snap index 752b63165da..fd7c46e1b9b 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-copilot-consent.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-copilot-consent.snap @@ -14,6 +14,7 @@ Global Flags --debug : Enables debugging and diagnostics logging. --docs : Opens the documentation for azd copilot consent in your web browser. -e, --environment string : The name of the environment to use. + --fail-on-prompt : Fails with an actionable error whenever a prompt is encountered, even if a default exists. Implies --no-prompt. -h, --help : Gets help for consent. --no-prompt : Accepts the default value instead of prompting, or it fails if there is no default. diff --git a/cli/azd/cmd/testdata/TestUsage-azd-copilot.snap b/cli/azd/cmd/testdata/TestUsage-azd-copilot.snap index 337ebacf80f..b5dcb796650 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-copilot.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-copilot.snap @@ -12,6 +12,7 @@ Global Flags --debug : Enables debugging and diagnostics logging. --docs : Opens the documentation for azd copilot in your web browser. -e, --environment string : The name of the environment to use. + --fail-on-prompt : Fails with an actionable error whenever a prompt is encountered, even if a default exists. Implies --no-prompt. -h, --help : Gets help for copilot. --no-prompt : Accepts the default value instead of prompting, or it fails if there is no default. diff --git a/cli/azd/cmd/testdata/TestUsage-azd-demo.snap b/cli/azd/cmd/testdata/TestUsage-azd-demo.snap index e55fe63154a..8d8f255bbe5 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-demo.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-demo.snap @@ -9,6 +9,7 @@ Global Flags --debug : Enables debugging and diagnostics logging. --docs : Opens the documentation for azd demo in your web browser. -e, --environment string : The name of the environment to use. + --fail-on-prompt : Fails with an actionable error whenever a prompt is encountered, even if a default exists. Implies --no-prompt. -h, --help : Gets help for demo. --no-prompt : Accepts the default value instead of prompting, or it fails if there is no default. diff --git a/cli/azd/cmd/testdata/TestUsage-azd-deploy.snap b/cli/azd/cmd/testdata/TestUsage-azd-deploy.snap index 9affa80b9e2..4c48b027a63 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-deploy.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-deploy.snap @@ -15,11 +15,12 @@ Flags --timeout int : Maximum time in seconds for azd to wait for each service deployment. This stops azd from waiting but does not cancel the Azure-side deployment. (default: 1200) Global Flags - -C, --cwd string : Sets the current working directory. - --debug : Enables debugging and diagnostics logging. - --docs : Opens the documentation for azd deploy in your web browser. - -h, --help : Gets help for deploy. - --no-prompt : Accepts the default value instead of prompting, or it fails if there is no default. + -C, --cwd string : Sets the current working directory. + --debug : Enables debugging and diagnostics logging. + --docs : Opens the documentation for azd deploy in your web browser. + --fail-on-prompt : Fails with an actionable error whenever a prompt is encountered, even if a default exists. Implies --no-prompt. + -h, --help : Gets help for deploy. + --no-prompt : Accepts the default value instead of prompting, or it fails if there is no default. Examples Deploy all services in the current project to Azure. diff --git a/cli/azd/cmd/testdata/TestUsage-azd-down.snap b/cli/azd/cmd/testdata/TestUsage-azd-down.snap index 24a88a1d10f..4afdd9d7637 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-down.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-down.snap @@ -12,11 +12,12 @@ Flags --purge : Does not require confirmation before it permanently deletes resources that are soft-deleted by default (for example, key vaults). Global Flags - -C, --cwd string : Sets the current working directory. - --debug : Enables debugging and diagnostics logging. - --docs : Opens the documentation for azd down in your web browser. - -h, --help : Gets help for down. - --no-prompt : Accepts the default value instead of prompting, or it fails if there is no default. + -C, --cwd string : Sets the current working directory. + --debug : Enables debugging and diagnostics logging. + --docs : Opens the documentation for azd down in your web browser. + --fail-on-prompt : Fails with an actionable error whenever a prompt is encountered, even if a default exists. Implies --no-prompt. + -h, --help : Gets help for down. + --no-prompt : Accepts the default value instead of prompting, or it fails if there is no default. Examples Delete all resources for an application. You will be prompted to confirm your decision. diff --git a/cli/azd/cmd/testdata/TestUsage-azd-env-config-get.snap b/cli/azd/cmd/testdata/TestUsage-azd-env-config-get.snap index e0f5e0b8ca3..6686ce80b5c 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-env-config-get.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-env-config-get.snap @@ -8,11 +8,12 @@ Flags -e, --environment string : The name of the environment to use. Global Flags - -C, --cwd string : Sets the current working directory. - --debug : Enables debugging and diagnostics logging. - --docs : Opens the documentation for azd env config get in your web browser. - -h, --help : Gets help for get. - --no-prompt : Accepts the default value instead of prompting, or it fails if there is no default. + -C, --cwd string : Sets the current working directory. + --debug : Enables debugging and diagnostics logging. + --docs : Opens the documentation for azd env config get in your web browser. + --fail-on-prompt : Fails with an actionable error whenever a prompt is encountered, even if a default exists. Implies --no-prompt. + -h, --help : Gets help for get. + --no-prompt : Accepts the default value instead of prompting, or it fails if there is no default. Find a bug? Want to let us know how we're doing? Fill out this brief survey: https://aka.ms/azure-dev/hats. diff --git a/cli/azd/cmd/testdata/TestUsage-azd-env-config-set.snap b/cli/azd/cmd/testdata/TestUsage-azd-env-config-set.snap index 1f9f91d4086..06eac800882 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-env-config-set.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-env-config-set.snap @@ -8,11 +8,12 @@ Flags -e, --environment string : The name of the environment to use. Global Flags - -C, --cwd string : Sets the current working directory. - --debug : Enables debugging and diagnostics logging. - --docs : Opens the documentation for azd env config set in your web browser. - -h, --help : Gets help for set. - --no-prompt : Accepts the default value instead of prompting, or it fails if there is no default. + -C, --cwd string : Sets the current working directory. + --debug : Enables debugging and diagnostics logging. + --docs : Opens the documentation for azd env config set in your web browser. + --fail-on-prompt : Fails with an actionable error whenever a prompt is encountered, even if a default exists. Implies --no-prompt. + -h, --help : Gets help for set. + --no-prompt : Accepts the default value instead of prompting, or it fails if there is no default. Find a bug? Want to let us know how we're doing? Fill out this brief survey: https://aka.ms/azure-dev/hats. diff --git a/cli/azd/cmd/testdata/TestUsage-azd-env-config-unset.snap b/cli/azd/cmd/testdata/TestUsage-azd-env-config-unset.snap index 8d6934bfcef..6d48c3812be 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-env-config-unset.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-env-config-unset.snap @@ -8,11 +8,12 @@ Flags -e, --environment string : The name of the environment to use. Global Flags - -C, --cwd string : Sets the current working directory. - --debug : Enables debugging and diagnostics logging. - --docs : Opens the documentation for azd env config unset in your web browser. - -h, --help : Gets help for unset. - --no-prompt : Accepts the default value instead of prompting, or it fails if there is no default. + -C, --cwd string : Sets the current working directory. + --debug : Enables debugging and diagnostics logging. + --docs : Opens the documentation for azd env config unset in your web browser. + --fail-on-prompt : Fails with an actionable error whenever a prompt is encountered, even if a default exists. Implies --no-prompt. + -h, --help : Gets help for unset. + --no-prompt : Accepts the default value instead of prompting, or it fails if there is no default. Find a bug? Want to let us know how we're doing? Fill out this brief survey: https://aka.ms/azure-dev/hats. diff --git a/cli/azd/cmd/testdata/TestUsage-azd-env-config.snap b/cli/azd/cmd/testdata/TestUsage-azd-env-config.snap index 1d45f651488..5ee3f034a1a 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-env-config.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-env-config.snap @@ -18,6 +18,7 @@ Global Flags --debug : Enables debugging and diagnostics logging. --docs : Opens the documentation for azd env config in your web browser. -e, --environment string : The name of the environment to use. + --fail-on-prompt : Fails with an actionable error whenever a prompt is encountered, even if a default exists. Implies --no-prompt. -h, --help : Gets help for config. --no-prompt : Accepts the default value instead of prompting, or it fails if there is no default. diff --git a/cli/azd/cmd/testdata/TestUsage-azd-env-get-value.snap b/cli/azd/cmd/testdata/TestUsage-azd-env-get-value.snap index fc6d79d8ef2..a8ed464d4ad 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-env-get-value.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-env-get-value.snap @@ -8,11 +8,12 @@ Flags -e, --environment string : The name of the environment to use. Global Flags - -C, --cwd string : Sets the current working directory. - --debug : Enables debugging and diagnostics logging. - --docs : Opens the documentation for azd env get-value in your web browser. - -h, --help : Gets help for get-value. - --no-prompt : Accepts the default value instead of prompting, or it fails if there is no default. + -C, --cwd string : Sets the current working directory. + --debug : Enables debugging and diagnostics logging. + --docs : Opens the documentation for azd env get-value in your web browser. + --fail-on-prompt : Fails with an actionable error whenever a prompt is encountered, even if a default exists. Implies --no-prompt. + -h, --help : Gets help for get-value. + --no-prompt : Accepts the default value instead of prompting, or it fails if there is no default. Find a bug? Want to let us know how we're doing? Fill out this brief survey: https://aka.ms/azure-dev/hats. diff --git a/cli/azd/cmd/testdata/TestUsage-azd-env-get-values.snap b/cli/azd/cmd/testdata/TestUsage-azd-env-get-values.snap index 7c8296ba56d..db3517b4389 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-env-get-values.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-env-get-values.snap @@ -8,11 +8,12 @@ Flags -e, --environment string : The name of the environment to use. Global Flags - -C, --cwd string : Sets the current working directory. - --debug : Enables debugging and diagnostics logging. - --docs : Opens the documentation for azd env get-values in your web browser. - -h, --help : Gets help for get-values. - --no-prompt : Accepts the default value instead of prompting, or it fails if there is no default. + -C, --cwd string : Sets the current working directory. + --debug : Enables debugging and diagnostics logging. + --docs : Opens the documentation for azd env get-values in your web browser. + --fail-on-prompt : Fails with an actionable error whenever a prompt is encountered, even if a default exists. Implies --no-prompt. + -h, --help : Gets help for get-values. + --no-prompt : Accepts the default value instead of prompting, or it fails if there is no default. Find a bug? Want to let us know how we're doing? Fill out this brief survey: https://aka.ms/azure-dev/hats. diff --git a/cli/azd/cmd/testdata/TestUsage-azd-env-list.snap b/cli/azd/cmd/testdata/TestUsage-azd-env-list.snap index abadf8f0286..f9de285d4ad 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-env-list.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-env-list.snap @@ -9,6 +9,7 @@ Global Flags --debug : Enables debugging and diagnostics logging. --docs : Opens the documentation for azd env list in your web browser. -e, --environment string : The name of the environment to use. + --fail-on-prompt : Fails with an actionable error whenever a prompt is encountered, even if a default exists. Implies --no-prompt. -h, --help : Gets help for list. --no-prompt : Accepts the default value instead of prompting, or it fails if there is no default. diff --git a/cli/azd/cmd/testdata/TestUsage-azd-env-new.snap b/cli/azd/cmd/testdata/TestUsage-azd-env-new.snap index 5ff6986685b..5b5d1393c74 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-env-new.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-env-new.snap @@ -13,6 +13,7 @@ Global Flags --debug : Enables debugging and diagnostics logging. --docs : Opens the documentation for azd env new in your web browser. -e, --environment string : The name of the environment to use. + --fail-on-prompt : Fails with an actionable error whenever a prompt is encountered, even if a default exists. Implies --no-prompt. -h, --help : Gets help for new. --no-prompt : Accepts the default value instead of prompting, or it fails if there is no default. diff --git a/cli/azd/cmd/testdata/TestUsage-azd-env-refresh.snap b/cli/azd/cmd/testdata/TestUsage-azd-env-refresh.snap index 786ba5faf86..7e7c27cb464 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-env-refresh.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-env-refresh.snap @@ -10,11 +10,12 @@ Flags --layer string : Provisioning layer to refresh the environment from. Global Flags - -C, --cwd string : Sets the current working directory. - --debug : Enables debugging and diagnostics logging. - --docs : Opens the documentation for azd env refresh in your web browser. - -h, --help : Gets help for refresh. - --no-prompt : Accepts the default value instead of prompting, or it fails if there is no default. + -C, --cwd string : Sets the current working directory. + --debug : Enables debugging and diagnostics logging. + --docs : Opens the documentation for azd env refresh in your web browser. + --fail-on-prompt : Fails with an actionable error whenever a prompt is encountered, even if a default exists. Implies --no-prompt. + -h, --help : Gets help for refresh. + --no-prompt : Accepts the default value instead of prompting, or it fails if there is no default. Find a bug? Want to let us know how we're doing? Fill out this brief survey: https://aka.ms/azure-dev/hats. diff --git a/cli/azd/cmd/testdata/TestUsage-azd-env-remove.snap b/cli/azd/cmd/testdata/TestUsage-azd-env-remove.snap index 06a4ffc0f84..ce9b4e5b2d1 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-env-remove.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-env-remove.snap @@ -12,11 +12,12 @@ Flags --force : Skips confirmation before performing removal. Global Flags - -C, --cwd string : Sets the current working directory. - --debug : Enables debugging and diagnostics logging. - --docs : Opens the documentation for azd env remove in your web browser. - -h, --help : Gets help for remove. - --no-prompt : Accepts the default value instead of prompting, or it fails if there is no default. + -C, --cwd string : Sets the current working directory. + --debug : Enables debugging and diagnostics logging. + --docs : Opens the documentation for azd env remove in your web browser. + --fail-on-prompt : Fails with an actionable error whenever a prompt is encountered, even if a default exists. Implies --no-prompt. + -h, --help : Gets help for remove. + --no-prompt : Accepts the default value instead of prompting, or it fails if there is no default. Find a bug? Want to let us know how we're doing? Fill out this brief survey: https://aka.ms/azure-dev/hats. diff --git a/cli/azd/cmd/testdata/TestUsage-azd-env-select.snap b/cli/azd/cmd/testdata/TestUsage-azd-env-select.snap index 65b2075488f..fb045dfd8f9 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-env-select.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-env-select.snap @@ -9,6 +9,7 @@ Global Flags --debug : Enables debugging and diagnostics logging. --docs : Opens the documentation for azd env select in your web browser. -e, --environment string : The name of the environment to use. + --fail-on-prompt : Fails with an actionable error whenever a prompt is encountered, even if a default exists. Implies --no-prompt. -h, --help : Gets help for select. --no-prompt : Accepts the default value instead of prompting, or it fails if there is no default. diff --git a/cli/azd/cmd/testdata/TestUsage-azd-env-set-secret.snap b/cli/azd/cmd/testdata/TestUsage-azd-env-set-secret.snap index 6fa73e3fa94..5e805704e58 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-env-set-secret.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-env-set-secret.snap @@ -8,11 +8,12 @@ Flags -e, --environment string : The name of the environment to use. Global Flags - -C, --cwd string : Sets the current working directory. - --debug : Enables debugging and diagnostics logging. - --docs : Opens the documentation for azd env set-secret in your web browser. - -h, --help : Gets help for set-secret. - --no-prompt : Accepts the default value instead of prompting, or it fails if there is no default. + -C, --cwd string : Sets the current working directory. + --debug : Enables debugging and diagnostics logging. + --docs : Opens the documentation for azd env set-secret in your web browser. + --fail-on-prompt : Fails with an actionable error whenever a prompt is encountered, even if a default exists. Implies --no-prompt. + -h, --help : Gets help for set-secret. + --no-prompt : Accepts the default value instead of prompting, or it fails if there is no default. Find a bug? Want to let us know how we're doing? Fill out this brief survey: https://aka.ms/azure-dev/hats. diff --git a/cli/azd/cmd/testdata/TestUsage-azd-env-set.snap b/cli/azd/cmd/testdata/TestUsage-azd-env-set.snap index 038d32ce199..67fceaa283e 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-env-set.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-env-set.snap @@ -9,11 +9,12 @@ Flags --file string : Path to .env formatted file to load environment values from. Global Flags - -C, --cwd string : Sets the current working directory. - --debug : Enables debugging and diagnostics logging. - --docs : Opens the documentation for azd env set in your web browser. - -h, --help : Gets help for set. - --no-prompt : Accepts the default value instead of prompting, or it fails if there is no default. + -C, --cwd string : Sets the current working directory. + --debug : Enables debugging and diagnostics logging. + --docs : Opens the documentation for azd env set in your web browser. + --fail-on-prompt : Fails with an actionable error whenever a prompt is encountered, even if a default exists. Implies --no-prompt. + -h, --help : Gets help for set. + --no-prompt : Accepts the default value instead of prompting, or it fails if there is no default. Find a bug? Want to let us know how we're doing? Fill out this brief survey: https://aka.ms/azure-dev/hats. diff --git a/cli/azd/cmd/testdata/TestUsage-azd-env.snap b/cli/azd/cmd/testdata/TestUsage-azd-env.snap index 78060906ebe..fff45bb8bfc 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-env.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-env.snap @@ -26,6 +26,7 @@ Global Flags --debug : Enables debugging and diagnostics logging. --docs : Opens the documentation for azd env in your web browser. -e, --environment string : The name of the environment to use. + --fail-on-prompt : Fails with an actionable error whenever a prompt is encountered, even if a default exists. Implies --no-prompt. -h, --help : Gets help for env. --no-prompt : Accepts the default value instead of prompting, or it fails if there is no default. diff --git a/cli/azd/cmd/testdata/TestUsage-azd-extension-install.snap b/cli/azd/cmd/testdata/TestUsage-azd-extension-install.snap index 5992ce8d59f..940fe467882 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-extension-install.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-extension-install.snap @@ -14,6 +14,7 @@ Global Flags --debug : Enables debugging and diagnostics logging. --docs : Opens the documentation for azd extension install in your web browser. -e, --environment string : The name of the environment to use. + --fail-on-prompt : Fails with an actionable error whenever a prompt is encountered, even if a default exists. Implies --no-prompt. -h, --help : Gets help for install. --no-prompt : Accepts the default value instead of prompting, or it fails if there is no default. diff --git a/cli/azd/cmd/testdata/TestUsage-azd-extension-list.snap b/cli/azd/cmd/testdata/TestUsage-azd-extension-list.snap index 6b036f31527..417a17451bd 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-extension-list.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-extension-list.snap @@ -14,6 +14,7 @@ Global Flags --debug : Enables debugging and diagnostics logging. --docs : Opens the documentation for azd extension list in your web browser. -e, --environment string : The name of the environment to use. + --fail-on-prompt : Fails with an actionable error whenever a prompt is encountered, even if a default exists. Implies --no-prompt. -h, --help : Gets help for list. --no-prompt : Accepts the default value instead of prompting, or it fails if there is no default. diff --git a/cli/azd/cmd/testdata/TestUsage-azd-extension-show.snap b/cli/azd/cmd/testdata/TestUsage-azd-extension-show.snap index 5be9f3a34e6..c0fd325e0a5 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-extension-show.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-extension-show.snap @@ -12,6 +12,7 @@ Global Flags --debug : Enables debugging and diagnostics logging. --docs : Opens the documentation for azd extension show in your web browser. -e, --environment string : The name of the environment to use. + --fail-on-prompt : Fails with an actionable error whenever a prompt is encountered, even if a default exists. Implies --no-prompt. -h, --help : Gets help for show. --no-prompt : Accepts the default value instead of prompting, or it fails if there is no default. diff --git a/cli/azd/cmd/testdata/TestUsage-azd-extension-source-add.snap b/cli/azd/cmd/testdata/TestUsage-azd-extension-source-add.snap index 94783cf2ed0..23bf1b38943 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-extension-source-add.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-extension-source-add.snap @@ -14,6 +14,7 @@ Global Flags --debug : Enables debugging and diagnostics logging. --docs : Opens the documentation for azd extension source add in your web browser. -e, --environment string : The name of the environment to use. + --fail-on-prompt : Fails with an actionable error whenever a prompt is encountered, even if a default exists. Implies --no-prompt. -h, --help : Gets help for add. --no-prompt : Accepts the default value instead of prompting, or it fails if there is no default. diff --git a/cli/azd/cmd/testdata/TestUsage-azd-extension-source-list.snap b/cli/azd/cmd/testdata/TestUsage-azd-extension-source-list.snap index c7f3f5d83aa..073f52f49af 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-extension-source-list.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-extension-source-list.snap @@ -9,6 +9,7 @@ Global Flags --debug : Enables debugging and diagnostics logging. --docs : Opens the documentation for azd extension source list in your web browser. -e, --environment string : The name of the environment to use. + --fail-on-prompt : Fails with an actionable error whenever a prompt is encountered, even if a default exists. Implies --no-prompt. -h, --help : Gets help for list. --no-prompt : Accepts the default value instead of prompting, or it fails if there is no default. diff --git a/cli/azd/cmd/testdata/TestUsage-azd-extension-source-remove.snap b/cli/azd/cmd/testdata/TestUsage-azd-extension-source-remove.snap index 8fc14987e22..bcd02df5fe4 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-extension-source-remove.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-extension-source-remove.snap @@ -9,6 +9,7 @@ Global Flags --debug : Enables debugging and diagnostics logging. --docs : Opens the documentation for azd extension source remove in your web browser. -e, --environment string : The name of the environment to use. + --fail-on-prompt : Fails with an actionable error whenever a prompt is encountered, even if a default exists. Implies --no-prompt. -h, --help : Gets help for remove. --no-prompt : Accepts the default value instead of prompting, or it fails if there is no default. diff --git a/cli/azd/cmd/testdata/TestUsage-azd-extension-source-validate.snap b/cli/azd/cmd/testdata/TestUsage-azd-extension-source-validate.snap index e8aadf6bbd2..f1c8e6a3fe8 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-extension-source-validate.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-extension-source-validate.snap @@ -12,6 +12,7 @@ Global Flags --debug : Enables debugging and diagnostics logging. --docs : Opens the documentation for azd extension source validate in your web browser. -e, --environment string : The name of the environment to use. + --fail-on-prompt : Fails with an actionable error whenever a prompt is encountered, even if a default exists. Implies --no-prompt. -h, --help : Gets help for validate. --no-prompt : Accepts the default value instead of prompting, or it fails if there is no default. diff --git a/cli/azd/cmd/testdata/TestUsage-azd-extension-source.snap b/cli/azd/cmd/testdata/TestUsage-azd-extension-source.snap index 706d16fb3ea..d3cdbb45e91 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-extension-source.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-extension-source.snap @@ -15,6 +15,7 @@ Global Flags --debug : Enables debugging and diagnostics logging. --docs : Opens the documentation for azd extension source in your web browser. -e, --environment string : The name of the environment to use. + --fail-on-prompt : Fails with an actionable error whenever a prompt is encountered, even if a default exists. Implies --no-prompt. -h, --help : Gets help for source. --no-prompt : Accepts the default value instead of prompting, or it fails if there is no default. diff --git a/cli/azd/cmd/testdata/TestUsage-azd-extension-uninstall.snap b/cli/azd/cmd/testdata/TestUsage-azd-extension-uninstall.snap index 2f5362e7d64..3d45250250c 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-extension-uninstall.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-extension-uninstall.snap @@ -12,6 +12,7 @@ Global Flags --debug : Enables debugging and diagnostics logging. --docs : Opens the documentation for azd extension uninstall in your web browser. -e, --environment string : The name of the environment to use. + --fail-on-prompt : Fails with an actionable error whenever a prompt is encountered, even if a default exists. Implies --no-prompt. -h, --help : Gets help for uninstall. --no-prompt : Accepts the default value instead of prompting, or it fails if there is no default. diff --git a/cli/azd/cmd/testdata/TestUsage-azd-extension-upgrade.snap b/cli/azd/cmd/testdata/TestUsage-azd-extension-upgrade.snap index aa0c8a0bc75..8d185283edf 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-extension-upgrade.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-extension-upgrade.snap @@ -14,6 +14,7 @@ Global Flags --debug : Enables debugging and diagnostics logging. --docs : Opens the documentation for azd extension upgrade in your web browser. -e, --environment string : The name of the environment to use. + --fail-on-prompt : Fails with an actionable error whenever a prompt is encountered, even if a default exists. Implies --no-prompt. -h, --help : Gets help for upgrade. --no-prompt : Accepts the default value instead of prompting, or it fails if there is no default. diff --git a/cli/azd/cmd/testdata/TestUsage-azd-extension.snap b/cli/azd/cmd/testdata/TestUsage-azd-extension.snap index e22ac3e811b..942579e4667 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-extension.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-extension.snap @@ -17,6 +17,7 @@ Global Flags --debug : Enables debugging and diagnostics logging. --docs : Opens the documentation for azd extension in your web browser. -e, --environment string : The name of the environment to use. + --fail-on-prompt : Fails with an actionable error whenever a prompt is encountered, even if a default exists. Implies --no-prompt. -h, --help : Gets help for extension. --no-prompt : Accepts the default value instead of prompting, or it fails if there is no default. diff --git a/cli/azd/cmd/testdata/TestUsage-azd-hooks-run.snap b/cli/azd/cmd/testdata/TestUsage-azd-hooks-run.snap index 323709bfe38..0e8e9884b58 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-hooks-run.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-hooks-run.snap @@ -10,11 +10,12 @@ Flags --service string : Only runs hooks for the specified service. Global Flags - -C, --cwd string : Sets the current working directory. - --debug : Enables debugging and diagnostics logging. - --docs : Opens the documentation for azd hooks run in your web browser. - -h, --help : Gets help for run. - --no-prompt : Accepts the default value instead of prompting, or it fails if there is no default. + -C, --cwd string : Sets the current working directory. + --debug : Enables debugging and diagnostics logging. + --docs : Opens the documentation for azd hooks run in your web browser. + --fail-on-prompt : Fails with an actionable error whenever a prompt is encountered, even if a default exists. Implies --no-prompt. + -h, --help : Gets help for run. + --no-prompt : Accepts the default value instead of prompting, or it fails if there is no default. Find a bug? Want to let us know how we're doing? Fill out this brief survey: https://aka.ms/azure-dev/hats. diff --git a/cli/azd/cmd/testdata/TestUsage-azd-hooks.snap b/cli/azd/cmd/testdata/TestUsage-azd-hooks.snap index bcca35d7cb7..0c7da0a9baa 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-hooks.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-hooks.snap @@ -12,6 +12,7 @@ Global Flags --debug : Enables debugging and diagnostics logging. --docs : Opens the documentation for azd hooks in your web browser. -e, --environment string : The name of the environment to use. + --fail-on-prompt : Fails with an actionable error whenever a prompt is encountered, even if a default exists. Implies --no-prompt. -h, --help : Gets help for hooks. --no-prompt : Accepts the default value instead of prompting, or it fails if there is no default. diff --git a/cli/azd/cmd/testdata/TestUsage-azd-infra-generate.snap b/cli/azd/cmd/testdata/TestUsage-azd-infra-generate.snap index 8316acc388b..735b340413f 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-infra-generate.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-infra-generate.snap @@ -9,11 +9,12 @@ Flags --force : Overwrite any existing files without prompting Global Flags - -C, --cwd string : Sets the current working directory. - --debug : Enables debugging and diagnostics logging. - --docs : Opens the documentation for azd infra generate in your web browser. - -h, --help : Gets help for generate. - --no-prompt : Accepts the default value instead of prompting, or it fails if there is no default. + -C, --cwd string : Sets the current working directory. + --debug : Enables debugging and diagnostics logging. + --docs : Opens the documentation for azd infra generate in your web browser. + --fail-on-prompt : Fails with an actionable error whenever a prompt is encountered, even if a default exists. Implies --no-prompt. + -h, --help : Gets help for generate. + --no-prompt : Accepts the default value instead of prompting, or it fails if there is no default. Find a bug? Want to let us know how we're doing? Fill out this brief survey: https://aka.ms/azure-dev/hats. diff --git a/cli/azd/cmd/testdata/TestUsage-azd-infra.snap b/cli/azd/cmd/testdata/TestUsage-azd-infra.snap index baa85b98824..328bf9c7265 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-infra.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-infra.snap @@ -12,6 +12,7 @@ Global Flags --debug : Enables debugging and diagnostics logging. --docs : Opens the documentation for azd infra in your web browser. -e, --environment string : The name of the environment to use. + --fail-on-prompt : Fails with an actionable error whenever a prompt is encountered, even if a default exists. Implies --no-prompt. -h, --help : Gets help for infra. --no-prompt : Accepts the default value instead of prompting, or it fails if there is no default. diff --git a/cli/azd/cmd/testdata/TestUsage-azd-init.snap b/cli/azd/cmd/testdata/TestUsage-azd-init.snap index 7f09a7a7188..a3cd8efd0a6 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-init.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-init.snap @@ -19,11 +19,12 @@ Flags --up : Provision and deploy to Azure after initializing the project from a template. Global Flags - -C, --cwd string : Sets the current working directory. - --debug : Enables debugging and diagnostics logging. - --docs : Opens the documentation for azd init in your web browser. - -h, --help : Gets help for init. - --no-prompt : Accepts the default value instead of prompting, or it fails if there is no default. + -C, --cwd string : Sets the current working directory. + --debug : Enables debugging and diagnostics logging. + --docs : Opens the documentation for azd init in your web browser. + --fail-on-prompt : Fails with an actionable error whenever a prompt is encountered, even if a default exists. Implies --no-prompt. + -h, --help : Gets help for init. + --no-prompt : Accepts the default value instead of prompting, or it fails if there is no default. Examples Initialize a template to your current local directory from a GitHub repo. diff --git a/cli/azd/cmd/testdata/TestUsage-azd-mcp-start.snap b/cli/azd/cmd/testdata/TestUsage-azd-mcp-start.snap index e939d3cd760..582692ba1f7 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-mcp-start.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-mcp-start.snap @@ -9,6 +9,7 @@ Global Flags --debug : Enables debugging and diagnostics logging. --docs : Opens the documentation for azd mcp start in your web browser. -e, --environment string : The name of the environment to use. + --fail-on-prompt : Fails with an actionable error whenever a prompt is encountered, even if a default exists. Implies --no-prompt. -h, --help : Gets help for start. --no-prompt : Accepts the default value instead of prompting, or it fails if there is no default. diff --git a/cli/azd/cmd/testdata/TestUsage-azd-mcp.snap b/cli/azd/cmd/testdata/TestUsage-azd-mcp.snap index f4ffa5d3f99..4b405b181e0 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-mcp.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-mcp.snap @@ -12,6 +12,7 @@ Global Flags --debug : Enables debugging and diagnostics logging. --docs : Opens the documentation for azd mcp in your web browser. -e, --environment string : The name of the environment to use. + --fail-on-prompt : Fails with an actionable error whenever a prompt is encountered, even if a default exists. Implies --no-prompt. -h, --help : Gets help for mcp. --no-prompt : Accepts the default value instead of prompting, or it fails if there is no default. diff --git a/cli/azd/cmd/testdata/TestUsage-azd-monitor.snap b/cli/azd/cmd/testdata/TestUsage-azd-monitor.snap index b3a61421a00..8775592c866 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-monitor.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-monitor.snap @@ -11,11 +11,12 @@ Flags --overview : Open a browser to Application Insights Overview Dashboard. Global Flags - -C, --cwd string : Sets the current working directory. - --debug : Enables debugging and diagnostics logging. - --docs : Opens the documentation for azd monitor in your web browser. - -h, --help : Gets help for monitor. - --no-prompt : Accepts the default value instead of prompting, or it fails if there is no default. + -C, --cwd string : Sets the current working directory. + --debug : Enables debugging and diagnostics logging. + --docs : Opens the documentation for azd monitor in your web browser. + --fail-on-prompt : Fails with an actionable error whenever a prompt is encountered, even if a default exists. Implies --no-prompt. + -h, --help : Gets help for monitor. + --no-prompt : Accepts the default value instead of prompting, or it fails if there is no default. Examples Open Application Insights Live Metrics. diff --git a/cli/azd/cmd/testdata/TestUsage-azd-package.snap b/cli/azd/cmd/testdata/TestUsage-azd-package.snap index 46e5ed27b47..1e3e3a2ee8d 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-package.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-package.snap @@ -14,11 +14,12 @@ Flags --output-path string : File or folder path where the generated packages will be saved. Global Flags - -C, --cwd string : Sets the current working directory. - --debug : Enables debugging and diagnostics logging. - --docs : Opens the documentation for azd package in your web browser. - -h, --help : Gets help for package. - --no-prompt : Accepts the default value instead of prompting, or it fails if there is no default. + -C, --cwd string : Sets the current working directory. + --debug : Enables debugging and diagnostics logging. + --docs : Opens the documentation for azd package in your web browser. + --fail-on-prompt : Fails with an actionable error whenever a prompt is encountered, even if a default exists. Implies --no-prompt. + -h, --help : Gets help for package. + --no-prompt : Accepts the default value instead of prompting, or it fails if there is no default. Examples Packages all services in the current project to Azure. diff --git a/cli/azd/cmd/testdata/TestUsage-azd-pipeline-config.snap b/cli/azd/cmd/testdata/TestUsage-azd-pipeline-config.snap index 00371f49934..fc63bf5285f 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-pipeline-config.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-pipeline-config.snap @@ -19,11 +19,12 @@ Flags --remote-name string : The name of the git remote to configure the pipeline to run on. Global Flags - -C, --cwd string : Sets the current working directory. - --debug : Enables debugging and diagnostics logging. - --docs : Opens the documentation for azd pipeline config in your web browser. - -h, --help : Gets help for config. - --no-prompt : Accepts the default value instead of prompting, or it fails if there is no default. + -C, --cwd string : Sets the current working directory. + --debug : Enables debugging and diagnostics logging. + --docs : Opens the documentation for azd pipeline config in your web browser. + --fail-on-prompt : Fails with an actionable error whenever a prompt is encountered, even if a default exists. Implies --no-prompt. + -h, --help : Gets help for config. + --no-prompt : Accepts the default value instead of prompting, or it fails if there is no default. Examples Configure a deployment pipeline for 'app-test' environment diff --git a/cli/azd/cmd/testdata/TestUsage-azd-pipeline.snap b/cli/azd/cmd/testdata/TestUsage-azd-pipeline.snap index d6a04b90891..eeda0fced80 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-pipeline.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-pipeline.snap @@ -16,6 +16,7 @@ Global Flags --debug : Enables debugging and diagnostics logging. --docs : Opens the documentation for azd pipeline in your web browser. -e, --environment string : The name of the environment to use. + --fail-on-prompt : Fails with an actionable error whenever a prompt is encountered, even if a default exists. Implies --no-prompt. -h, --help : Gets help for pipeline. --no-prompt : Accepts the default value instead of prompting, or it fails if there is no default. diff --git a/cli/azd/cmd/testdata/TestUsage-azd-provision.snap b/cli/azd/cmd/testdata/TestUsage-azd-provision.snap index 7f18fcae373..c26fe558a7c 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-provision.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-provision.snap @@ -26,11 +26,12 @@ Flags --subscription string : ID of an Azure subscription to use for the new environment Global Flags - -C, --cwd string : Sets the current working directory. - --debug : Enables debugging and diagnostics logging. - --docs : Opens the documentation for azd provision in your web browser. - -h, --help : Gets help for provision. - --no-prompt : Accepts the default value instead of prompting, or it fails if there is no default. + -C, --cwd string : Sets the current working directory. + --debug : Enables debugging and diagnostics logging. + --docs : Opens the documentation for azd provision in your web browser. + --fail-on-prompt : Fails with an actionable error whenever a prompt is encountered, even if a default exists. Implies --no-prompt. + -h, --help : Gets help for provision. + --no-prompt : Accepts the default value instead of prompting, or it fails if there is no default. Find a bug? Want to let us know how we're doing? Fill out this brief survey: https://aka.ms/azure-dev/hats. diff --git a/cli/azd/cmd/testdata/TestUsage-azd-publish.snap b/cli/azd/cmd/testdata/TestUsage-azd-publish.snap index 18b42fc6577..34a523c8a13 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-publish.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-publish.snap @@ -15,11 +15,12 @@ Flags --to string : The target container image in the form '[registry/]repository[:tag]' to publish to. Global Flags - -C, --cwd string : Sets the current working directory. - --debug : Enables debugging and diagnostics logging. - --docs : Opens the documentation for azd publish in your web browser. - -h, --help : Gets help for publish. - --no-prompt : Accepts the default value instead of prompting, or it fails if there is no default. + -C, --cwd string : Sets the current working directory. + --debug : Enables debugging and diagnostics logging. + --docs : Opens the documentation for azd publish in your web browser. + --fail-on-prompt : Fails with an actionable error whenever a prompt is encountered, even if a default exists. Implies --no-prompt. + -h, --help : Gets help for publish. + --no-prompt : Accepts the default value instead of prompting, or it fails if there is no default. Examples Publish all services in the current project. diff --git a/cli/azd/cmd/testdata/TestUsage-azd-restore.snap b/cli/azd/cmd/testdata/TestUsage-azd-restore.snap index 7c571438a97..2a1aca9bb41 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-restore.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-restore.snap @@ -12,11 +12,12 @@ Flags -e, --environment string : The name of the environment to use. Global Flags - -C, --cwd string : Sets the current working directory. - --debug : Enables debugging and diagnostics logging. - --docs : Opens the documentation for azd restore in your web browser. - -h, --help : Gets help for restore. - --no-prompt : Accepts the default value instead of prompting, or it fails if there is no default. + -C, --cwd string : Sets the current working directory. + --debug : Enables debugging and diagnostics logging. + --docs : Opens the documentation for azd restore in your web browser. + --fail-on-prompt : Fails with an actionable error whenever a prompt is encountered, even if a default exists. Implies --no-prompt. + -h, --help : Gets help for restore. + --no-prompt : Accepts the default value instead of prompting, or it fails if there is no default. Examples Downloads and installs a specific application service dependency, Individual services are listed in your azure.yaml file. diff --git a/cli/azd/cmd/testdata/TestUsage-azd-show.snap b/cli/azd/cmd/testdata/TestUsage-azd-show.snap index 45c2db40117..e6166165a7d 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-show.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-show.snap @@ -9,11 +9,12 @@ Flags --show-secrets : Unmask secrets in output. Global Flags - -C, --cwd string : Sets the current working directory. - --debug : Enables debugging and diagnostics logging. - --docs : Opens the documentation for azd show in your web browser. - -h, --help : Gets help for show. - --no-prompt : Accepts the default value instead of prompting, or it fails if there is no default. + -C, --cwd string : Sets the current working directory. + --debug : Enables debugging and diagnostics logging. + --docs : Opens the documentation for azd show in your web browser. + --fail-on-prompt : Fails with an actionable error whenever a prompt is encountered, even if a default exists. Implies --no-prompt. + -h, --help : Gets help for show. + --no-prompt : Accepts the default value instead of prompting, or it fails if there is no default. Find a bug? Want to let us know how we're doing? Fill out this brief survey: https://aka.ms/azure-dev/hats. diff --git a/cli/azd/cmd/testdata/TestUsage-azd-template-list.snap b/cli/azd/cmd/testdata/TestUsage-azd-template-list.snap index cce5d2055db..0adf63e39f3 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-template-list.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-template-list.snap @@ -13,6 +13,7 @@ Global Flags --debug : Enables debugging and diagnostics logging. --docs : Opens the documentation for azd template list in your web browser. -e, --environment string : The name of the environment to use. + --fail-on-prompt : Fails with an actionable error whenever a prompt is encountered, even if a default exists. Implies --no-prompt. -h, --help : Gets help for list. --no-prompt : Accepts the default value instead of prompting, or it fails if there is no default. diff --git a/cli/azd/cmd/testdata/TestUsage-azd-template-show.snap b/cli/azd/cmd/testdata/TestUsage-azd-template-show.snap index e45f70a8d12..b90578bc030 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-template-show.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-template-show.snap @@ -9,6 +9,7 @@ Global Flags --debug : Enables debugging and diagnostics logging. --docs : Opens the documentation for azd template show in your web browser. -e, --environment string : The name of the environment to use. + --fail-on-prompt : Fails with an actionable error whenever a prompt is encountered, even if a default exists. Implies --no-prompt. -h, --help : Gets help for show. --no-prompt : Accepts the default value instead of prompting, or it fails if there is no default. diff --git a/cli/azd/cmd/testdata/TestUsage-azd-template-source-add.snap b/cli/azd/cmd/testdata/TestUsage-azd-template-source-add.snap index 193f36d47d4..2ce6dfce59c 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-template-source-add.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-template-source-add.snap @@ -18,6 +18,7 @@ Global Flags --debug : Enables debugging and diagnostics logging. --docs : Opens the documentation for azd template source add in your web browser. -e, --environment string : The name of the environment to use. + --fail-on-prompt : Fails with an actionable error whenever a prompt is encountered, even if a default exists. Implies --no-prompt. -h, --help : Gets help for add. --no-prompt : Accepts the default value instead of prompting, or it fails if there is no default. diff --git a/cli/azd/cmd/testdata/TestUsage-azd-template-source-list.snap b/cli/azd/cmd/testdata/TestUsage-azd-template-source-list.snap index b7c111e7255..fe106b4893e 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-template-source-list.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-template-source-list.snap @@ -9,6 +9,7 @@ Global Flags --debug : Enables debugging and diagnostics logging. --docs : Opens the documentation for azd template source list in your web browser. -e, --environment string : The name of the environment to use. + --fail-on-prompt : Fails with an actionable error whenever a prompt is encountered, even if a default exists. Implies --no-prompt. -h, --help : Gets help for list. --no-prompt : Accepts the default value instead of prompting, or it fails if there is no default. diff --git a/cli/azd/cmd/testdata/TestUsage-azd-template-source-remove.snap b/cli/azd/cmd/testdata/TestUsage-azd-template-source-remove.snap index 2949735e5ed..2505bb0317c 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-template-source-remove.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-template-source-remove.snap @@ -9,6 +9,7 @@ Global Flags --debug : Enables debugging and diagnostics logging. --docs : Opens the documentation for azd template source remove in your web browser. -e, --environment string : The name of the environment to use. + --fail-on-prompt : Fails with an actionable error whenever a prompt is encountered, even if a default exists. Implies --no-prompt. -h, --help : Gets help for remove. --no-prompt : Accepts the default value instead of prompting, or it fails if there is no default. diff --git a/cli/azd/cmd/testdata/TestUsage-azd-template-source.snap b/cli/azd/cmd/testdata/TestUsage-azd-template-source.snap index 7d938010bb6..ae756ee9c28 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-template-source.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-template-source.snap @@ -17,6 +17,7 @@ Global Flags --debug : Enables debugging and diagnostics logging. --docs : Opens the documentation for azd template source in your web browser. -e, --environment string : The name of the environment to use. + --fail-on-prompt : Fails with an actionable error whenever a prompt is encountered, even if a default exists. Implies --no-prompt. -h, --help : Gets help for source. --no-prompt : Accepts the default value instead of prompting, or it fails if there is no default. diff --git a/cli/azd/cmd/testdata/TestUsage-azd-template.snap b/cli/azd/cmd/testdata/TestUsage-azd-template.snap index 3042858f24c..275124c19dc 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-template.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-template.snap @@ -18,6 +18,7 @@ Global Flags --debug : Enables debugging and diagnostics logging. --docs : Opens the documentation for azd template in your web browser. -e, --environment string : The name of the environment to use. + --fail-on-prompt : Fails with an actionable error whenever a prompt is encountered, even if a default exists. Implies --no-prompt. -h, --help : Gets help for template. --no-prompt : Accepts the default value instead of prompting, or it fails if there is no default. diff --git a/cli/azd/cmd/testdata/TestUsage-azd-up.snap b/cli/azd/cmd/testdata/TestUsage-azd-up.snap index be5be60fa75..a8b22b1d6ae 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-up.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-up.snap @@ -35,11 +35,12 @@ Flags --subscription string : ID of an Azure subscription to use for the new environment Global Flags - -C, --cwd string : Sets the current working directory. - --debug : Enables debugging and diagnostics logging. - --docs : Opens the documentation for azd up in your web browser. - -h, --help : Gets help for up. - --no-prompt : Accepts the default value instead of prompting, or it fails if there is no default. + -C, --cwd string : Sets the current working directory. + --debug : Enables debugging and diagnostics logging. + --docs : Opens the documentation for azd up in your web browser. + --fail-on-prompt : Fails with an actionable error whenever a prompt is encountered, even if a default exists. Implies --no-prompt. + -h, --help : Gets help for up. + --no-prompt : Accepts the default value instead of prompting, or it fails if there is no default. Find a bug? Want to let us know how we're doing? Fill out this brief survey: https://aka.ms/azure-dev/hats. diff --git a/cli/azd/cmd/testdata/TestUsage-azd-version.snap b/cli/azd/cmd/testdata/TestUsage-azd-version.snap index 7a7656aebc8..c5b385c7545 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-version.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-version.snap @@ -9,6 +9,7 @@ Global Flags --debug : Enables debugging and diagnostics logging. --docs : Opens the documentation for azd version in your web browser. -e, --environment string : The name of the environment to use. + --fail-on-prompt : Fails with an actionable error whenever a prompt is encountered, even if a default exists. Implies --no-prompt. -h, --help : Gets help for version. --no-prompt : Accepts the default value instead of prompting, or it fails if there is no default. diff --git a/cli/azd/cmd/testdata/TestUsage-azd-x.snap b/cli/azd/cmd/testdata/TestUsage-azd-x.snap index 2c5b3245f63..0a921262593 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-x.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-x.snap @@ -9,6 +9,7 @@ Global Flags --debug : Enables debugging and diagnostics logging. --docs : Opens the documentation for azd x in your web browser. -e, --environment string : The name of the environment to use. + --fail-on-prompt : Fails with an actionable error whenever a prompt is encountered, even if a default exists. Implies --no-prompt. -h, --help : Gets help for x. --no-prompt : Accepts the default value instead of prompting, or it fails if there is no default. diff --git a/cli/azd/cmd/testdata/TestUsage-azd.snap b/cli/azd/cmd/testdata/TestUsage-azd.snap index 9ca798a1ce5..18b983238cf 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd.snap @@ -50,6 +50,7 @@ Flags -C, --cwd string : Sets the current working directory. --debug : Enables debugging and diagnostics logging. -e, --environment string : The name of the environment to use. + --fail-on-prompt : Fails with an actionable error whenever a prompt is encountered, even if a default exists. Implies --no-prompt. --no-prompt : Accepts the default value instead of prompting, or it fails if there is no default. Global Flags diff --git a/cli/azd/extensions/azure.ai.agents/go.mod b/cli/azd/extensions/azure.ai.agents/go.mod index a1a92ddf2b4..70a44259edd 100644 --- a/cli/azd/extensions/azure.ai.agents/go.mod +++ b/cli/azd/extensions/azure.ai.agents/go.mod @@ -31,6 +31,9 @@ require ( github.com/AlecAivazis/survey/v2 v2.3.7 // indirect github.com/Azure/azure-sdk-for-go/sdk/internal v1.11.2 // indirect github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/appservice/armappservice/v2 v2.3.0 // indirect + github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/keyvault/armkeyvault v1.5.0 // indirect + github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azsecrets v1.4.0 // indirect + github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/internal v1.2.0 // indirect github.com/AzureAD/microsoft-authentication-library-for-go v1.6.0 // indirect github.com/Masterminds/semver/v3 v3.4.0 // indirect github.com/adam-lavrik/go-imath v0.0.0-20210910152346-265a42a96f0b // indirect @@ -49,6 +52,7 @@ require ( github.com/charmbracelet/x/cellbuf v0.0.15 // indirect github.com/charmbracelet/x/exp/slice v0.0.0-20260204111555-7642919e0bee // indirect github.com/charmbracelet/x/term v0.2.2 // indirect + github.com/cli/browser v1.3.0 // indirect github.com/clipperhouse/displaywidth v0.9.0 // indirect github.com/clipperhouse/stringish v0.1.1 // indirect github.com/clipperhouse/uax29/v2 v2.5.0 // indirect @@ -56,6 +60,7 @@ require ( github.com/dlclark/regexp2 v1.11.5 // indirect github.com/go-logr/logr v1.4.3 // indirect github.com/go-logr/stdr v1.2.2 // indirect + github.com/gofrs/flock v0.12.1 // indirect github.com/golang-jwt/jwt/v5 v5.3.1 // indirect github.com/golobby/container/v3 v3.3.2 // indirect github.com/gorilla/css v1.0.1 // indirect @@ -95,6 +100,7 @@ require ( go.opentelemetry.io/otel/sdk v1.42.0 // indirect go.opentelemetry.io/otel/trace v1.42.0 // indirect go.uber.org/atomic v1.11.0 // indirect + go.uber.org/multierr v1.11.0 // indirect golang.org/x/crypto v0.48.0 // indirect golang.org/x/exp v0.0.0-20260112195511-716be5621a96 // indirect golang.org/x/net v0.51.0 // indirect @@ -103,3 +109,5 @@ require ( golang.org/x/text v0.34.0 // indirect golang.org/x/time v0.14.0 // indirect ) + +replace github.com/azure/azure-dev/cli/azd => ../../ diff --git a/cli/azd/extensions/azure.ai.agents/go.sum b/cli/azd/extensions/azure.ai.agents/go.sum index 35cf5fa8aa3..0115adf8553 100644 --- a/cli/azd/extensions/azure.ai.agents/go.sum +++ b/cli/azd/extensions/azure.ai.agents/go.sum @@ -23,12 +23,20 @@ github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armconta github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry v1.2.0/go.mod h1:E7ltexgRDmeJ0fJWv0D/HLwY2xbDdN+uv+X2uZtOx3w= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v2 v2.0.0 h1:PTFGRSlMKCQelWwxUyYVEUqseBJVemLyqWJjvMyt0do= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v2 v2.0.0/go.mod h1:LRr2FzBTQlONPPa5HREE5+RjSCTXl7BwOvYOaWTqCaI= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3 v3.1.0 h1:2qsIIvxVT+uE6yrNldntJKlLRgxGbZ85kgtz5SNBhMw= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3 v3.1.0/go.mod h1:AW8VEadnhw9xox+VaVd9sP7NjzOAnaZBLRH6Tq3cJ38= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/keyvault/armkeyvault v1.5.0 h1:nnQ9vXH039UrEFxi08pPuZBE7VfqSJt343uJLw0rhWI= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/keyvault/armkeyvault v1.5.0/go.mod h1:4YIVtzMFVsPwBvitCDX7J9sqthSj43QD1sP6fYc1egc= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/managementgroups/armmanagementgroups v1.0.0 h1:pPvTJ1dY0sA35JOeFq6TsY2xj6Z85Yo23Pj4wCCvu4o= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/managementgroups/armmanagementgroups v1.0.0/go.mod h1:mLfWfj8v3jfWKsL9G4eoBoXVcsqcIUTapmdKy7uGOp0= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.2.0 h1:Dd+RhdJn0OTtVGaeDLZpcumkIVCtA/3/Fo42+eoYvVM= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.2.0/go.mod h1:5kakwfW5CjC9KK+Q4wjXAg+ShuIm2mBMua0ZFj2C8PE= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armsubscriptions v1.3.0 h1:wxQx2Bt4xzPIKvW59WQf1tJNx/ZZKPfN+EhPX3Z6CYY= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armsubscriptions v1.3.0/go.mod h1:TpiwjwnW/khS0LKs4vW5UmmT9OWcxaveS8U7+tlknzo= +github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azsecrets v1.4.0 h1:/g8S6wk65vfC6m3FIxJ+i5QDyN9JWwXI8Hb0Img10hU= +github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azsecrets v1.4.0/go.mod h1:gpl+q95AzZlKVI3xSoseF9QPrypk0hQqBiJYeB/cR/I= +github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/internal v1.2.0 h1:nCYfgcSyHZXJI8J0IWE5MsCGlb2xp9fJiXyxWgmOFg4= +github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/internal v1.2.0/go.mod h1:ucUjca2JtSZboY8IoUqyQyuuXvwbMBVwFOm0vdQPNhA= github.com/AzureAD/microsoft-authentication-extensions-for-go/cache v0.1.1 h1:WJTmL004Abzc5wDB5VtZG2PJk5ndYDgVacGqfirKxjM= github.com/AzureAD/microsoft-authentication-extensions-for-go/cache v0.1.1/go.mod h1:tCcJZ0uHAmvjsVYzEFivsRTN00oz5BEsRgQHu5JZ9WE= github.com/AzureAD/microsoft-authentication-library-for-go v1.6.0 h1:XRzhVemXdgvJqCH0sFfrBUTnUJSBrBf7++ypk+twtRs= @@ -85,6 +93,8 @@ github.com/charmbracelet/x/exp/slice v0.0.0-20260204111555-7642919e0bee h1:B/JPE github.com/charmbracelet/x/exp/slice v0.0.0-20260204111555-7642919e0bee/go.mod h1:vqEfX6xzqW1pKKZUUiFOKg0OQ7bCh54Q2vR/tserrRA= github.com/charmbracelet/x/term v0.2.2 h1:xVRT/S2ZcKdhhOuSP4t5cLi5o+JxklsoEObBSgfgZRk= github.com/charmbracelet/x/term v0.2.2/go.mod h1:kF8CY5RddLWrsgVwpw4kAa6TESp6EB5y3uxGLeCqzAI= +github.com/cli/browser v1.3.0 h1:LejqCrpWr+1pRqmEPDGnTZOjsMe7sehifLynZJuqJpo= +github.com/cli/browser v1.3.0/go.mod h1:HH8s+fOAxjhQoBUAsKuPCbqUuxZDhQ2/aD+SzsEfBTk= github.com/clipperhouse/displaywidth v0.9.0 h1:Qb4KOhYwRiN3viMv1v/3cTBlz3AcAZX3+y9OLhMtAtA= github.com/clipperhouse/displaywidth v0.9.0/go.mod h1:aCAAqTlh4GIVkhQnJpbL0T/WfcrJXHcj8C0yjYcjOZA= github.com/clipperhouse/stringish v0.1.1 h1:+NSqMOr3GR6k1FdRhhnXrLfztGzuG+VuFDfatpWHKCs= @@ -112,6 +122,8 @@ github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI= github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= +github.com/gofrs/flock v0.12.1 h1:MTLVXXHf8ekldpJk3AKicLij9MdwOWkZ+a/jHHZby9E= +github.com/gofrs/flock v0.12.1/go.mod h1:9zxTsyu5xtJ9DK+1tFZyibEV7y3uwDxPPfbxeeHCoD0= github.com/gofrs/uuid v3.3.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/golang-jwt/jwt/v5 v5.3.1 h1:kYf81DTWFe7t+1VvL7eS+jKFVWaUnK9cB1qbwn63YCY= github.com/golang-jwt/jwt/v5 v5.3.1/go.mod h1:fxCRLWMO43lRc8nhHWY6LGqRcf+1gQWArsqaEUEa5bE= @@ -249,6 +261,8 @@ go.opentelemetry.io/otel/trace v1.42.0 h1:OUCgIPt+mzOnaUTpOQcBiM/PLQ/Op7oq6g4Len go.opentelemetry.io/otel/trace v1.42.0/go.mod h1:f3K9S+IFqnumBkKhRJMeaZeNk9epyhnCmQh/EysQCdc= go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE= go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= +go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= +go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc= go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= diff --git a/cli/azd/extensions/azure.ai.agents/internal/cmd/init.go b/cli/azd/extensions/azure.ai.agents/internal/cmd/init.go index 2aec48d32ae..0af1e184059 100644 --- a/cli/azd/extensions/azure.ai.agents/internal/cmd/init.go +++ b/cli/azd/extensions/azure.ai.agents/internal/cmd/init.go @@ -147,6 +147,7 @@ func runInitFromManifest( console := input.NewConsole( false, // noPrompt + false, // failOnPrompt true, // isTerminal input.Writers{Output: os.Stdout}, input.ConsoleHandles{ @@ -819,6 +820,7 @@ func (a *InitAction) downloadAgentYaml( console = input.NewConsole( false, // noPrompt + false, // failOnPrompt true, // isTerminal input.Writers{Output: os.Stdout}, input.ConsoleHandles{ diff --git a/cli/azd/extensions/azure.ai.finetune/go.mod b/cli/azd/extensions/azure.ai.finetune/go.mod index be71311b760..af2fef254f7 100644 --- a/cli/azd/extensions/azure.ai.finetune/go.mod +++ b/cli/azd/extensions/azure.ai.finetune/go.mod @@ -21,6 +21,10 @@ require ( github.com/AlecAivazis/survey/v2 v2.3.7 // indirect github.com/Azure/azure-sdk-for-go/sdk/internal v1.11.2 // indirect github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/appservice/armappservice/v2 v2.3.0 // indirect + github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/keyvault/armkeyvault v1.5.0 // indirect + github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armsubscriptions v1.3.0 // indirect + github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azsecrets v1.4.0 // indirect + github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/internal v1.2.0 // indirect github.com/AzureAD/microsoft-authentication-library-for-go v1.6.0 // indirect github.com/Masterminds/semver/v3 v3.4.0 // indirect github.com/adam-lavrik/go-imath v0.0.0-20210910152346-265a42a96f0b // indirect @@ -39,6 +43,7 @@ require ( github.com/charmbracelet/x/cellbuf v0.0.15 // indirect github.com/charmbracelet/x/exp/slice v0.0.0-20260204111555-7642919e0bee // indirect github.com/charmbracelet/x/term v0.2.2 // indirect + github.com/cli/browser v1.3.0 // indirect github.com/clipperhouse/displaywidth v0.9.0 // indirect github.com/clipperhouse/stringish v0.1.1 // indirect github.com/clipperhouse/uax29/v2 v2.5.0 // indirect @@ -47,6 +52,7 @@ require ( github.com/drone/envsubst v1.0.3 // indirect github.com/go-logr/logr v1.4.3 // indirect github.com/go-logr/stdr v1.2.2 // indirect + github.com/gofrs/flock v0.12.1 // indirect github.com/golang-jwt/jwt/v5 v5.3.1 // indirect github.com/golobby/container/v3 v3.3.2 // indirect github.com/google/uuid v1.6.0 // indirect @@ -92,6 +98,7 @@ require ( go.opentelemetry.io/otel/sdk v1.42.0 // indirect go.opentelemetry.io/otel/trace v1.42.0 // indirect go.uber.org/atomic v1.11.0 // indirect + go.uber.org/multierr v1.11.0 // indirect golang.org/x/crypto v0.48.0 // indirect golang.org/x/exp v0.0.0-20260112195511-716be5621a96 // indirect golang.org/x/net v0.51.0 // indirect @@ -103,3 +110,5 @@ require ( google.golang.org/grpc v1.79.3 // indirect google.golang.org/protobuf v1.36.11 // indirect ) + +replace github.com/azure/azure-dev/cli/azd => ../../ diff --git a/cli/azd/extensions/azure.ai.finetune/go.sum b/cli/azd/extensions/azure.ai.finetune/go.sum index f36e9cd5124..99254a0e7b6 100644 --- a/cli/azd/extensions/azure.ai.finetune/go.sum +++ b/cli/azd/extensions/azure.ai.finetune/go.sum @@ -15,8 +15,20 @@ github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/appservice/armappservice/v github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/appservice/armappservice/v2 v2.3.0/go.mod h1:nJLFPGJkyKfDDyJiPuHIXsCi/gpJkm07EvRgiX7SGlI= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cognitiveservices/armcognitiveservices v1.8.0 h1:ZMGAqCZov8+7iFUPWKVcTaLgNXUeTlz20sIuWkQWNfg= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cognitiveservices/armcognitiveservices v1.8.0/go.mod h1:BElPQ/GZtrdQ2i5uDZw3OKLE1we75W0AEWyeBR1TWQA= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v2 v2.0.0 h1:PTFGRSlMKCQelWwxUyYVEUqseBJVemLyqWJjvMyt0do= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v2 v2.0.0/go.mod h1:LRr2FzBTQlONPPa5HREE5+RjSCTXl7BwOvYOaWTqCaI= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3 v3.1.0 h1:2qsIIvxVT+uE6yrNldntJKlLRgxGbZ85kgtz5SNBhMw= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3 v3.1.0/go.mod h1:AW8VEadnhw9xox+VaVd9sP7NjzOAnaZBLRH6Tq3cJ38= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/keyvault/armkeyvault v1.5.0 h1:nnQ9vXH039UrEFxi08pPuZBE7VfqSJt343uJLw0rhWI= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/keyvault/armkeyvault v1.5.0/go.mod h1:4YIVtzMFVsPwBvitCDX7J9sqthSj43QD1sP6fYc1egc= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.2.0 h1:Dd+RhdJn0OTtVGaeDLZpcumkIVCtA/3/Fo42+eoYvVM= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.2.0/go.mod h1:5kakwfW5CjC9KK+Q4wjXAg+ShuIm2mBMua0ZFj2C8PE= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armsubscriptions v1.3.0 h1:wxQx2Bt4xzPIKvW59WQf1tJNx/ZZKPfN+EhPX3Z6CYY= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armsubscriptions v1.3.0/go.mod h1:TpiwjwnW/khS0LKs4vW5UmmT9OWcxaveS8U7+tlknzo= +github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azsecrets v1.4.0 h1:/g8S6wk65vfC6m3FIxJ+i5QDyN9JWwXI8Hb0Img10hU= +github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azsecrets v1.4.0/go.mod h1:gpl+q95AzZlKVI3xSoseF9QPrypk0hQqBiJYeB/cR/I= +github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/internal v1.2.0 h1:nCYfgcSyHZXJI8J0IWE5MsCGlb2xp9fJiXyxWgmOFg4= +github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/internal v1.2.0/go.mod h1:ucUjca2JtSZboY8IoUqyQyuuXvwbMBVwFOm0vdQPNhA= github.com/AzureAD/microsoft-authentication-extensions-for-go/cache v0.1.1 h1:WJTmL004Abzc5wDB5VtZG2PJk5ndYDgVacGqfirKxjM= github.com/AzureAD/microsoft-authentication-extensions-for-go/cache v0.1.1/go.mod h1:tCcJZ0uHAmvjsVYzEFivsRTN00oz5BEsRgQHu5JZ9WE= github.com/AzureAD/microsoft-authentication-library-for-go v1.6.0 h1:XRzhVemXdgvJqCH0sFfrBUTnUJSBrBf7++ypk+twtRs= @@ -73,6 +85,8 @@ github.com/charmbracelet/x/exp/slice v0.0.0-20260204111555-7642919e0bee h1:B/JPE github.com/charmbracelet/x/exp/slice v0.0.0-20260204111555-7642919e0bee/go.mod h1:vqEfX6xzqW1pKKZUUiFOKg0OQ7bCh54Q2vR/tserrRA= github.com/charmbracelet/x/term v0.2.2 h1:xVRT/S2ZcKdhhOuSP4t5cLi5o+JxklsoEObBSgfgZRk= github.com/charmbracelet/x/term v0.2.2/go.mod h1:kF8CY5RddLWrsgVwpw4kAa6TESp6EB5y3uxGLeCqzAI= +github.com/cli/browser v1.3.0 h1:LejqCrpWr+1pRqmEPDGnTZOjsMe7sehifLynZJuqJpo= +github.com/cli/browser v1.3.0/go.mod h1:HH8s+fOAxjhQoBUAsKuPCbqUuxZDhQ2/aD+SzsEfBTk= github.com/clipperhouse/displaywidth v0.9.0 h1:Qb4KOhYwRiN3viMv1v/3cTBlz3AcAZX3+y9OLhMtAtA= github.com/clipperhouse/displaywidth v0.9.0/go.mod h1:aCAAqTlh4GIVkhQnJpbL0T/WfcrJXHcj8C0yjYcjOZA= github.com/clipperhouse/stringish v0.1.1 h1:+NSqMOr3GR6k1FdRhhnXrLfztGzuG+VuFDfatpWHKCs= @@ -100,6 +114,8 @@ github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI= github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= +github.com/gofrs/flock v0.12.1 h1:MTLVXXHf8ekldpJk3AKicLij9MdwOWkZ+a/jHHZby9E= +github.com/gofrs/flock v0.12.1/go.mod h1:9zxTsyu5xtJ9DK+1tFZyibEV7y3uwDxPPfbxeeHCoD0= github.com/gofrs/uuid v3.3.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/golang-jwt/jwt/v5 v5.3.1 h1:kYf81DTWFe7t+1VvL7eS+jKFVWaUnK9cB1qbwn63YCY= github.com/golang-jwt/jwt/v5 v5.3.1/go.mod h1:fxCRLWMO43lRc8nhHWY6LGqRcf+1gQWArsqaEUEa5bE= @@ -250,6 +266,8 @@ go.opentelemetry.io/otel/trace v1.42.0 h1:OUCgIPt+mzOnaUTpOQcBiM/PLQ/Op7oq6g4Len go.opentelemetry.io/otel/trace v1.42.0/go.mod h1:f3K9S+IFqnumBkKhRJMeaZeNk9epyhnCmQh/EysQCdc= go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE= go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= +go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= +go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= diff --git a/cli/azd/extensions/azure.ai.finetune/internal/cmd/init.go b/cli/azd/extensions/azure.ai.finetune/internal/cmd/init.go index 179f85e397e..e6012f3af5e 100644 --- a/cli/azd/extensions/azure.ai.finetune/internal/cmd/init.go +++ b/cli/azd/extensions/azure.ai.finetune/internal/cmd/init.go @@ -108,6 +108,7 @@ func newInitCommand(rootFlags rootFlagsDefinition) *cobra.Command { console := input.NewConsole( false, // noPrompt + false, // failOnPrompt true, // isTerminal input.Writers{Output: os.Stdout}, input.ConsoleHandles{ @@ -810,6 +811,7 @@ method: console = input.NewConsole( false, // noPrompt + false, // failOnPrompt true, // isTerminal input.Writers{Output: os.Stdout}, input.ConsoleHandles{ diff --git a/cli/azd/extensions/azure.coding-agent/go.mod b/cli/azd/extensions/azure.coding-agent/go.mod index 4e84c636ece..4c70907577d 100644 --- a/cli/azd/extensions/azure.coding-agent/go.mod +++ b/cli/azd/extensions/azure.coding-agent/go.mod @@ -22,7 +22,10 @@ require ( github.com/AlecAivazis/survey/v2 v2.3.7 // indirect github.com/Azure/azure-sdk-for-go/sdk/internal v1.11.2 // indirect github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/authorization/armauthorization/v2 v2.2.0 // indirect + github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/keyvault/armkeyvault v1.5.0 // indirect github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armsubscriptions v1.3.0 // indirect + github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azsecrets v1.4.0 // indirect + github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/internal v1.2.0 // indirect github.com/AzureAD/microsoft-authentication-library-for-go v1.6.0 // indirect github.com/Masterminds/semver/v3 v3.4.0 // indirect github.com/adam-lavrik/go-imath v0.0.0-20210910152346-265a42a96f0b // indirect @@ -109,3 +112,5 @@ require ( ) tool go.uber.org/mock/mockgen + +replace github.com/azure/azure-dev/cli/azd => ../../ diff --git a/cli/azd/extensions/azure.coding-agent/go.sum b/cli/azd/extensions/azure.coding-agent/go.sum index 699951abb26..f5c47ca2390 100644 --- a/cli/azd/extensions/azure.coding-agent/go.sum +++ b/cli/azd/extensions/azure.coding-agent/go.sum @@ -17,6 +17,8 @@ github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v2 v2.0.0 h1:PTFG github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v2 v2.0.0/go.mod h1:LRr2FzBTQlONPPa5HREE5+RjSCTXl7BwOvYOaWTqCaI= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3 v3.1.0 h1:2qsIIvxVT+uE6yrNldntJKlLRgxGbZ85kgtz5SNBhMw= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3 v3.1.0/go.mod h1:AW8VEadnhw9xox+VaVd9sP7NjzOAnaZBLRH6Tq3cJ38= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/keyvault/armkeyvault v1.5.0 h1:nnQ9vXH039UrEFxi08pPuZBE7VfqSJt343uJLw0rhWI= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/keyvault/armkeyvault v1.5.0/go.mod h1:4YIVtzMFVsPwBvitCDX7J9sqthSj43QD1sP6fYc1egc= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/managementgroups/armmanagementgroups v1.0.0 h1:pPvTJ1dY0sA35JOeFq6TsY2xj6Z85Yo23Pj4wCCvu4o= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/managementgroups/armmanagementgroups v1.0.0/go.mod h1:mLfWfj8v3jfWKsL9G4eoBoXVcsqcIUTapmdKy7uGOp0= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/msi/armmsi v1.3.0 h1:L7G3dExHBgUxsO3qpTGhk/P2dgnYyW48yn7AO33Tbek= @@ -25,6 +27,10 @@ github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1. github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.2.0/go.mod h1:5kakwfW5CjC9KK+Q4wjXAg+ShuIm2mBMua0ZFj2C8PE= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armsubscriptions v1.3.0 h1:wxQx2Bt4xzPIKvW59WQf1tJNx/ZZKPfN+EhPX3Z6CYY= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armsubscriptions v1.3.0/go.mod h1:TpiwjwnW/khS0LKs4vW5UmmT9OWcxaveS8U7+tlknzo= +github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azsecrets v1.4.0 h1:/g8S6wk65vfC6m3FIxJ+i5QDyN9JWwXI8Hb0Img10hU= +github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azsecrets v1.4.0/go.mod h1:gpl+q95AzZlKVI3xSoseF9QPrypk0hQqBiJYeB/cR/I= +github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/internal v1.2.0 h1:nCYfgcSyHZXJI8J0IWE5MsCGlb2xp9fJiXyxWgmOFg4= +github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/internal v1.2.0/go.mod h1:ucUjca2JtSZboY8IoUqyQyuuXvwbMBVwFOm0vdQPNhA= github.com/AzureAD/microsoft-authentication-extensions-for-go/cache v0.1.1 h1:WJTmL004Abzc5wDB5VtZG2PJk5ndYDgVacGqfirKxjM= github.com/AzureAD/microsoft-authentication-extensions-for-go/cache v0.1.1/go.mod h1:tCcJZ0uHAmvjsVYzEFivsRTN00oz5BEsRgQHu5JZ9WE= github.com/AzureAD/microsoft-authentication-library-for-go v1.6.0 h1:XRzhVemXdgvJqCH0sFfrBUTnUJSBrBf7++ypk+twtRs= diff --git a/cli/azd/extensions/azure.coding-agent/internal/cmd/coding_agent_config.go b/cli/azd/extensions/azure.coding-agent/internal/cmd/coding_agent_config.go index 0bbf49e987e..1ef59b4c1b4 100644 --- a/cli/azd/extensions/azure.coding-agent/internal/cmd/coding_agent_config.go +++ b/cli/azd/extensions/azure.coding-agent/internal/cmd/coding_agent_config.go @@ -428,7 +428,7 @@ func newCommandRunner(showOutput bool) (azd_exec.CommandRunner, input.Console) { }) } - console := input.NewConsole(true, true, input.Writers{ + console := input.NewConsole(true, false, true, input.Writers{ Output: os.Stdout, Spinner: os.Stdout, }, input.ConsoleHandles{ diff --git a/cli/azd/extensions/azure.coding-agent/internal/cmd/mocks_azdext_test.go b/cli/azd/extensions/azure.coding-agent/internal/cmd/mocks_azdext_test.go index 27cb1e51279..f1234247f6c 100644 --- a/cli/azd/extensions/azure.coding-agent/internal/cmd/mocks_azdext_test.go +++ b/cli/azd/extensions/azure.coding-agent/internal/cmd/mocks_azdext_test.go @@ -305,3 +305,83 @@ func (mr *MockPromptServiceClientMockRecorder) Select(ctx, in any, opts ...any) varargs := append([]any{ctx, in}, opts...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Select", reflect.TypeOf((*MockPromptServiceClient)(nil).Select), varargs...) } + +// PromptAiDeployment mocks base method. +func (m *MockPromptServiceClient) PromptAiDeployment(ctx context.Context, in *azdext.PromptAiDeploymentRequest, opts ...grpc.CallOption) (*azdext.PromptAiDeploymentResponse, error) { + m.ctrl.T.Helper() + varargs := []any{ctx, in} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "PromptAiDeployment", varargs...) + ret0, _ := ret[0].(*azdext.PromptAiDeploymentResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// PromptAiDeployment indicates an expected call of PromptAiDeployment. +func (mr *MockPromptServiceClientMockRecorder) PromptAiDeployment(ctx, in any, opts ...any) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]any{ctx, in}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PromptAiDeployment", reflect.TypeOf((*MockPromptServiceClient)(nil).PromptAiDeployment), varargs...) +} + +// PromptAiModel mocks base method. +func (m *MockPromptServiceClient) PromptAiModel(ctx context.Context, in *azdext.PromptAiModelRequest, opts ...grpc.CallOption) (*azdext.PromptAiModelResponse, error) { + m.ctrl.T.Helper() + varargs := []any{ctx, in} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "PromptAiModel", varargs...) + ret0, _ := ret[0].(*azdext.PromptAiModelResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// PromptAiModel indicates an expected call of PromptAiModel. +func (mr *MockPromptServiceClientMockRecorder) PromptAiModel(ctx, in any, opts ...any) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]any{ctx, in}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PromptAiModel", reflect.TypeOf((*MockPromptServiceClient)(nil).PromptAiModel), varargs...) +} + +// PromptAiLocationWithQuota mocks base method. +func (m *MockPromptServiceClient) PromptAiLocationWithQuota(ctx context.Context, in *azdext.PromptAiLocationWithQuotaRequest, opts ...grpc.CallOption) (*azdext.PromptAiLocationWithQuotaResponse, error) { + m.ctrl.T.Helper() + varargs := []any{ctx, in} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "PromptAiLocationWithQuota", varargs...) + ret0, _ := ret[0].(*azdext.PromptAiLocationWithQuotaResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// PromptAiLocationWithQuota indicates an expected call of PromptAiLocationWithQuota. +func (mr *MockPromptServiceClientMockRecorder) PromptAiLocationWithQuota(ctx, in any, opts ...any) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]any{ctx, in}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PromptAiLocationWithQuota", reflect.TypeOf((*MockPromptServiceClient)(nil).PromptAiLocationWithQuota), varargs...) +} + +// PromptAiModelLocationWithQuota mocks base method. +func (m *MockPromptServiceClient) PromptAiModelLocationWithQuota(ctx context.Context, in *azdext.PromptAiModelLocationWithQuotaRequest, opts ...grpc.CallOption) (*azdext.PromptAiModelLocationWithQuotaResponse, error) { + m.ctrl.T.Helper() + varargs := []any{ctx, in} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "PromptAiModelLocationWithQuota", varargs...) + ret0, _ := ret[0].(*azdext.PromptAiModelLocationWithQuotaResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// PromptAiModelLocationWithQuota indicates an expected call of PromptAiModelLocationWithQuota. +func (mr *MockPromptServiceClientMockRecorder) PromptAiModelLocationWithQuota(ctx, in any, opts ...any) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]any{ctx, in}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PromptAiModelLocationWithQuota", reflect.TypeOf((*MockPromptServiceClient)(nil).PromptAiModelLocationWithQuota), varargs...) +} diff --git a/cli/azd/internal/global_command_options.go b/cli/azd/internal/global_command_options.go index 47b8d0a14f5..e8c662f7925 100644 --- a/cli/azd/internal/global_command_options.go +++ b/cli/azd/internal/global_command_options.go @@ -33,6 +33,11 @@ type GlobalCommandOptions struct { // purposes such as URLs). EnvironmentName string + // FailOnPrompt when true, any interactive prompt fails immediately with an + // actionable error, even if a default value exists. This is stricter than + // NoPrompt which silently uses defaults. + FailOnPrompt bool + // EnableTelemetry indicates if telemetry should be sent. // The rootCmd will disable this based if the environment variable // AZURE_DEV_COLLECT_TELEMETRY is set to 'no'. diff --git a/cli/azd/internal/grpcserver/prompt_service.go b/cli/azd/internal/grpcserver/prompt_service.go index 5d2adf580de..1ec3ad94464 100644 --- a/cli/azd/internal/grpcserver/prompt_service.go +++ b/cli/azd/internal/grpcserver/prompt_service.go @@ -52,6 +52,14 @@ func (s *promptService) Confirm(ctx context.Context, req *azdext.ConfirmRequest) return nil, status.Error(codes.InvalidArgument, "request and options are required") } + if s.globalOptions.FailOnPrompt { + return nil, fmt.Errorf( + "interactive prompt not allowed in strict mode: %q"+ + " (provide the value via command-line flags or environment variables)", + req.Options.Message, + ) + } + if s.globalOptions.NoPrompt { if req.Options.DefaultValue == nil { return nil, fmt.Errorf("no default response for prompt '%s'", req.Options.Message) @@ -89,6 +97,20 @@ func (s *promptService) Select(ctx context.Context, req *azdext.SelectRequest) ( return nil, status.Error(codes.InvalidArgument, "request and options are required") } + if s.globalOptions.FailOnPrompt { + choiceLabels := make([]string, len(req.Options.Choices)) + for i, c := range req.Options.Choices { + choiceLabels[i] = c.Label + } + return nil, fmt.Errorf( + "interactive prompt not allowed in strict mode: %q"+ + " (available options: %s -- specify via"+ + " command-line flags or environment variables)", + req.Options.Message, + strings.Join(choiceLabels, ", "), + ) + } + if s.globalOptions.NoPrompt { if req.Options.SelectedIndex == nil { return nil, fmt.Errorf("no default selection for prompt '%s'", req.Options.Message) @@ -139,6 +161,20 @@ func (s *promptService) MultiSelect( return nil, status.Error(codes.InvalidArgument, "request and options are required") } + if s.globalOptions.FailOnPrompt { + choiceLabels := make([]string, len(req.Options.Choices)) + for i, c := range req.Options.Choices { + choiceLabels[i] = c.Label + } + return nil, fmt.Errorf( + "interactive prompt not allowed in strict mode: %q"+ + " (available options: %s -- specify via"+ + " command-line flags or environment variables)", + req.Options.Message, + strings.Join(choiceLabels, ", "), + ) + } + if s.globalOptions.NoPrompt { var selectedChoices []*azdext.MultiSelectChoice for _, choice := range req.Options.Choices { @@ -194,6 +230,14 @@ func (s *promptService) MultiSelect( } func (s *promptService) Prompt(ctx context.Context, req *azdext.PromptRequest) (*azdext.PromptResponse, error) { + if s.globalOptions.FailOnPrompt { + return nil, fmt.Errorf( + "interactive prompt not allowed in strict mode: %q"+ + " (provide the value via command-line flags or environment variables)", + req.Options.Message, + ) + } + if s.globalOptions.NoPrompt { if req.Options.Required && req.Options.DefaultValue == "" { return nil, fmt.Errorf("no default response for prompt '%s'", req.Options.Message) diff --git a/cli/azd/internal/grpcserver/prompt_service_test.go b/cli/azd/internal/grpcserver/prompt_service_test.go index e030bb3d826..5309c110873 100644 --- a/cli/azd/internal/grpcserver/prompt_service_test.go +++ b/cli/azd/internal/grpcserver/prompt_service_test.go @@ -158,6 +158,80 @@ func Test_PromptService_Prompt_NoPromptNotRequiredWithoutDefault(t *testing.T) { require.Equal(t, "", resp.Value) } +func Test_PromptService_Confirm_FailOnPrompt(t *testing.T) { + globalOptions := &internal.GlobalCommandOptions{FailOnPrompt: true} + service := NewPromptService(nil, nil, nil, globalOptions) + + _, err := service.Confirm(t.Context(), &azdext.ConfirmRequest{ + Options: &azdext.ConfirmOptions{ + Message: "Continue?", + DefaultValue: new(true), + }, + }) + + require.Error(t, err) + require.Contains(t, err.Error(), "interactive prompt not allowed in strict mode") + require.Contains(t, err.Error(), "Continue?") +} + +func Test_PromptService_Select_FailOnPrompt(t *testing.T) { + globalOptions := &internal.GlobalCommandOptions{FailOnPrompt: true} + service := NewPromptService(nil, nil, nil, globalOptions) + + _, err := service.Select(t.Context(), &azdext.SelectRequest{ + Options: &azdext.SelectOptions{ + Message: "Choose option:", + Choices: []*azdext.SelectChoice{ + {Value: "a", Label: "Option A"}, + {Value: "b", Label: "Option B"}, + }, + }, + }) + + require.Error(t, err) + require.Contains(t, err.Error(), "interactive prompt not allowed in strict mode") + require.Contains(t, err.Error(), "Choose option:") + require.Contains(t, err.Error(), "Option A") + require.Contains(t, err.Error(), "Option B") +} + +func Test_PromptService_MultiSelect_FailOnPrompt(t *testing.T) { + globalOptions := &internal.GlobalCommandOptions{FailOnPrompt: true} + service := NewPromptService(nil, nil, nil, globalOptions) + + _, err := service.MultiSelect(t.Context(), &azdext.MultiSelectRequest{ + Options: &azdext.MultiSelectOptions{ + Message: "Select items:", + Choices: []*azdext.MultiSelectChoice{ + {Value: "x", Label: "Item X"}, + {Value: "y", Label: "Item Y"}, + }, + }, + }) + + require.Error(t, err) + require.Contains(t, err.Error(), "interactive prompt not allowed in strict mode") + require.Contains(t, err.Error(), "Select items:") + require.Contains(t, err.Error(), "Item X") +} + +func Test_PromptService_Prompt_FailOnPrompt(t *testing.T) { + globalOptions := &internal.GlobalCommandOptions{FailOnPrompt: true} + service := NewPromptService(nil, nil, nil, globalOptions) + + _, err := service.Prompt(t.Context(), &azdext.PromptRequest{ + Options: &azdext.PromptOptions{ + Message: "Enter name:", + DefaultValue: "default-name", + Required: true, + }, + }) + + require.Error(t, err) + require.Contains(t, err.Error(), "interactive prompt not allowed in strict mode") + require.Contains(t, err.Error(), "Enter name:") +} + func Test_PromptService_PromptSubscription(t *testing.T) { mockPrompter := &mockprompt.MockPromptService{} globalOptions := &internal.GlobalCommandOptions{NoPrompt: false} diff --git a/cli/azd/internal/repository/app_init_test.go b/cli/azd/internal/repository/app_init_test.go index bccb7b45b74..dee7c377dd0 100644 --- a/cli/azd/internal/repository/app_init_test.go +++ b/cli/azd/internal/repository/app_init_test.go @@ -272,6 +272,7 @@ func TestInitializer_prjConfigFromDetect(t *testing.T) { t.Run(tt.name, func(t *testing.T) { i := &Initializer{ console: input.NewConsole( + false, false, false, input.Writers{Output: os.Stdout}, diff --git a/cli/azd/internal/repository/detect_confirm_test.go b/cli/azd/internal/repository/detect_confirm_test.go index 172c86084dc..75f2208354b 100644 --- a/cli/azd/internal/repository/detect_confirm_test.go +++ b/cli/azd/internal/repository/detect_confirm_test.go @@ -210,6 +210,7 @@ func Test_detectConfirm_confirm(t *testing.T) { t.Run(tt.name, func(t *testing.T) { d := &detectConfirm{ console: input.NewConsole( + false, false, false, input.Writers{Output: os.Stdout}, diff --git a/cli/azd/internal/repository/infra_confirm_test.go b/cli/azd/internal/repository/infra_confirm_test.go index 3f3b684938c..9b4b64ed086 100644 --- a/cli/azd/internal/repository/infra_confirm_test.go +++ b/cli/azd/internal/repository/infra_confirm_test.go @@ -218,6 +218,7 @@ func TestInitializer_infraSpecFromDetect(t *testing.T) { t.Run(tt.name, func(t *testing.T) { i := &Initializer{ console: input.NewConsole( + false, false, false, input.Writers{Output: os.Stdout}, diff --git a/cli/azd/internal/vsrpc/server_session.go b/cli/azd/internal/vsrpc/server_session.go index 5d36dbc8c9d..f657d316797 100644 --- a/cli/azd/internal/vsrpc/server_session.go +++ b/cli/azd/internal/vsrpc/server_session.go @@ -133,7 +133,7 @@ func (s *serverSession) newContainer(rc RequestContext) (*container, error) { stdin := strings.NewReader("") writer := colorable.NewNonColorable(stdout) - return input.NewConsole(true, false, input.Writers{ + return input.NewConsole(true, false, false, input.Writers{ Output: writer, Spinner: colorable.NewNonColorable(spinnerWriter)}, input.ConsoleHandles{ diff --git a/cli/azd/pkg/input/asker.go b/cli/azd/pkg/input/asker.go index fdf17299589..be262a74ff5 100644 --- a/cli/azd/pkg/input/asker.go +++ b/cli/azd/pkg/input/asker.go @@ -17,7 +17,14 @@ import ( type Asker func(p survey.Prompt, response any) error -func NewAsker(noPrompt bool, isTerminal bool, w io.Writer, r io.Reader) Asker { +// NewAsker returns an Asker configured for the given prompt mode. +// When failOnPrompt is true, every prompt immediately returns an actionable error. +// When noPrompt is true, prompts silently use their default values. +func NewAsker(noPrompt bool, failOnPrompt bool, isTerminal bool, w io.Writer, r io.Reader) Asker { + if failOnPrompt { + return askOneFailOnPrompt + } + if noPrompt { return askOneNoPrompt } @@ -27,6 +34,54 @@ func NewAsker(noPrompt bool, isTerminal bool, w io.Writer, r io.Reader) Asker { } } +func askOneFailOnPrompt(p survey.Prompt, _ any) error { + switch v := p.(type) { + case *survey.Input: + return fmt.Errorf( + "interactive prompt not allowed in strict mode: %q"+ + " (provide the value via command-line flags"+ + " or environment variables)", + v.Message, + ) + case *survey.Select: + return fmt.Errorf( + "interactive prompt not allowed in strict mode: %q"+ + " (available options: %s -- specify via"+ + " command-line flags or environment variables)", + v.Message, + strings.Join(v.Options, ", "), + ) + case *survey.Confirm: + return fmt.Errorf( + "interactive prompt not allowed in strict mode: %q"+ + " (provide the value via command-line flags"+ + " or environment variables)", + v.Message, + ) + case *survey.MultiSelect: + return fmt.Errorf( + "interactive prompt not allowed in strict mode: %q"+ + " (available options: %s -- specify via"+ + " command-line flags or environment variables)", + v.Message, + strings.Join(v.Options, ", "), + ) + case *survey.Password: + return fmt.Errorf( + "interactive prompt not allowed in strict mode: %q"+ + " (provide the value via command-line flags"+ + " or environment variables)", + v.Message, + ) + default: + return fmt.Errorf( + "interactive prompt not allowed in strict mode" + + " (provide the value via command-line flags" + + " or environment variables)", + ) + } +} + func askOneNoPrompt(p survey.Prompt, response any) error { switch v := p.(type) { case *survey.Input: diff --git a/cli/azd/pkg/input/asker_test.go b/cli/azd/pkg/input/asker_test.go index 861f8d2477f..43860efd62f 100644 --- a/cli/azd/pkg/input/asker_test.go +++ b/cli/azd/pkg/input/asker_test.go @@ -222,7 +222,7 @@ func Test_askOneNoPrompt_UnknownType_Panics(t *testing.T) { } func Test_NewAsker_NoPrompt(t *testing.T) { - asker := NewAsker(true, false, nil, nil) + asker := NewAsker(true, false, false, nil, nil) prompt := &survey.Confirm{ Message: "OK?", Default: true, @@ -239,7 +239,7 @@ func Test_NewAsker_NonTerminal_Input(t *testing.T) { r := strings.NewReader(input) w := &bytes.Buffer{} - asker := NewAsker(false, false, w, r) + asker := NewAsker(false, false, false, w, r) prompt := &survey.Input{ Message: "Name:", } @@ -256,7 +256,7 @@ func Test_NewAsker_NonTerminal_InputWithDefault(t *testing.T) { r := strings.NewReader(input) w := &bytes.Buffer{} - asker := NewAsker(false, false, w, r) + asker := NewAsker(false, false, false, w, r) prompt := &survey.Input{ Message: "Name:", Default: "Bob", @@ -288,7 +288,7 @@ func Test_NewAsker_NonTerminal_Confirm(t *testing.T) { r := strings.NewReader(tt.input) w := &bytes.Buffer{} - asker := NewAsker(false, false, w, r) + asker := NewAsker(false, false, false, w, r) prompt := &survey.Confirm{ Message: "Continue?", Default: tt.defVal, @@ -339,7 +339,7 @@ func Test_NewAsker_NonTerminal_Select(t *testing.T) { r := strings.NewReader(tt.input) w := &bytes.Buffer{} - asker := NewAsker(false, false, w, r) + asker := NewAsker(false, false, false, w, r) prompt := &survey.Select{ Message: "Pick:", Options: tt.options, @@ -363,7 +363,7 @@ func Test_NewAsker_NonTerminal_Password(t *testing.T) { r := strings.NewReader("s3cret\n") w := &bytes.Buffer{} - asker := NewAsker(false, false, w, r) + asker := NewAsker(false, false, false, w, r) prompt := &survey.Password{ Message: "Password:", } @@ -375,7 +375,7 @@ func Test_NewAsker_NonTerminal_Password(t *testing.T) { } func Test_NewAsker_NonTerminal_UnknownType_Panics(t *testing.T) { - asker := NewAsker(false, false, &bytes.Buffer{}, strings.NewReader("")) + asker := NewAsker(false, false, false, &bytes.Buffer{}, strings.NewReader("")) require.Panics(t, func() { var result string @@ -539,3 +539,150 @@ func Test_choicesFromOptions(t *testing.T) { }) } } + +func Test_askOneFailOnPrompt(t *testing.T) { + tests := []struct { + name string + prompt survey.Prompt + errContains []string + }{ + { + name: "Input_WithDefault", + prompt: &survey.Input{ + Message: "Enter name:", + Default: "Alice", + }, + errContains: []string{ + "interactive prompt not allowed in strict mode", + "Enter name:", + "command-line flags or environment variables", + }, + }, + { + name: "Input_WithoutDefault", + prompt: &survey.Input{ + Message: "Enter value:", + }, + errContains: []string{ + "interactive prompt not allowed in strict mode", + "Enter value:", + }, + }, + { + name: "Select_ListsOptions", + prompt: &survey.Select{ + Message: "Pick region:", + Options: []string{"eastus", "westus", "westeurope"}, + Default: "eastus", + }, + errContains: []string{ + "interactive prompt not allowed in strict mode", + "Pick region:", + "eastus", + "westeurope", + }, + }, + { + name: "Confirm_WithDefault", + prompt: &survey.Confirm{ + Message: "Continue?", + Default: true, + }, + errContains: []string{ + "interactive prompt not allowed in strict mode", + "Continue?", + }, + }, + { + name: "MultiSelect_ListsOptions", + prompt: &survey.MultiSelect{ + Message: "Select features:", + Options: []string{"auth", "storage", "compute"}, + }, + errContains: []string{ + "interactive prompt not allowed in strict mode", + "Select features:", + "auth", + "storage", + }, + }, + { + name: "Password_WithMessage", + prompt: &survey.Password{ + Message: "Enter token:", + }, + errContains: []string{ + "interactive prompt not allowed in strict mode", + "Enter token:", + "command-line flags or environment variables", + }, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + var response any + switch tt.prompt.(type) { + case *survey.Input: + response = new(string) + case *survey.Select: + response = new(int) + case *survey.Confirm: + response = new(bool) + case *survey.MultiSelect: + response = new([]string) + case *survey.Password: + response = new(string) + } + + err := askOneFailOnPrompt(tt.prompt, response) + require.Error(t, err) + + errMsg := err.Error() + for _, substr := range tt.errContains { + require.Contains(t, errMsg, substr) + } + }) + } +} + +func Test_askOneFailOnPrompt_UnknownType(t *testing.T) { + var result string + err := askOneFailOnPrompt( + &survey.Editor{Message: "Edit:"}, + &result, + ) + require.Error(t, err) + require.Contains( + t, err.Error(), + "interactive prompt not allowed in strict mode", + ) +} + +func Test_NewAsker_FailOnPrompt_ReturnsError(t *testing.T) { + asker := NewAsker(false, true, false, nil, nil) + prompt := &survey.Input{ + Message: "Name:", + Default: "default-val", + } + var result string + err := asker(prompt, &result) + + require.Error(t, err) + require.Contains(t, err.Error(), "strict mode") + // Result should not be populated + require.Empty(t, result) +} + +func Test_NoPrompt_StillUsesDefaults(t *testing.T) { + asker := NewAsker(true, false, false, nil, nil) + prompt := &survey.Input{ + Message: "Name:", + Default: "default-val", + } + var result string + err := asker(prompt, &result) + + require.NoError(t, err) + require.Equal(t, "default-val", result) +} diff --git a/cli/azd/pkg/input/console.go b/cli/azd/pkg/input/console.go index b30f253929b..22c0a816b99 100644 --- a/cli/azd/pkg/input/console.go +++ b/cli/azd/pkg/input/console.go @@ -151,8 +151,9 @@ type AskerConsole struct { // - Spinner progress will be written as standard newline messages. // - Prompting assumes a non-terminal environment, where output written and input received are machine-friendly text, // stripped of formatting characters. - isTerminal bool - noPrompt bool + isTerminal bool + noPrompt bool + failOnPrompt bool // when non nil, use this client instead of prompting ourselves on the console. promptClient *externalPromptClient // noPromptDialog when true, disables SupportsPromptDialog() even when promptClient is set. @@ -582,6 +583,11 @@ func (c *AskerConsole) SupportsPromptDialog() bool { // PromptDialog prompts for multiple values using a single dialog. When successful, it returns a map of prompt IDs to their // values. func (c *AskerConsole) PromptDialog(ctx context.Context, dialog PromptDialog) (map[string]any, error) { + if c.failOnPrompt { + return nil, fmt.Errorf( + "interactive prompt not allowed in strict mode (--fail-on-prompt): %q"+ + " -- specify via command-line flags or environment variables", dialog.Title) + } request := externalPromptDialogRequest{ Title: dialog.Title, @@ -622,6 +628,12 @@ func (c *AskerConsole) PromptDialog(ctx context.Context, dialog PromptDialog) (m func (c *AskerConsole) Prompt(ctx context.Context, options ConsoleOptions) (string, error) { var response string + if c.failOnPrompt && c.promptClient != nil { + return "", fmt.Errorf( + "interactive prompt not allowed in strict mode (--fail-on-prompt): %q"+ + " -- specify via command-line flags or environment variables", options.Message) + } + if c.promptClient != nil { opts := promptOptions{ Type: "string", @@ -680,6 +692,12 @@ func choicesFromOptions(options ConsoleOptions) []promptChoice { // Prompts the user to select from a set of values func (c *AskerConsole) Select(ctx context.Context, options ConsoleOptions) (int, error) { + if c.failOnPrompt && c.promptClient != nil { + return -1, fmt.Errorf( + "interactive prompt not allowed in strict mode (--fail-on-prompt): %q"+ + " -- specify via command-line flags or environment variables", options.Message) + } + if c.promptClient != nil { opts := promptOptions{ Type: "select", @@ -760,6 +778,12 @@ func (c *AskerConsole) Select(ctx context.Context, options ConsoleOptions) (int, func (c *AskerConsole) MultiSelect(ctx context.Context, options ConsoleOptions) ([]string, error) { var response []string + if c.failOnPrompt && c.promptClient != nil { + return nil, fmt.Errorf( + "interactive prompt not allowed in strict mode (--fail-on-prompt): %q"+ + " -- specify via command-line flags or environment variables", options.Message) + } + if c.promptClient != nil { opts := promptOptions{ Type: "multiSelect", @@ -828,6 +852,12 @@ func (c *AskerConsole) MultiSelect(ctx context.Context, options ConsoleOptions) // Prompts the user to confirm an operation func (c *AskerConsole) Confirm(ctx context.Context, options ConsoleOptions) (bool, error) { + if c.failOnPrompt && c.promptClient != nil { + return false, fmt.Errorf( + "interactive prompt not allowed in strict mode (--fail-on-prompt): %q"+ + " -- specify via command-line flags or environment variables", options.Message) + } + if c.promptClient != nil { opts := promptOptions{ Type: "confirm", @@ -905,7 +935,7 @@ func (c *AskerConsole) EnsureBlankLine(ctx context.Context) { // wait until the next enter func (c *AskerConsole) WaitForEnter() { - if c.noPrompt { + if c.noPrompt || c.failOnPrompt { return } @@ -1019,12 +1049,13 @@ type ExternalPromptConfiguration struct { // instead of prompting on the console. func NewConsole( noPrompt bool, + failOnPrompt bool, isTerminal bool, writers Writers, handles ConsoleHandles, formatter output.Formatter, externalPromptCfg *ExternalPromptConfiguration) Console { - asker := NewAsker(noPrompt, isTerminal, handles.Stdout, handles.Stdin) + asker := NewAsker(noPrompt, failOnPrompt, isTerminal, handles.Stdout, handles.Stdin) c := &AskerConsole{ asker: asker, @@ -1035,6 +1066,7 @@ func NewConsole( isTerminal: isTerminal, currentIndent: atomic.NewString(""), noPrompt: noPrompt, + failOnPrompt: failOnPrompt, } if writers.Spinner == nil { diff --git a/cli/azd/pkg/input/console_helpers_test.go b/cli/azd/pkg/input/console_helpers_test.go index a84037a6c65..a84c3677b4b 100644 --- a/cli/azd/pkg/input/console_helpers_test.go +++ b/cli/azd/pkg/input/console_helpers_test.go @@ -25,6 +25,7 @@ func newTestConsole( c := NewConsole( noPrompt, false, + false, Writers{Output: buf}, ConsoleHandles{ Stderr: os.Stderr, @@ -188,6 +189,7 @@ func TestSupportsPromptDialog(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { c := NewConsole( + false, false, false, Writers{Output: &bytes.Buffer{}}, diff --git a/cli/azd/pkg/input/console_test.go b/cli/azd/pkg/input/console_test.go index 0c9535c30f2..48b9e595b01 100644 --- a/cli/azd/pkg/input/console_test.go +++ b/cli/azd/pkg/input/console_test.go @@ -51,6 +51,7 @@ func TestAskerConsole_Spinner_NonTty(t *testing.T) { lines := &lineCapturer{} c := NewConsole( + false, false, false, Writers{Output: lines}, @@ -99,6 +100,7 @@ func TestAskerConsole_Spinner_NonTty(t *testing.T) { func TestAskerConsoleExternalPrompt(t *testing.T) { newConsole := func(externalPromptCfg *ExternalPromptConfiguration) Console { return NewConsole( + false, false, false, Writers{ @@ -322,6 +324,7 @@ func TestAskerConsole_Message_JsonQueryFilter(t *testing.T) { c := NewConsole( true, false, + false, Writers{Output: writerAdapter{buf}}, ConsoleHandles{ Stderr: os.Stderr, @@ -346,6 +349,7 @@ func TestAskerConsole_Message_InvalidQuery_FallsBack(t *testing.T) { c := NewConsole( true, false, + false, Writers{Output: writerAdapter{buf}}, ConsoleHandles{ Stderr: os.Stderr, diff --git a/cli/azd/pkg/prompt/prompt_service.go b/cli/azd/pkg/prompt/prompt_service.go index ecda02797d6..82cf537f4ba 100644 --- a/cli/azd/pkg/prompt/prompt_service.go +++ b/cli/azd/pkg/prompt/prompt_service.go @@ -251,6 +251,15 @@ func (ps *promptService) PromptSubscription( hideId := isDemoModeEnabled() + // Handle --fail-on-prompt mode: require explicit subscription flag + if ps.globalOptions.FailOnPrompt { + return nil, fmt.Errorf( + "interactive prompt not allowed in strict mode:" + + " subscription selection" + + " (use --subscription flag or" + + " 'azd config set defaults.subscription ')") + } + // Handle --no-prompt mode if ps.globalOptions.NoPrompt { // Load subscriptions for both default lookup and auto-selection @@ -368,10 +377,17 @@ func (ps *promptService) PromptLocation( } } + // Handle --fail-on-prompt mode: require explicit location flag + if ps.globalOptions.FailOnPrompt { + return nil, fmt.Errorf( + "interactive prompt not allowed in strict mode:" + + " location selection" + + " (use --location flag or" + + " 'azd config set defaults.location ')") + } + // Handle --no-prompt mode if ps.globalOptions.NoPrompt { - // Default location always exists (fallback to eastus2), so we can use it - // Load locations and find the default locationList, err := ps.subscriptionManager.GetLocations( ctx, azureContext.Scope.SubscriptionId, @@ -506,6 +522,14 @@ func (ps *promptService) PromptResourceGroup( return nil, err } + // Handle --fail-on-prompt mode + if ps.globalOptions.FailOnPrompt { + return nil, fmt.Errorf( + "interactive prompt not allowed in strict mode:" + + " resource group selection" + + " (specify via environment configuration)") + } + // Handle --no-prompt mode if ps.globalOptions.NoPrompt { if azureContext.Scope.ResourceGroup == "" { @@ -638,6 +662,16 @@ func (ps *promptService) PromptSubscriptionResource( return nil, err } + // Handle --fail-on-prompt mode + if ps.globalOptions.FailOnPrompt { + return nil, fmt.Errorf( + "interactive prompt not allowed in strict mode:"+ + " %s selection"+ + " (specify via environment variable or"+ + " configuration file)", + resourceName) + } + // Handle --no-prompt mode if ps.globalOptions.NoPrompt { return nil, fmt.Errorf( @@ -784,6 +818,16 @@ func (ps *promptService) PromptResourceGroupResource( return nil, err } + // Handle --fail-on-prompt mode + if ps.globalOptions.FailOnPrompt { + return nil, fmt.Errorf( + "interactive prompt not allowed in strict mode:"+ + " %s selection"+ + " (specify via environment variable or"+ + " configuration file)", + resourceName) + } + // Handle --no-prompt mode if ps.globalOptions.NoPrompt { return nil, fmt.Errorf( diff --git a/cli/azd/pkg/prompt/prompt_service_test.go b/cli/azd/pkg/prompt/prompt_service_test.go index 939125d8ad9..4026f50abbf 100644 --- a/cli/azd/pkg/prompt/prompt_service_test.go +++ b/cli/azd/pkg/prompt/prompt_service_test.go @@ -399,3 +399,130 @@ func TestPromptLocation_NoPrompt_IgnoresEmptyAllowedValues(t *testing.T) { require.Equal(t, "westus3", location.Name) subscriptionManager.AssertExpectations(t) } + +func TestPromptSubscription_FailOnPrompt(t *testing.T) { + ucm := newInMemoryUserConfigManager(nil) + authManager := &mockauth.MockAuthManager{} + subscriptionManager := &mockaccount.MockSubscriptionManager{} + resourceService := &mockazapi.MockResourceService{} + mockConsole := mockinput.NewMockConsole() + + ps := NewPromptService( + authManager, + mockConsole, + ucm, + subscriptionManager, + resourceService, + &internal.GlobalCommandOptions{FailOnPrompt: true}, + ) + + result, err := ps.PromptSubscription(t.Context(), nil) + require.Nil(t, result) + require.Error(t, err) + require.Contains(t, err.Error(), "interactive prompt not allowed in strict mode") + require.Contains(t, err.Error(), "subscription selection") +} + +func TestPromptLocation_FailOnPrompt(t *testing.T) { + ucm := newInMemoryUserConfigManager(nil) + authManager := &mockauth.MockAuthManager{} + subscriptionManager := &mockaccount.MockSubscriptionManager{} + resourceService := &mockazapi.MockResourceService{} + mockConsole := mockinput.NewMockConsole() + + ps := NewPromptService( + authManager, + mockConsole, + ucm, + subscriptionManager, + resourceService, + &internal.GlobalCommandOptions{FailOnPrompt: true}, + ) + + result, err := ps.PromptLocation(t.Context(), &AzureContext{ + Scope: AzureScope{SubscriptionId: "sub-123"}, + }, nil) + require.Nil(t, result) + require.Error(t, err) + require.Contains(t, err.Error(), "interactive prompt not allowed in strict mode") + require.Contains(t, err.Error(), "location selection") +} + +func TestPromptResourceGroup_FailOnPrompt(t *testing.T) { + ucm := newInMemoryUserConfigManager(nil) + authManager := &mockauth.MockAuthManager{} + subscriptionManager := &mockaccount.MockSubscriptionManager{} + resourceService := &mockazapi.MockResourceService{} + mockConsole := mockinput.NewMockConsole() + + ps := NewPromptService( + authManager, + mockConsole, + ucm, + subscriptionManager, + resourceService, + &internal.GlobalCommandOptions{FailOnPrompt: true}, + ) + + result, err := ps.PromptResourceGroup(t.Context(), &AzureContext{ + Scope: AzureScope{SubscriptionId: "sub-123"}, + }, nil) + require.Nil(t, result) + require.Error(t, err) + require.Contains(t, err.Error(), "interactive prompt not allowed in strict mode") + require.Contains(t, err.Error(), "resource group selection") +} + +func TestPromptSubscriptionResource_FailOnPrompt(t *testing.T) { + ucm := newInMemoryUserConfigManager(nil) + authManager := &mockauth.MockAuthManager{} + subscriptionManager := &mockaccount.MockSubscriptionManager{} + resourceService := &mockazapi.MockResourceService{} + mockConsole := mockinput.NewMockConsole() + + ps := NewPromptService( + authManager, + mockConsole, + ucm, + subscriptionManager, + resourceService, + &internal.GlobalCommandOptions{FailOnPrompt: true}, + ) + + result, err := ps.PromptSubscriptionResource(t.Context(), &AzureContext{ + Scope: AzureScope{SubscriptionId: "sub-123"}, + }, ResourceOptions{ + ResourceTypeDisplayName: "test resource", + }) + require.Nil(t, result) + require.Error(t, err) + require.Contains(t, err.Error(), "interactive prompt not allowed in strict mode") + require.Contains(t, err.Error(), "test resource selection") +} + +func TestPromptResourceGroupResource_FailOnPrompt(t *testing.T) { + ucm := newInMemoryUserConfigManager(nil) + authManager := &mockauth.MockAuthManager{} + subscriptionManager := &mockaccount.MockSubscriptionManager{} + resourceService := &mockazapi.MockResourceService{} + mockConsole := mockinput.NewMockConsole() + + ps := NewPromptService( + authManager, + mockConsole, + ucm, + subscriptionManager, + resourceService, + &internal.GlobalCommandOptions{FailOnPrompt: true}, + ) + + result, err := ps.PromptResourceGroupResource(t.Context(), &AzureContext{ + Scope: AzureScope{SubscriptionId: "sub-123", ResourceGroup: "rg-1"}, + }, ResourceOptions{ + ResourceTypeDisplayName: "test resource", + }) + require.Nil(t, result) + require.Error(t, err) + require.Contains(t, err.Error(), "interactive prompt not allowed in strict mode") + require.Contains(t, err.Error(), "test resource selection") +}