The command to start ssh bastion fails with "Missing required field: -n" even if --name/-n is specified.
cli.knack.cli: Command arguments: ['network', 'bastion', 'ssh', '--name', 'xxxxxx', '--resource-group', 'yyyyyyyyy', '--target-ip-address', 'xx.xx.xx.xx', '--auth-type', 'password', '--username', 'vmadmin', '--debug']
cli.knack.cli: __init__ debug log:
Enable color in terminal.
Enable VT mode.
cli.knack.cli: Event: Cli.PreExecute []
cli.knack.cli: Event: CommandParser.OnGlobalArgumentsCreate [<function CLILogging.on_global_arguments at 0x034BC988>, <function OutputProducer.on_global_arguments at 0x035E8A78>, <function CLIQuery.on_global_arguments at 0x03808848>]
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableCreate []
cli.azure.cli.core: Modules found from index for 'network': ['azure.cli.command_modules.network', 'azure.cli.command_modules.privatedns', 'azext_bastion']
cli.azure.cli.core: Loading command modules:
cli.azure.cli.core: Name Load Time Groups Commands
cli.azure.cli.core: network 1.764 117 459
cli.azure.cli.core: privatedns 0.049 14 60
cli.azure.cli.core: Total (2) 1.813 131 519
cli.azure.cli.core: These extensions are not installed and will be skipped: ['azext_ai_examples', 'azext_next']
cli.azure.cli.core: Loading extensions:
cli.azure.cli.core: Name Load Time Groups Commands Directory
cli.azure.cli.core: bastion 0.031 2 9 C:\Users\firstname.name\.azure\cliextensions\bastion
cli.azure.cli.core: Total (1) 0.031 2 9
cli.azure.cli.core: Loaded 131 groups, 528 commands.
cli.azure.cli.core: Found a match in the command table.
cli.azure.cli.core: Raw command : network bastion ssh
cli.azure.cli.core: Command table: network bastion ssh
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableTruncate [<function AzCliLogging.init_command_file_logging at 0x0401E3E8>]
cli.azure.cli.core.azlogging: metadata file logging enabled - writing logs to 'C:\Users\firstname.name\.azure\commands\2024-09-20.13-56-58.network_bastion_ssh.17752.log'.
az_command_data_logger: command args: network bastion ssh --name {} --resource-group {} --target-ip-address {} --auth-type {} --username {} --debug
cli.knack.cli: Event: CommandInvoker.OnPreArgumentLoad [<function register_global_subscription_argument.<locals>.add_subscription_parameter at 0x040443E8>]
cli.knack.cli: Event: CommandInvoker.OnPostArgumentLoad []
cli.knack.cli: Event: CommandInvoker.OnPostCommandTableCreate [<function register_ids_argument.<locals>.add_ids_arguments at 0x0405D988>, <function register_cache_arguments.<locals>.add_cache_arguments at 0x04073C08>, <function register_upcoming_breaking_change_info.<locals>.update_breaking_change_info at 0x04073C58>]
cli.knack.cli: Event: CommandInvoker.OnCommandTableLoaded []
cli.knack.cli: Event: CommandInvoker.OnPreParseArgs []
cli.knack.cli: Event: CommandInvoker.OnPostParseArgs [<function OutputProducer.handle_output_argument at 0x035E8AC8>, <function CLIQuery.handle_query_parameter at 0x03808898>, <function register_ids_argument.<locals>.parse_ids_arguments at 0x04073BB8>]
az_command_data_logger: extension name: bastion
az_command_data_logger: extension version: 1.2.0
cli.azure.cli.core.azclierror: Traceback (most recent call last):
File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/aaz/_command_ctx.py", line 53, in format_args
File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/aaz/_arg_fmt.py", line 415, in __call__
azure.cli.core.aaz.exceptions.AAZInvalidArgValueError: InvalidArgumentValue: Missing required field: -n
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\knack/cli.py", line 233, in invoke
File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 666, in execute
File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 733, in _run_jobs_serially
File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 703, in _run_job
File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 336, in __call__
File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/command_operation.py", line 121, in handler
File "C:\Users\firstname.name\.azure\cliextensions\bastion\azext_bastion\custom.py", line 146, in ssh_bastion_host
bastion = Show(cli_ctx=cmd.cli_ctx)(command_args={
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/aaz/_command.py", line 155, in __call__
File "C:\Users\firstname.name\.azure\cliextensions\bastion\azext_bastion\aaz\latest\network\bastion\_show.py", line 32, in _handler
super()._handler(command_args)
File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/aaz/_command.py", line 165, in _handler
File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/aaz/_command_ctx.py", line 55, in format_args
azure.cli.core.azclierror.InvalidArgumentValueError: InvalidArgumentValue: Missing required field: -n
cli.azure.cli.core.azclierror: InvalidArgumentValue: Missing required field: -n
az_command_data_logger: InvalidArgumentValue: Missing required field: -n
cli.knack.cli: Event: Cli.PostExecute [<function AzCliLogging.deinit_cmd_metadata_logging at 0x0401E528>]
az_command_data_logger: exit code: 1
cli.__main__: Command ran in 2.848 seconds (init: 0.738, invoke: 2.110)
telemetry.main: Begin splitting cli events and extra events, total events: 1
telemetry.client: Accumulated 0 events. Flush the clients.
telemetry.main: Finish splitting cli events and extra events, cli events: 1
telemetry.save: Save telemetry record of length 3836 in cache file under C:\Users\firstname.name\.azure\telemetry\20240920135659369
telemetry.main: Begin creating telemetry upload process.
telemetry.process: Creating upload process: "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\python.exe C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\Lib\site-packages\azure\cli\telemetry\__init__.pyc C:\Users\firstname.name\.azure C:\Users\firstname.name\.azure\telemetry\20240920135659369"
telemetry.process: Return from creating process 21724
telemetry.main: Finish creating telemetry upload process.
SSH connection to the target IP should be opened.
Describe the bug
The command to start ssh bastion fails with "Missing required field: -n" even if --name/-n is specified.
Related command
az network bastion ssh --name xxxx --resource-group xxxx --target-ip-address xx.xx.xx.xx --auth-type password --username vmadminErrors
InvalidArgumentValue: Missing required field: -n
Issue script & Debug output
Expected behavior
SSH connection to the target IP should be opened.
Environment Summary
Additional context
No response