Azure / Azure/azure-cli-extensions
Connectivity Configuration Conditional Required Param - virtual-network-manager
- Dominant language
- Python
- Stars
- 454
- Forks
- 1.7k
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 64
Description
### Describe the bug
For command **az network manager connect-config create**, the required parameters are conditional to the 'connectivity-topology' the user selects. If the user selects **--connectivity-topology Mesh**, then 'group-connectivity' should not be required within 'applies-to-groups'. Currently, it is required. Please only make it required if user defines **--connectivity-topology HubAndSpoke**
### Related command
az network manager connect-config create
### Errors
`az network manager connect-config create --network-manager-name jaredgorthy --resource-group jaredgorthy-testResources --configuration-name cliCreate221 --applies-to-groups network-group-id="/subscriptions/f0dc2b34-dfad-40e4-83e0-2309fed8d00b/resourceGroups/jaredgorthy-testResources/providers/Microsoft.Network/networkManagers/jaredgorthy/networkGroups/CLIWorks" --connectivity-topology Mesh`
Error is
`InvalidArgumentValue: --applies-to-groups[0]: Missing required field: group-connectivity`
### Issue script & Debug output
C:\Users\jaredgorthy>az network manager connect-config create --network-manager-name jaredgorthy --resource-group jaredgorthy-testResources --configuration-name cliCreate221 --applies-to-groups network-group-id="/subscriptions/f0dc2b34-dfad-40e4-83e0-2309fed8d00b/resourceGroups/jaredgorthy-testResources/providers/Microsoft.Network/networkManagers/jaredgorthy/networkGroups/CLIWorks" --connectivity-topology Mesh --debug
cli.knack.cli: Command arguments: ['network', 'manager', 'connect-config', 'create', '--network-manager-name', 'jaredgorthy', '--resource-group', 'jaredgorthy-testResources', '--configuration-name', 'cliCreate221', '--applies-to-groups', 'network-group-id=/subscriptions/f0dc2b34-dfad-40e4-83e0-2309fed8d00b/resourceGroups/jaredgorthy-testResources/providers/Microsoft.Network/networkManagers/jaredgorthy/networkGroups/CLIWorks', '--connectivity-topology', 'Mesh', '--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 [, , ]
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_network_manager']
cli.azure.cli.core: Loading command modules:
cli.azure.cli.core: Name Load Time Groups Commands
cli.azure.cli.core: network 0.545 115 454
cli.azure.cli.core: privatedns 0.057 14 60
cli.azure.cli.core: Total (2) 0.602 129 514
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: virtual-network-manager 0.105 12 28 C:\Users\jaredgorthy\.azure\cliextensions\virtual-network-manager
cli.azure.cli.core: Total (1) 0.105 12 28
cli.azure.cli.core: Loaded 139 groups, 542 commands.
cli.azure.cli.core: Found a match in the command table.
cli.azure.cli.core: Raw command : network manager connect-config create
cli.azure.cli.core: Command table: network manager connect-config create
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableTruncate []
cli.azure.cli.core.azlogging: metadata file logging enabled - writing logs to 'C:\Users\jaredgorthy\.azure\commands\2024-02-21.14-36-35.network_manager_connect-config_create.6884.log'.
az_command_data_logger: command args: network manager connect-config create --network-manager-name {} --resource-group {} --configuration-name {} --applies-to-groups {} --connectivity-topology {} --debug
cli.knack.cli: Event: CommandInvoker.OnPreArgumentLoad [.add_subscription_parameter at 0x0434F5C8>]
cli.knack.cli: Event: CommandInvoker.OnPostArgumentLoad []
cli.knack.cli: Event: CommandInvoker.OnPostCommandTableCreate [.add_ids_arguments at 0x0438F898>, .add_cache_arguments at 0x0438F8E8>]
cli.knack.cli: Event: CommandInvoker.OnCommandTableLoaded []
cli.knack.cli: Event: CommandInvoker.OnPreParseArgs []
cli.knack.cli: Event: CommandInvoker.OnPostParseArgs [, , .parse_ids_arguments at 0x0438F848>]
az_command_data_logger: extension name: virtual-network-manager
az_command_data_logger: extension version: 1.0.1
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 402, in __call__
File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/aaz/_arg_fmt.py", line 399, in __call__
File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/aaz/_arg_fmt.py", line 519, in __call__
File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/aaz/_arg_fmt.py", line 516, in __call__
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: --applies-to-groups[0]: Missing required field: group-connectivity
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 664, in execute
File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 729, 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 698, in _run_job
File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 334, 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\jaredgorthy\.azure\cliextensions\virtual-network-manager\azext_network_manager\custom.py", line 96, in network_manager_connect_config_create
return ConnectConfigCreate(cli_ctx=cmd.cli_ctx)(command_args=connectivity_configuration)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
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\jaredgorthy\.azure\cliextensions\virtual-network-manager\azext_network_manager\aaz\latest\network\manager\connect_config\_create.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: --applies-to-groups[0]: Missing required field: group-connectivity
cli.azure.cli.core.azclierror: InvalidArgumentValue: --applies-to-groups[0]: Missing required field: group-connectivity
az_command_data_logger: InvalidArgumentValue: --applies-to-groups[0]: Missing required field: group-connectivity
cli.knack.cli: Event: Cli.PostExecute []
az_command_data_logger: exit code: 1
cli.__main__: Command ran in 1.546 seconds (init: 0.741, invoke: 0.805)
cli.azure.cli.core.decorators: Suppress exception:
Traceback (most recent call last):
File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/__main__.py", line 62, in
File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/__main__.py", line 55, in
SystemExit: 1
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\azure/cli/core/decorators.py", line 79, in _wrapped_func
File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/telemetry.py", line 532, in _get_secrets_warning_config
File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\knack/config.py", line 147, in getboolean
ValueError: Not a boolean: None
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 3705 in cache
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\jaredgorthy\.azure"
telemetry.process: Return from creating process
telemetry.main: Finish creating telemetry upload process.
### Expected behavior
I expect to not have to define the 'group-connectivity' when the topology is a Mesh.
### Environment Summary
azure-cli 2.57.0
core 2.57.0
telemetry 1.1.0
Extensions:
account 0.2.5
azure-devops 0.26.0
virtual-network-manager 1.0.1
Dependencies:
msal 1.26.0
azure-mgmt-resource 23.1.0b2
Python location 'C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\python.exe'
Extensions directory 'C:\Users\jaredgorthy\.azure\cliextensions'
Development extension sources:
C:\CLI_test\azure-cli-extensions
Python (Windows) 3.11.7 (tags/v3.11.7:fa7a6f2, Dec 4 2023, 19:13:08) [MSC v.1937 32 bit (Intel)]
Legal docs and information: aka.ms/AzureCliLegal
Your CLI is up-to-date.
### Additional context
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.