diff --git a/src/azure-cli-core/azure/cli/core/__init__.py b/src/azure-cli-core/azure/cli/core/__init__.py index 5e5f810cdae..c68e2e9faa3 100644 --- a/src/azure-cli-core/azure/cli/core/__init__.py +++ b/src/azure-cli-core/azure/cli/core/__init__.py @@ -351,7 +351,8 @@ def _get_extension_suppressions(mod_loaders): return self.command_table def load_arguments(self, command=None): - from azure.cli.core.commands.parameters import resource_group_name_type, get_location_type, deployment_name_type + from azure.cli.core.commands.parameters import ( + resource_group_name_type, get_location_type, deployment_name_type, vnet_name_type, subnet_name_type) from knack.arguments import ignore_type # omit specific command to load everything @@ -370,6 +371,8 @@ def load_arguments(self, command=None): with loader.argument_context('') as c: c.argument('resource_group_name', resource_group_name_type) c.argument('location', get_location_type(self.cli_ctx)) + c.argument('vnet_name', vnet_name_type) + c.argument('subnet', subnet_name_type) c.argument('deployment_name', deployment_name_type) c.argument('cmd', ignore_type) diff --git a/src/azure-cli-core/azure/cli/core/commands/parameters.py b/src/azure-cli-core/azure/cli/core/commands/parameters.py index 2a72d9dff0e..3dec0a22eb3 100644 --- a/src/azure-cli-core/azure/cli/core/commands/parameters.py +++ b/src/azure-cli-core/azure/cli/core/commands/parameters.py @@ -304,17 +304,10 @@ def get_location_type(cli_ctx): ) vnet_name_type = CLIArgumentType( - options_list='--vnet-name', - metavar='NAME', - help='The virtual network (VNet) name.', - completer=get_resource_name_completion_list('Microsoft.Network/virtualNetworks'), local_context_attribute=LocalContextAttribute(name='vnet_name', actions=[LocalContextAction.GET]) ) subnet_name_type = CLIArgumentType( - options_list='--subnet', - metavar='NAME', - help='The subnet name.', local_context_attribute=LocalContextAttribute(name='subnet_name', actions=[LocalContextAction.GET]))