From 9d5e60e3b38fc5252eb8a1506a0bd01e759a88e6 Mon Sep 17 00:00:00 2001 From: Wei Lim Date: Mon, 13 Apr 2026 15:44:58 -0700 Subject: [PATCH 1/3] Revert "Add --fail-on-prompt flag for strict non-interactive mode (#7394)" This reverts commit afd9a3123b90f499715cbd823121bc50f988d29d. --- cli/azd/cmd/auto_install.go | 23 +-- cli/azd/cmd/auto_install_test.go | 106 ++++-------- cli/azd/cmd/container.go | 15 +- cli/azd/cmd/external_prompt_test.go | 1 - cli/azd/cmd/testdata/TestFigSpec.ts | 5 - cli/azd/cmd/testdata/TestUsage-azd-add.snap | 1 - .../cmd/testdata/TestUsage-azd-ai-agent.snap | 1 - .../testdata/TestUsage-azd-ai-finetuning.snap | 1 - .../cmd/testdata/TestUsage-azd-ai-models.snap | 1 - cli/azd/cmd/testdata/TestUsage-azd-ai.snap | 1 - .../testdata/TestUsage-azd-appservice.snap | 1 - .../testdata/TestUsage-azd-auth-login.snap | 1 - .../testdata/TestUsage-azd-auth-logout.snap | 1 - .../testdata/TestUsage-azd-auth-status.snap | 1 - cli/azd/cmd/testdata/TestUsage-azd-auth.snap | 1 - .../testdata/TestUsage-azd-coding-agent.snap | 1 - .../TestUsage-azd-completion-bash.snap | 1 - .../TestUsage-azd-completion-fig.snap | 1 - .../TestUsage-azd-completion-fish.snap | 1 - .../TestUsage-azd-completion-powershell.snap | 1 - .../TestUsage-azd-completion-zsh.snap | 1 - .../testdata/TestUsage-azd-completion.snap | 1 - .../cmd/testdata/TestUsage-azd-concurx.snap | 1 - .../testdata/TestUsage-azd-config-get.snap | 1 - .../TestUsage-azd-config-list-alpha.snap | 1 - .../TestUsage-azd-config-options.snap | 1 - .../testdata/TestUsage-azd-config-reset.snap | 1 - .../testdata/TestUsage-azd-config-set.snap | 1 - .../testdata/TestUsage-azd-config-show.snap | 1 - .../testdata/TestUsage-azd-config-unset.snap | 1 - .../cmd/testdata/TestUsage-azd-config.snap | 1 - .../TestUsage-azd-copilot-consent-grant.snap | 1 - .../TestUsage-azd-copilot-consent-list.snap | 1 - .../TestUsage-azd-copilot-consent-revoke.snap | 1 - .../TestUsage-azd-copilot-consent.snap | 1 - .../cmd/testdata/TestUsage-azd-copilot.snap | 1 - cli/azd/cmd/testdata/TestUsage-azd-demo.snap | 1 - .../cmd/testdata/TestUsage-azd-deploy.snap | 11 +- cli/azd/cmd/testdata/TestUsage-azd-down.snap | 11 +- .../TestUsage-azd-env-config-get.snap | 11 +- .../TestUsage-azd-env-config-set.snap | 11 +- .../TestUsage-azd-env-config-unset.snap | 11 +- .../testdata/TestUsage-azd-env-config.snap | 1 - .../testdata/TestUsage-azd-env-get-value.snap | 11 +- .../TestUsage-azd-env-get-values.snap | 11 +- .../cmd/testdata/TestUsage-azd-env-list.snap | 1 - .../cmd/testdata/TestUsage-azd-env-new.snap | 1 - .../testdata/TestUsage-azd-env-refresh.snap | 11 +- .../testdata/TestUsage-azd-env-remove.snap | 11 +- .../testdata/TestUsage-azd-env-select.snap | 1 - .../TestUsage-azd-env-set-secret.snap | 11 +- .../cmd/testdata/TestUsage-azd-env-set.snap | 11 +- cli/azd/cmd/testdata/TestUsage-azd-env.snap | 1 - .../TestUsage-azd-extension-install.snap | 1 - .../TestUsage-azd-extension-list.snap | 1 - .../TestUsage-azd-extension-show.snap | 1 - .../TestUsage-azd-extension-source-add.snap | 1 - .../TestUsage-azd-extension-source-list.snap | 1 - ...TestUsage-azd-extension-source-remove.snap | 1 - ...stUsage-azd-extension-source-validate.snap | 1 - .../TestUsage-azd-extension-source.snap | 1 - .../TestUsage-azd-extension-uninstall.snap | 1 - .../TestUsage-azd-extension-upgrade.snap | 1 - .../cmd/testdata/TestUsage-azd-extension.snap | 1 - .../cmd/testdata/TestUsage-azd-hooks-run.snap | 11 +- cli/azd/cmd/testdata/TestUsage-azd-hooks.snap | 1 - .../TestUsage-azd-infra-generate.snap | 11 +- cli/azd/cmd/testdata/TestUsage-azd-infra.snap | 1 - cli/azd/cmd/testdata/TestUsage-azd-init.snap | 11 +- .../cmd/testdata/TestUsage-azd-mcp-start.snap | 1 - cli/azd/cmd/testdata/TestUsage-azd-mcp.snap | 1 - .../cmd/testdata/TestUsage-azd-monitor.snap | 11 +- .../cmd/testdata/TestUsage-azd-package.snap | 11 +- .../TestUsage-azd-pipeline-config.snap | 11 +- .../cmd/testdata/TestUsage-azd-pipeline.snap | 1 - .../cmd/testdata/TestUsage-azd-provision.snap | 11 +- .../cmd/testdata/TestUsage-azd-publish.snap | 11 +- .../cmd/testdata/TestUsage-azd-restore.snap | 11 +- cli/azd/cmd/testdata/TestUsage-azd-show.snap | 11 +- .../testdata/TestUsage-azd-template-list.snap | 1 - .../testdata/TestUsage-azd-template-show.snap | 1 - .../TestUsage-azd-template-source-add.snap | 1 - .../TestUsage-azd-template-source-list.snap | 1 - .../TestUsage-azd-template-source-remove.snap | 1 - .../TestUsage-azd-template-source.snap | 1 - .../cmd/testdata/TestUsage-azd-template.snap | 1 - cli/azd/cmd/testdata/TestUsage-azd-up.snap | 11 +- .../cmd/testdata/TestUsage-azd-update.snap | 1 - .../cmd/testdata/TestUsage-azd-version.snap | 1 - cli/azd/cmd/testdata/TestUsage-azd-x.snap | 1 - cli/azd/cmd/testdata/TestUsage-azd.snap | 1 - cli/azd/internal/global_command_options.go | 5 - cli/azd/internal/grpcserver/prompt_service.go | 29 ---- .../grpcserver/prompt_service_test.go | 74 -------- cli/azd/internal/repository/app_init_test.go | 1 - .../repository/detect_confirm_test.go | 1 - .../internal/repository/infra_confirm_test.go | 1 - cli/azd/internal/vsrpc/server_session.go | 2 +- cli/azd/pkg/input/asker.go | 26 +-- cli/azd/pkg/input/asker_test.go | 161 +----------------- cli/azd/pkg/input/console.go | 34 +--- cli/azd/pkg/input/console_helpers_test.go | 2 - cli/azd/pkg/input/console_test.go | 4 - cli/azd/pkg/input/fail_on_prompt_error.go | 30 ---- cli/azd/pkg/prompt/prompt_service.go | 48 +----- cli/azd/pkg/prompt/prompt_service_test.go | 127 -------------- 106 files changed, 169 insertions(+), 832 deletions(-) delete mode 100644 cli/azd/pkg/input/fail_on_prompt_error.go diff --git a/cli/azd/cmd/auto_install.go b/cli/azd/cmd/auto_install.go index 333499f8138..e9cf5d82e3c 100644 --- a/cli/azd/cmd/auto_install.go +++ b/cli/azd/cmd/auto_install.go @@ -724,11 +724,6 @@ 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 @@ -830,22 +825,10 @@ func ParseGlobalFlags(args []string, opts *internal.GlobalCommandOptions) error } } - 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() { + // 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() { 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 847bd459f33..5875e005ada 100644 --- a/cli/azd/cmd/auto_install_test.go +++ b/cli/azd/cmd/auto_install_test.go @@ -340,90 +340,58 @@ func TestCheckForMatchingExtension_Unit(t *testing.T) { func TestParseGlobalFlags_AgentDetection(t *testing.T) { tests := []struct { - name string - args []string - envVars map[string]string - expectedNoPrompt bool - expectedFailOnPrompt bool + name string + args []string + envVars map[string]string + expectedNoPrompt bool }{ { - name: "no agent detected, no flag", - args: []string{"up"}, - envVars: map[string]string{}, - expectedNoPrompt: false, - expectedFailOnPrompt: false, + name: "no agent detected, no flag", + args: []string{"up"}, + envVars: map[string]string{}, + expectedNoPrompt: false, }, { - 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 via env var, no flag", + args: []string{"up"}, + envVars: map[string]string{"CLAUDE_CODE": "1"}, + expectedNoPrompt: 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, - expectedFailOnPrompt: 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, }, { - 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: "agent detected but --no-prompt explicitly set true", + args: []string{"--no-prompt", "up"}, + envVars: map[string]string{"GEMINI_CLI": "1"}, + expectedNoPrompt: true, }, { - name: "no agent, --no-prompt explicitly set", - args: []string{"--no-prompt", "deploy"}, - envVars: map[string]string{}, - expectedNoPrompt: true, - expectedFailOnPrompt: false, + name: "no agent, --no-prompt explicitly set", + args: []string{"--no-prompt", "deploy"}, + envVars: map[string]string{}, + expectedNoPrompt: true, }, { - name: "Gemini agent detected", - args: []string{"init"}, - envVars: map[string]string{"GEMINI_CLI": "1"}, - expectedNoPrompt: true, - expectedFailOnPrompt: true, + name: "Gemini agent detected", + args: []string{"init"}, + envVars: map[string]string{"GEMINI_CLI": "1"}, + expectedNoPrompt: true, }, { - name: "GitHub Copilot CLI agent detected", - args: []string{"deploy"}, - envVars: map[string]string{"GITHUB_COPILOT_CLI": "true"}, - expectedNoPrompt: true, - expectedFailOnPrompt: true, + name: "GitHub Copilot CLI agent detected", + args: []string{"deploy"}, + envVars: map[string]string{"GITHUB_COPILOT_CLI": "true"}, + 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, + name: "OpenCode agent detected", + args: []string{"provision"}, + envVars: map[string]string{"OPENCODE": "1"}, + expectedNoPrompt: true, }, } @@ -454,8 +422,6 @@ 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 5bf68d112d8..7ce2d9c97b8 100644 --- a/cli/azd/cmd/container.go +++ b/cli/azd/cmd/container.go @@ -153,16 +153,11 @@ func registerCommonDependencies(container *ioc.NestedContainer) { } } - 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) + return input.NewConsole(rootOptions.NoPrompt, 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 e3f5302ff9f..2425fc291ce 100644 --- a/cli/azd/cmd/external_prompt_test.go +++ b/cli/azd/cmd/external_prompt_test.go @@ -79,7 +79,6 @@ 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 f3aac6281b0..57bd9352b53 100644 --- a/cli/azd/cmd/testdata/TestFigSpec.ts +++ b/cli/azd/cmd/testdata/TestFigSpec.ts @@ -3518,11 +3518,6 @@ 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 c87eb3a14dd..11209d07544 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-add.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-add.snap @@ -9,7 +9,6 @@ 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 32181eac312..e62da61e30b 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-ai-agent.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-ai-agent.snap @@ -9,7 +9,6 @@ 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 c6451d39694..2d078b0f730 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-ai-finetuning.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-ai-finetuning.snap @@ -9,7 +9,6 @@ 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 6e73868a78d..d1327bec7f6 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-ai-models.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-ai-models.snap @@ -9,7 +9,6 @@ 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 7a86874d0ca..b7cba1c07ba 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-ai.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-ai.snap @@ -14,7 +14,6 @@ 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 4af3abc9059..316fd405aac 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-appservice.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-appservice.snap @@ -9,7 +9,6 @@ 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 f77405fe827..8cc44be7014 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-auth-login.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-auth-login.snap @@ -20,7 +20,6 @@ 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 4544c058148..d9087aac6cd 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-auth-logout.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-auth-logout.snap @@ -9,7 +9,6 @@ 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 42c0b15ce7e..cc345fc049c 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-auth-status.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-auth-status.snap @@ -9,7 +9,6 @@ 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 87bb92d7e59..9729ccd7ddb 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-auth.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-auth.snap @@ -14,7 +14,6 @@ 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 c3d29b3ec4d..061ae82d4ce 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-coding-agent.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-coding-agent.snap @@ -9,7 +9,6 @@ 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 4381946d06a..cf52d0c75e0 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-completion-bash.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-completion-bash.snap @@ -12,7 +12,6 @@ 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 5bbbbeb2769..ec79fe09e40 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-completion-fig.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-completion-fig.snap @@ -9,7 +9,6 @@ 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 d2fd2310284..8b9098a5ad5 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-completion-fish.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-completion-fish.snap @@ -9,7 +9,6 @@ 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 1612a4ce62e..9fd63435228 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-completion-powershell.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-completion-powershell.snap @@ -9,7 +9,6 @@ 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 a3ea19d974f..1963126b802 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-completion-zsh.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-completion-zsh.snap @@ -13,7 +13,6 @@ 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 be910b93be3..36db73ecdee 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-completion.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-completion.snap @@ -16,7 +16,6 @@ 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 e0b76672a27..8e8936fc252 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-concurx.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-concurx.snap @@ -9,7 +9,6 @@ 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 c7cfb9f030c..33fdd98a47c 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-config-get.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-config-get.snap @@ -9,7 +9,6 @@ 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 e7f97812c84..0094122eaf0 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-config-list-alpha.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-config-list-alpha.snap @@ -9,7 +9,6 @@ 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 4315ff971ec..8fa858952df 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-config-options.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-config-options.snap @@ -9,7 +9,6 @@ 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 5897dc3a9e8..83c41f51be0 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-config-reset.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-config-reset.snap @@ -12,7 +12,6 @@ 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 8eb0fc7743c..1c0bf8acbb3 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-config-set.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-config-set.snap @@ -9,7 +9,6 @@ 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 1414de1b579..518483f35ea 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-config-show.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-config-show.snap @@ -9,7 +9,6 @@ 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 f97dbb04acb..14bc744972c 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-config-unset.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-config-unset.snap @@ -9,7 +9,6 @@ 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 d29ec5d111b..c6812a024f5 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-config.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-config.snap @@ -22,7 +22,6 @@ 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 7134ad3b708..0d99f6023b7 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-copilot-consent-grant.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-copilot-consent-grant.snap @@ -18,7 +18,6 @@ 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 de6fd7947d7..c013ceb8351 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-copilot-consent-list.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-copilot-consent-list.snap @@ -16,7 +16,6 @@ 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 269a841d3b5..472b67e4119 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-copilot-consent-revoke.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-copilot-consent-revoke.snap @@ -16,7 +16,6 @@ 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 fd7c46e1b9b..752b63165da 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-copilot-consent.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-copilot-consent.snap @@ -14,7 +14,6 @@ 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 b5dcb796650..337ebacf80f 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-copilot.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-copilot.snap @@ -12,7 +12,6 @@ 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 8d8f255bbe5..e55fe63154a 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-demo.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-demo.snap @@ -9,7 +9,6 @@ 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 4c48b027a63..9affa80b9e2 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-deploy.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-deploy.snap @@ -15,12 +15,11 @@ 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. - --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. + -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. 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 4afdd9d7637..24a88a1d10f 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-down.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-down.snap @@ -12,12 +12,11 @@ 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. - --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. + -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. 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 6686ce80b5c..e0f5e0b8ca3 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-env-config-get.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-env-config-get.snap @@ -8,12 +8,11 @@ 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. - --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. + -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. 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 06eac800882..1f9f91d4086 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-env-config-set.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-env-config-set.snap @@ -8,12 +8,11 @@ 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. - --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. + -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. 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 6d48c3812be..8d6934bfcef 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-env-config-unset.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-env-config-unset.snap @@ -8,12 +8,11 @@ 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. - --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. + -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. 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 5ee3f034a1a..1d45f651488 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-env-config.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-env-config.snap @@ -18,7 +18,6 @@ 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 a8ed464d4ad..fc6d79d8ef2 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-env-get-value.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-env-get-value.snap @@ -8,12 +8,11 @@ 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. - --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. + -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. 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 db3517b4389..7c8296ba56d 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-env-get-values.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-env-get-values.snap @@ -8,12 +8,11 @@ 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. - --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. + -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. 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 f9de285d4ad..abadf8f0286 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-env-list.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-env-list.snap @@ -9,7 +9,6 @@ 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 5b5d1393c74..5ff6986685b 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-env-new.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-env-new.snap @@ -13,7 +13,6 @@ 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 7e7c27cb464..786ba5faf86 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-env-refresh.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-env-refresh.snap @@ -10,12 +10,11 @@ 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. - --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. + -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. 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 ce9b4e5b2d1..06a4ffc0f84 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-env-remove.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-env-remove.snap @@ -12,12 +12,11 @@ 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. - --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. + -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. 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 fb045dfd8f9..65b2075488f 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-env-select.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-env-select.snap @@ -9,7 +9,6 @@ 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 5e805704e58..6fa73e3fa94 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-env-set-secret.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-env-set-secret.snap @@ -8,12 +8,11 @@ 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. - --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. + -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. 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 67fceaa283e..038d32ce199 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-env-set.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-env-set.snap @@ -9,12 +9,11 @@ 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. - --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. + -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. 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 fff45bb8bfc..78060906ebe 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-env.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-env.snap @@ -26,7 +26,6 @@ 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 940fe467882..5992ce8d59f 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-extension-install.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-extension-install.snap @@ -14,7 +14,6 @@ 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 417a17451bd..6b036f31527 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-extension-list.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-extension-list.snap @@ -14,7 +14,6 @@ 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 c0fd325e0a5..5be9f3a34e6 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-extension-show.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-extension-show.snap @@ -12,7 +12,6 @@ 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 23bf1b38943..94783cf2ed0 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-extension-source-add.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-extension-source-add.snap @@ -14,7 +14,6 @@ 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 073f52f49af..c7f3f5d83aa 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-extension-source-list.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-extension-source-list.snap @@ -9,7 +9,6 @@ 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 bcd02df5fe4..8fc14987e22 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-extension-source-remove.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-extension-source-remove.snap @@ -9,7 +9,6 @@ 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 f1c8e6a3fe8..e8aadf6bbd2 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-extension-source-validate.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-extension-source-validate.snap @@ -12,7 +12,6 @@ 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 d3cdbb45e91..706d16fb3ea 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-extension-source.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-extension-source.snap @@ -15,7 +15,6 @@ 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 3d45250250c..2f5362e7d64 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-extension-uninstall.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-extension-uninstall.snap @@ -12,7 +12,6 @@ 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 8d185283edf..aa0c8a0bc75 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-extension-upgrade.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-extension-upgrade.snap @@ -14,7 +14,6 @@ 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 942579e4667..e22ac3e811b 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-extension.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-extension.snap @@ -17,7 +17,6 @@ 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 d54332b258a..e51a58ac200 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-hooks-run.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-hooks-run.snap @@ -11,12 +11,11 @@ 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. - --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. + -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. 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 9e1db1fddc7..04694438fdb 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-hooks.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-hooks.snap @@ -12,7 +12,6 @@ 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 735b340413f..8316acc388b 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-infra-generate.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-infra-generate.snap @@ -9,12 +9,11 @@ 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. - --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. + -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. 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 328bf9c7265..baa85b98824 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-infra.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-infra.snap @@ -12,7 +12,6 @@ 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 a3cd8efd0a6..7f09a7a7188 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-init.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-init.snap @@ -19,12 +19,11 @@ 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. - --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. + -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. 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 582692ba1f7..e939d3cd760 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-mcp-start.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-mcp-start.snap @@ -9,7 +9,6 @@ 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 4b405b181e0..f4ffa5d3f99 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-mcp.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-mcp.snap @@ -12,7 +12,6 @@ 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 8775592c866..b3a61421a00 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-monitor.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-monitor.snap @@ -11,12 +11,11 @@ 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. - --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. + -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. 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 1e3e3a2ee8d..46e5ed27b47 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-package.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-package.snap @@ -14,12 +14,11 @@ 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. - --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. + -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. 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 fc63bf5285f..00371f49934 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-pipeline-config.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-pipeline-config.snap @@ -19,12 +19,11 @@ 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. - --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. + -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. 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 eeda0fced80..d6a04b90891 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-pipeline.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-pipeline.snap @@ -16,7 +16,6 @@ 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 c26fe558a7c..7f18fcae373 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-provision.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-provision.snap @@ -26,12 +26,11 @@ 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. - --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. + -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. 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 34a523c8a13..18b42fc6577 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-publish.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-publish.snap @@ -15,12 +15,11 @@ 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. - --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. + -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. 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 2a1aca9bb41..7c571438a97 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-restore.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-restore.snap @@ -12,12 +12,11 @@ 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. - --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. + -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. 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 e6166165a7d..45c2db40117 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-show.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-show.snap @@ -9,12 +9,11 @@ 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. - --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. + -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. 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 0adf63e39f3..cce5d2055db 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-template-list.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-template-list.snap @@ -13,7 +13,6 @@ 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 b90578bc030..e45f70a8d12 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-template-show.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-template-show.snap @@ -9,7 +9,6 @@ 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 2ce6dfce59c..193f36d47d4 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-template-source-add.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-template-source-add.snap @@ -18,7 +18,6 @@ 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 fe106b4893e..b7c111e7255 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-template-source-list.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-template-source-list.snap @@ -9,7 +9,6 @@ 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 2505bb0317c..2949735e5ed 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-template-source-remove.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-template-source-remove.snap @@ -9,7 +9,6 @@ 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 ae756ee9c28..7d938010bb6 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-template-source.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-template-source.snap @@ -17,7 +17,6 @@ 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 275124c19dc..3042858f24c 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-template.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-template.snap @@ -18,7 +18,6 @@ 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 a8b22b1d6ae..be5be60fa75 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-up.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-up.snap @@ -35,12 +35,11 @@ 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. - --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. + -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. 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-update.snap b/cli/azd/cmd/testdata/TestUsage-azd-update.snap index 4b8260254f4..28970b06c8a 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-update.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-update.snap @@ -13,7 +13,6 @@ Global Flags --debug : Enables debugging and diagnostics logging. --docs : Opens the documentation for azd update 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 update. --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-version.snap b/cli/azd/cmd/testdata/TestUsage-azd-version.snap index c5b385c7545..7a7656aebc8 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-version.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-version.snap @@ -9,7 +9,6 @@ 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 0a921262593..2c5b3245f63 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-x.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-x.snap @@ -9,7 +9,6 @@ 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 4dc45c6f367..46400066c1f 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd.snap @@ -51,7 +51,6 @@ 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/internal/global_command_options.go b/cli/azd/internal/global_command_options.go index e8c662f7925..47b8d0a14f5 100644 --- a/cli/azd/internal/global_command_options.go +++ b/cli/azd/internal/global_command_options.go @@ -33,11 +33,6 @@ 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 67364cff224..5d2adf580de 100644 --- a/cli/azd/internal/grpcserver/prompt_service.go +++ b/cli/azd/internal/grpcserver/prompt_service.go @@ -16,7 +16,6 @@ import ( "github.com/azure/azure-dev/cli/azd/pkg/ai" "github.com/azure/azure-dev/cli/azd/pkg/azapi" "github.com/azure/azure-dev/cli/azd/pkg/azdext" - "github.com/azure/azure-dev/cli/azd/pkg/input" "github.com/azure/azure-dev/cli/azd/pkg/output" "github.com/azure/azure-dev/cli/azd/pkg/prompt" "github.com/azure/azure-dev/cli/azd/pkg/ux" @@ -53,10 +52,6 @@ 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, input.FailOnPromptError(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) @@ -94,14 +89,6 @@ 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, input.FailOnPromptSelectError(req.Options.Message, choiceLabels) - } - if s.globalOptions.NoPrompt { if req.Options.SelectedIndex == nil { return nil, fmt.Errorf("no default selection for prompt '%s'", req.Options.Message) @@ -152,14 +139,6 @@ 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, input.FailOnPromptSelectError(req.Options.Message, choiceLabels) - } - if s.globalOptions.NoPrompt { var selectedChoices []*azdext.MultiSelectChoice for _, choice := range req.Options.Choices { @@ -215,14 +194,6 @@ func (s *promptService) MultiSelect( } func (s *promptService) Prompt(ctx context.Context, req *azdext.PromptRequest) (*azdext.PromptResponse, error) { - if req == nil || req.Options == nil { - return nil, status.Error(codes.InvalidArgument, "request and options are required") - } - - if s.globalOptions.FailOnPrompt { - return nil, input.FailOnPromptError(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 5309c110873..e030bb3d826 100644 --- a/cli/azd/internal/grpcserver/prompt_service_test.go +++ b/cli/azd/internal/grpcserver/prompt_service_test.go @@ -158,80 +158,6 @@ 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 dee7c377dd0..bccb7b45b74 100644 --- a/cli/azd/internal/repository/app_init_test.go +++ b/cli/azd/internal/repository/app_init_test.go @@ -272,7 +272,6 @@ 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 75f2208354b..172c86084dc 100644 --- a/cli/azd/internal/repository/detect_confirm_test.go +++ b/cli/azd/internal/repository/detect_confirm_test.go @@ -210,7 +210,6 @@ 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 9b4b64ed086..3f3b684938c 100644 --- a/cli/azd/internal/repository/infra_confirm_test.go +++ b/cli/azd/internal/repository/infra_confirm_test.go @@ -218,7 +218,6 @@ 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 f657d316797..5d36dbc8c9d 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, false, input.Writers{ + return input.NewConsole(true, 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 bd9651be346..fdf17299589 100644 --- a/cli/azd/pkg/input/asker.go +++ b/cli/azd/pkg/input/asker.go @@ -17,14 +17,7 @@ import ( type Asker func(p survey.Prompt, response any) error -// 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 - } - +func NewAsker(noPrompt bool, isTerminal bool, w io.Writer, r io.Reader) Asker { if noPrompt { return askOneNoPrompt } @@ -34,23 +27,6 @@ func NewAsker(noPrompt bool, failOnPrompt bool, isTerminal bool, w io.Writer, r } } -func askOneFailOnPrompt(p survey.Prompt, _ any) error { - switch v := p.(type) { - case *survey.Input: - return FailOnPromptError(v.Message) - case *survey.Select: - return FailOnPromptSelectError(v.Message, v.Options) - case *survey.Confirm: - return FailOnPromptError(v.Message) - case *survey.MultiSelect: - return FailOnPromptSelectError(v.Message, v.Options) - case *survey.Password: - return FailOnPromptError(v.Message) - default: - return FailOnPromptError("") - } -} - 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 43860efd62f..861f8d2477f 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, false, nil, nil) + asker := NewAsker(true, 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, false, w, r) + asker := NewAsker(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, false, w, r) + asker := NewAsker(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, false, w, r) + asker := NewAsker(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, false, w, r) + asker := NewAsker(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, false, w, r) + asker := NewAsker(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, false, &bytes.Buffer{}, strings.NewReader("")) + asker := NewAsker(false, false, &bytes.Buffer{}, strings.NewReader("")) require.Panics(t, func() { var result string @@ -539,150 +539,3 @@ 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 d93d3643c44..b30f253929b 100644 --- a/cli/azd/pkg/input/console.go +++ b/cli/azd/pkg/input/console.go @@ -151,9 +151,8 @@ 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 - failOnPrompt bool + isTerminal bool + noPrompt 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. @@ -583,9 +582,6 @@ 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, FailOnPromptError(dialog.Title) - } request := externalPromptDialogRequest{ Title: dialog.Title, @@ -626,10 +622,6 @@ 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 "", FailOnPromptError(options.Message) - } - if c.promptClient != nil { opts := promptOptions{ Type: "string", @@ -688,12 +680,6 @@ 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 { - choiceLabels := make([]string, len(options.Options)) - copy(choiceLabels, options.Options) - return -1, FailOnPromptSelectError(options.Message, choiceLabels) - } - if c.promptClient != nil { opts := promptOptions{ Type: "select", @@ -774,12 +760,6 @@ 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 { - choiceLabels := make([]string, len(options.Options)) - copy(choiceLabels, options.Options) - return nil, FailOnPromptSelectError(options.Message, choiceLabels) - } - if c.promptClient != nil { opts := promptOptions{ Type: "multiSelect", @@ -848,10 +828,6 @@ 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, FailOnPromptError(options.Message) - } - if c.promptClient != nil { opts := promptOptions{ Type: "confirm", @@ -929,7 +905,7 @@ func (c *AskerConsole) EnsureBlankLine(ctx context.Context) { // wait until the next enter func (c *AskerConsole) WaitForEnter() { - if c.noPrompt || c.failOnPrompt { + if c.noPrompt { return } @@ -1043,13 +1019,12 @@ 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, failOnPrompt, isTerminal, handles.Stdout, handles.Stdin) + asker := NewAsker(noPrompt, isTerminal, handles.Stdout, handles.Stdin) c := &AskerConsole{ asker: asker, @@ -1060,7 +1035,6 @@ 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 a84c3677b4b..a84037a6c65 100644 --- a/cli/azd/pkg/input/console_helpers_test.go +++ b/cli/azd/pkg/input/console_helpers_test.go @@ -25,7 +25,6 @@ func newTestConsole( c := NewConsole( noPrompt, false, - false, Writers{Output: buf}, ConsoleHandles{ Stderr: os.Stderr, @@ -189,7 +188,6 @@ 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 48b9e595b01..0c9535c30f2 100644 --- a/cli/azd/pkg/input/console_test.go +++ b/cli/azd/pkg/input/console_test.go @@ -51,7 +51,6 @@ func TestAskerConsole_Spinner_NonTty(t *testing.T) { lines := &lineCapturer{} c := NewConsole( - false, false, false, Writers{Output: lines}, @@ -100,7 +99,6 @@ func TestAskerConsole_Spinner_NonTty(t *testing.T) { func TestAskerConsoleExternalPrompt(t *testing.T) { newConsole := func(externalPromptCfg *ExternalPromptConfiguration) Console { return NewConsole( - false, false, false, Writers{ @@ -324,7 +322,6 @@ func TestAskerConsole_Message_JsonQueryFilter(t *testing.T) { c := NewConsole( true, false, - false, Writers{Output: writerAdapter{buf}}, ConsoleHandles{ Stderr: os.Stderr, @@ -349,7 +346,6 @@ 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/input/fail_on_prompt_error.go b/cli/azd/pkg/input/fail_on_prompt_error.go deleted file mode 100644 index ff7c54b69a3..00000000000 --- a/cli/azd/pkg/input/fail_on_prompt_error.go +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package input - -import ( - "fmt" - "strings" -) - -// FailOnPromptError returns a consistent error for when --fail-on-prompt blocks a simple prompt. -func FailOnPromptError(promptMessage string) error { - return fmt.Errorf( - "interactive prompt not allowed in strict mode (--fail-on-prompt): %q"+ - " -- provide the value via command-line flags or environment variables", - promptMessage, - ) -} - -// FailOnPromptSelectError returns a consistent error for when --fail-on-prompt blocks a selection prompt, -// including the available options in the message. -func FailOnPromptSelectError(promptMessage string, options []string) error { - return fmt.Errorf( - "interactive prompt not allowed in strict mode (--fail-on-prompt): %q"+ - " (available options: %s)"+ - " -- specify via command-line flags or environment variables", - promptMessage, - strings.Join(options, ", "), - ) -} diff --git a/cli/azd/pkg/prompt/prompt_service.go b/cli/azd/pkg/prompt/prompt_service.go index 82cf537f4ba..ecda02797d6 100644 --- a/cli/azd/pkg/prompt/prompt_service.go +++ b/cli/azd/pkg/prompt/prompt_service.go @@ -251,15 +251,6 @@ 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 @@ -377,17 +368,10 @@ 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, @@ -522,14 +506,6 @@ 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 == "" { @@ -662,16 +638,6 @@ 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( @@ -818,16 +784,6 @@ 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 4026f50abbf..939125d8ad9 100644 --- a/cli/azd/pkg/prompt/prompt_service_test.go +++ b/cli/azd/pkg/prompt/prompt_service_test.go @@ -399,130 +399,3 @@ 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") -} From bd20bd24eefea7f4c7f0eec76e4df79ce8322389 Mon Sep 17 00:00:00 2001 From: Rajesh Kamal Date: Wed, 15 Apr 2026 11:15:29 -0700 Subject: [PATCH 2/3] Fix console_test.go after merge with main PR #7701 added a test calling NewConsole with the failOnPrompt parameter. After merging main into the revert branch, this test had the wrong call signature. Removed the extra arg to match the reverted signature. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- cli/azd/pkg/input/console_test.go | 1 - 1 file changed, 1 deletion(-) diff --git a/cli/azd/pkg/input/console_test.go b/cli/azd/pkg/input/console_test.go index 9380d2948c8..49d27416dde 100644 --- a/cli/azd/pkg/input/console_test.go +++ b/cli/azd/pkg/input/console_test.go @@ -371,7 +371,6 @@ func TestAskerConsole_Message_EmptySkippedInJson(t *testing.T) { c := NewConsole( true, false, - false, Writers{Output: writerAdapter{buf}}, ConsoleHandles{ Stderr: os.Stderr, From 2fcd4e8b0913b3a698f83e85116b29898d28f9ba Mon Sep 17 00:00:00 2001 From: Rajesh Kamal Date: Wed, 15 Apr 2026 11:19:28 -0700 Subject: [PATCH 3/3] Remove --fail-on-prompt changelog entry Feature is being reverted, remove the changelog entry for #7394. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- cli/azd/CHANGELOG.md | 1 - 1 file changed, 1 deletion(-) diff --git a/cli/azd/CHANGELOG.md b/cli/azd/CHANGELOG.md index c68d7b84320..3dd0a1d1353 100644 --- a/cli/azd/CHANGELOG.md +++ b/cli/azd/CHANGELOG.md @@ -18,7 +18,6 @@ - [[#7652]](https://github.com/Azure/azure-dev/pull/7652) Add C#/.NET hook support in `azure.yaml`; hooks pointing to `.cs` files are auto-detected and executed using `dotnet run`, with automatic project discovery and support for single-file scripts on .NET 10+. - [[#7690]](https://github.com/Azure/azure-dev/pull/7690) Add executor-specific `config:` block for hooks in `azure.yaml`; configure `packageManager` for JS/TS hooks, `virtualEnvName` for Python hooks, and `configuration`/`framework` for .NET hooks. - [[#7685]](https://github.com/Azure/azure-dev/pull/7685) Add `.azdignore` support for `azd init`; template authors can create a `.azdignore` file in the template root to exclude contributor-only files (e.g., `SECURITY.md`, `.github/`) from being copied to consumer projects. -- [[#7394]](https://github.com/Azure/azure-dev/pull/7394) Add `--fail-on-prompt` global flag that immediately fails with an actionable error when any interactive prompt is encountered; azd automatically enables this when invoked from an AI coding agent. Thanks @spboyer for the contribution! - [[#7672]](https://github.com/Azure/azure-dev/pull/7672) Add AI model quota preflight check; `azd provision` now detects Azure Cognitive Services model deployments in the Bicep snapshot and validates quota availability before provisioning, warning on exceeded quota or unrecognized model names. ### Bugs Fixed