diff --git a/.gitattributes b/.gitattributes index ff6c89b8c..aa482a916 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,2 +1,3 @@ *.go text eol=lf +*.snap text eol=lf *.txt text eol=lf \ No newline at end of file diff --git a/.vscode/cspell-github-user-aliases.txt b/.vscode/cspell-github-user-aliases.txt index 0dbea49ca..4d66eda81 100644 --- a/.vscode/cspell-github-user-aliases.txt +++ b/.vscode/cspell-github-user-aliases.txt @@ -17,3 +17,4 @@ sethvargo stretchr theckman benbjohnson +bradleyjkemp diff --git a/cli/azd/.vscode/cspell-azd-dictionary.txt b/cli/azd/.vscode/cspell-azd-dictionary.txt index 10f23cb03..3a575221a 100644 --- a/cli/azd/.vscode/cspell-azd-dictionary.txt +++ b/cli/azd/.vscode/cspell-azd-dictionary.txt @@ -29,6 +29,7 @@ cflags cmdsubst containerapp csharpapp +cupaloy devel dockerproject dskip @@ -70,6 +71,7 @@ rzip semconv serverfarms setenvs +snapshotter sstore staticcheck staticwebapp diff --git a/cli/azd/cmd/testdata/TestUsage-azd-config-get.snap b/cli/azd/cmd/testdata/TestUsage-azd-config-get.snap new file mode 100644 index 000000000..d6e533a11 --- /dev/null +++ b/cli/azd/cmd/testdata/TestUsage-azd-config-get.snap @@ -0,0 +1,13 @@ +Usage: + azd config get [flags] + +Flags: + -h, --help Gets help for get. + -o, --output string The output format (the supported formats are json). (default "json") + +Global 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. + --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.snap b/cli/azd/cmd/testdata/TestUsage-azd-config-list.snap new file mode 100644 index 000000000..69dc1ebb8 --- /dev/null +++ b/cli/azd/cmd/testdata/TestUsage-azd-config-list.snap @@ -0,0 +1,13 @@ +Usage: + azd config list [flags] + +Flags: + -h, --help Gets help for list. + -o, --output string The output format (the supported formats are json). (default "json") + +Global 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. + --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 new file mode 100644 index 000000000..43f9f9916 --- /dev/null +++ b/cli/azd/cmd/testdata/TestUsage-azd-config-reset.snap @@ -0,0 +1,12 @@ +Usage: + azd config reset [flags] + +Flags: + -h, --help Gets help for reset. + +Global 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. + --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 new file mode 100644 index 000000000..16f9b1304 --- /dev/null +++ b/cli/azd/cmd/testdata/TestUsage-azd-config-set.snap @@ -0,0 +1,16 @@ +Usage: + azd config set [flags] + +Examples: +$ azd config set defaults.subscription +$ azd config set defaults.location eastus + +Flags: + -h, --help Gets help for set. + +Global 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. + --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 new file mode 100644 index 000000000..c55ae3c4e --- /dev/null +++ b/cli/azd/cmd/testdata/TestUsage-azd-config-unset.snap @@ -0,0 +1,15 @@ +Usage: + azd config unset [flags] + +Examples: +$ azd config unset defaults.location + +Flags: + -h, --help Gets help for unset. + +Global 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. + --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 new file mode 100644 index 000000000..f67e42bc1 --- /dev/null +++ b/cli/azd/cmd/testdata/TestUsage-azd-config.snap @@ -0,0 +1,21 @@ +Usage: + azd config [command] + +Available Commands: + get Gets a configuration + list Lists all configuration values + reset Resets configuration to default + set Sets a configuration + unset Unsets a configuration + +Flags: + -h, --help Gets help for config. + +Global 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. + --no-prompt Accepts the default value instead of prompting, or it fails if there is no default. + +Use "azd config [command] --help" for more information about a command. + diff --git a/cli/azd/cmd/testdata/TestUsage-azd-deploy.snap b/cli/azd/cmd/testdata/TestUsage-azd-deploy.snap new file mode 100644 index 000000000..63c449f46 --- /dev/null +++ b/cli/azd/cmd/testdata/TestUsage-azd-deploy.snap @@ -0,0 +1,14 @@ +Usage: + azd deploy [flags] + +Flags: + -h, --help Gets help for deploy. + -o, --output string The output format (the supported formats are json, none). (default "none") + --service string Deploys a specific service (when the string is unspecified, all services that are listed in the azure.yaml file are deployed). + +Global 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. + --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-down.snap b/cli/azd/cmd/testdata/TestUsage-azd-down.snap new file mode 100644 index 000000000..7882adaad --- /dev/null +++ b/cli/azd/cmd/testdata/TestUsage-azd-down.snap @@ -0,0 +1,15 @@ +Usage: + azd down [flags] + +Flags: + --force Does not require confirmation before it deletes resources. + -h, --help Gets help for down. + -o, --output string The output format (the supported formats are json, none). (default "none") + --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. + -e, --environment string The name of the environment to use. + --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-values.snap b/cli/azd/cmd/testdata/TestUsage-azd-env-get-values.snap new file mode 100644 index 000000000..7206309c6 --- /dev/null +++ b/cli/azd/cmd/testdata/TestUsage-azd-env-get-values.snap @@ -0,0 +1,13 @@ +Usage: + azd env get-values [flags] + +Flags: + -h, --help Gets help for get-values. + -o, --output string The output format (the supported formats are json, dotenv). (default "dotenv") + +Global 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. + --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-list.snap b/cli/azd/cmd/testdata/TestUsage-azd-env-list.snap new file mode 100644 index 000000000..7f50e5180 --- /dev/null +++ b/cli/azd/cmd/testdata/TestUsage-azd-env-list.snap @@ -0,0 +1,16 @@ +Usage: + azd env list [flags] + +Aliases: + list, ls + +Flags: + -h, --help Gets help for list. + -o, --output string The output format (the supported formats are json, table). (default "table") + +Global 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. + --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 new file mode 100644 index 000000000..b1c1f517b --- /dev/null +++ b/cli/azd/cmd/testdata/TestUsage-azd-env-new.snap @@ -0,0 +1,14 @@ +Usage: + azd env new [flags] + +Flags: + -h, --help Gets help for new. + -l, --location string Azure location for the new environment + --subscription string Name or 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. + -e, --environment string The name of the environment to use. + --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 new file mode 100644 index 000000000..d443c810c --- /dev/null +++ b/cli/azd/cmd/testdata/TestUsage-azd-env-refresh.snap @@ -0,0 +1,13 @@ +Usage: + azd env refresh [flags] + +Flags: + -h, --help Gets help for refresh. + -o, --output string The output format (the supported formats are json, none). (default "none") + +Global 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. + --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-select.snap b/cli/azd/cmd/testdata/TestUsage-azd-env-select.snap new file mode 100644 index 000000000..1647ec31c --- /dev/null +++ b/cli/azd/cmd/testdata/TestUsage-azd-env-select.snap @@ -0,0 +1,12 @@ +Usage: + azd env select [flags] + +Flags: + -h, --help Gets help for select. + +Global 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. + --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.snap b/cli/azd/cmd/testdata/TestUsage-azd-env-set.snap new file mode 100644 index 000000000..32f74747d --- /dev/null +++ b/cli/azd/cmd/testdata/TestUsage-azd-env-set.snap @@ -0,0 +1,12 @@ +Usage: + azd env set [flags] + +Flags: + -h, --help Gets help for set. + +Global 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. + --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.snap b/cli/azd/cmd/testdata/TestUsage-azd-env.snap new file mode 100644 index 000000000..bee344e6e --- /dev/null +++ b/cli/azd/cmd/testdata/TestUsage-azd-env.snap @@ -0,0 +1,22 @@ +Usage: + azd env [command] + +Available Commands: + get-values Get all environment values. + list List environments + new Create a new environment. + refresh Refresh environment settings by using information from a previous infrastructure provision. + select Set the default environment. + set Set a value in the environment. + +Flags: + -h, --help Gets help for env. + +Global 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. + --no-prompt Accepts the default value instead of prompting, or it fails if there is no default. + +Use "azd env [command] --help" for more information about a command. + diff --git a/cli/azd/cmd/testdata/TestUsage-azd-infra-create.snap b/cli/azd/cmd/testdata/TestUsage-azd-infra-create.snap new file mode 100644 index 000000000..4416bc4d6 --- /dev/null +++ b/cli/azd/cmd/testdata/TestUsage-azd-infra-create.snap @@ -0,0 +1,17 @@ +Usage: + azd infra create [flags] + +Aliases: + create, provision + +Flags: + -h, --help Gets help for create. + --no-progress Suppresses progress information. + -o, --output string The output format (the supported formats are json, none). (default "none") + +Global 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. + --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-delete.snap b/cli/azd/cmd/testdata/TestUsage-azd-infra-delete.snap new file mode 100644 index 000000000..c391c8dc7 --- /dev/null +++ b/cli/azd/cmd/testdata/TestUsage-azd-infra-delete.snap @@ -0,0 +1,14 @@ +Usage: + azd infra delete [flags] + +Flags: + --force Does not require confirmation before it deletes resources. + -h, --help Gets help for delete. + --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. + -e, --environment string The name of the environment to use. + --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.snap b/cli/azd/cmd/testdata/TestUsage-azd-infra.snap new file mode 100644 index 000000000..b40db8ac3 --- /dev/null +++ b/cli/azd/cmd/testdata/TestUsage-azd-infra.snap @@ -0,0 +1,18 @@ +Usage: + azd infra [command] + +Available Commands: + create Create Azure resources for an application. + delete Delete Azure resources for an application. + +Flags: + -h, --help Gets help for infra. + +Global 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. + --no-prompt Accepts the default value instead of prompting, or it fails if there is no default. + +Use "azd infra [command] --help" for more information about a command. + diff --git a/cli/azd/cmd/testdata/TestUsage-azd-init.snap b/cli/azd/cmd/testdata/TestUsage-azd-init.snap new file mode 100644 index 000000000..cd47c4261 --- /dev/null +++ b/cli/azd/cmd/testdata/TestUsage-azd-init.snap @@ -0,0 +1,16 @@ +Usage: + azd init [flags] + +Flags: + -b, --branch string The template branch to initialize from. + -h, --help Gets help for init. + -l, --location string Azure location for the new environment + --subscription string Name or ID of an Azure subscription to use for the new environment + -t, --template string The template to use when you initialize the project. You can use Full URI, /, or if it's part of the azure-samples organization. + +Global 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. + --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-login.snap b/cli/azd/cmd/testdata/TestUsage-azd-login.snap new file mode 100644 index 000000000..e27b47b21 --- /dev/null +++ b/cli/azd/cmd/testdata/TestUsage-azd-login.snap @@ -0,0 +1,21 @@ +Usage: + azd login [flags] + +Flags: + --check-status Checks the log-in status instead of logging in. + --client-certificate string The path to the client certificate for the service principal to authenticate with. + --client-id string The client id for the service principal to authenticate with. + --client-secret string The client secret for the service principal to authenticate with. Set to the empty string to read the value from the console. + --federated-credential string The federated token for the service principal to authenticate with. Set to the empty string to read the value from the console. + --federated-credential-provider string The provider to use to acquire a federated token to authenticate with. + -h, --help Gets help for login. + -o, --output string The output format (the supported formats are json, none). (default "none") + --tenant-id string The tenant id for the service principal to authenticate with. + --use-device-code When true, log in by using a device code instead of a browser. + +Global 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. + --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-logout.snap b/cli/azd/cmd/testdata/TestUsage-azd-logout.snap new file mode 100644 index 000000000..2182e70c4 --- /dev/null +++ b/cli/azd/cmd/testdata/TestUsage-azd-logout.snap @@ -0,0 +1,12 @@ +Usage: + azd logout [flags] + +Flags: + -h, --help Gets help for logout. + +Global 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. + --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 new file mode 100644 index 000000000..e2129238e --- /dev/null +++ b/cli/azd/cmd/testdata/TestUsage-azd-monitor.snap @@ -0,0 +1,15 @@ +Usage: + azd monitor [flags] + +Flags: + -h, --help Gets help for monitor. + --live Open a browser to Application Insights Live Metrics. Live Metrics is currently not supported for Python applications. + --logs Open a browser to Application Insights Logs. + --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. + -e, --environment string The name of the environment to use. + --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-pipeline-config.snap b/cli/azd/cmd/testdata/TestUsage-azd-pipeline-config.snap new file mode 100644 index 000000000..4d42021ca --- /dev/null +++ b/cli/azd/cmd/testdata/TestUsage-azd-pipeline-config.snap @@ -0,0 +1,17 @@ +Usage: + azd pipeline config [flags] + +Flags: + --auth-type string The authentication type used between the pipeline provider and Azure for deployment (Only valid for GitHub provider) + -h, --help Gets help for config. + --principal-name string The name of the service principal to use to grant access to Azure resources as part of the pipeline. + --principal-role string The role to assign to the service principal. (default "Contributor") + --provider string The pipeline provider to use (GitHub and Azdo supported). + --remote-name string The name of the git remote to configure the pipeline to run on. (default "origin") + +Global 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. + --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-pipeline.snap b/cli/azd/cmd/testdata/TestUsage-azd-pipeline.snap new file mode 100644 index 000000000..06332ca47 --- /dev/null +++ b/cli/azd/cmd/testdata/TestUsage-azd-pipeline.snap @@ -0,0 +1,17 @@ +Usage: + azd pipeline [command] + +Available Commands: + config Create and configure your deployment pipeline by using GitHub Actions. + +Flags: + -h, --help Gets help for pipeline. + +Global 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. + --no-prompt Accepts the default value instead of prompting, or it fails if there is no default. + +Use "azd pipeline [command] --help" for more information about a command. + diff --git a/cli/azd/cmd/testdata/TestUsage-azd-provision.snap b/cli/azd/cmd/testdata/TestUsage-azd-provision.snap new file mode 100644 index 000000000..6cdd72388 --- /dev/null +++ b/cli/azd/cmd/testdata/TestUsage-azd-provision.snap @@ -0,0 +1,14 @@ +Usage: + azd provision [flags] + +Flags: + -h, --help Gets help for provision. + --no-progress Suppresses progress information. + -o, --output string The output format (the supported formats are json, none). (default "none") + +Global 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. + --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-restore.snap b/cli/azd/cmd/testdata/TestUsage-azd-restore.snap new file mode 100644 index 000000000..00ac01aa6 --- /dev/null +++ b/cli/azd/cmd/testdata/TestUsage-azd-restore.snap @@ -0,0 +1,13 @@ +Usage: + azd restore [flags] + +Flags: + -h, --help Gets help for restore. + --service string Restores a specific service (when the string is unspecified, all services that are listed in the azure.yaml file are restored). + +Global 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. + --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-list.snap b/cli/azd/cmd/testdata/TestUsage-azd-template-list.snap new file mode 100644 index 000000000..a005c8b56 --- /dev/null +++ b/cli/azd/cmd/testdata/TestUsage-azd-template-list.snap @@ -0,0 +1,16 @@ +Usage: + azd template list [flags] + +Aliases: + list, ls + +Flags: + -h, --help Gets help for list. + -o, --output string The output format (the supported formats are json, table). (default "table") + +Global 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. + --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 new file mode 100644 index 000000000..50647bc60 --- /dev/null +++ b/cli/azd/cmd/testdata/TestUsage-azd-template-show.snap @@ -0,0 +1,13 @@ +Usage: + azd template show