Skip to content

Commit

Permalink
[App Service] Fix #21574: az webapp vnet-integration add: Fix the A…
Browse files Browse the repository at this point in the history
…ttributeError that 'NoneType' object has no attribute 'server_farm_id' (#21636)

* fix webapp vnet-integration add

* remove unused import
  • Loading branch information
StrawnSC authored Mar 17, 2022
1 parent c8ef50a commit 7cac0c8
Show file tree
Hide file tree
Showing 7 changed files with 3,769 additions and 1,074 deletions.
4 changes: 2 additions & 2 deletions src/azure-cli/azure/cli/command_modules/appservice/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from ._constants import (FUNCTIONS_VERSIONS, WINDOWS_OS_NAME, LINUX_OS_NAME)

from ._validators import (validate_timeout_value, validate_site_create, validate_asp_create,
validate_add_vnet, validate_front_end_scale_factor, validate_ase_create, validate_ip_address,
validate_front_end_scale_factor, validate_ase_create, validate_ip_address,
validate_service_tag, validate_public_cloud)

AUTH_TYPES = {
Expand Down Expand Up @@ -695,7 +695,7 @@ def load_arguments(self, _):
with self.argument_context('functionapp vnet-integration') as c:
c.argument('name', arg_type=functionapp_name_arg_type, id_part=None)
c.argument('slot', help="The name of the slot. Default to the productions slot if not specified")
c.argument('vnet', help="The name or resource ID of the Vnet", validator=validate_add_vnet,
c.argument('vnet', help="The name or resource ID of the Vnet",
local_context_attribute=LocalContextAttribute(name='vnet_name', actions=[LocalContextAction.GET]))
c.argument('subnet', help="The name or resource ID of the subnet",
local_context_attribute=LocalContextAttribute(name='subnet_name', actions=[LocalContextAction.GET]))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from ._client_factory import cf_web_client, cf_plans, cf_webapps
from ._validators import (validate_onedeploy_params, validate_staticsite_link_function, validate_staticsite_sku,
validate_vnet_integration, validate_asp_create, validate_functionapp_asp_create,
validate_app_exists)
validate_app_exists, validate_add_vnet)


def output_slots_in_table(slots):
Expand Down Expand Up @@ -281,12 +281,12 @@ def load_command_table(self, _):
g.custom_command('set-key', 'set_hc_key')

with self.command_group('webapp vnet-integration') as g:
g.custom_command('add', 'add_webapp_vnet_integration')
g.custom_command('add', 'add_webapp_vnet_integration', validator=validate_add_vnet, exception_handler=ex_handler_factory())
g.custom_command('list', 'list_vnet_integration')
g.custom_command('remove', 'remove_vnet_integration')

with self.command_group('functionapp vnet-integration') as g:
g.custom_command('add', 'add_functionapp_vnet_integration')
g.custom_command('add', 'add_functionapp_vnet_integration', validator=validate_add_vnet, exception_handler=ex_handler_factory())
g.custom_command('list', 'list_vnet_integration')
g.custom_command('remove', 'remove_vnet_integration')

Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

0 comments on commit 7cac0c8

Please sign in to comment.