# Buggy code
def load_command_table(self, _):
    webclient_sdk = CliCommandType(
        operations_tmpl="azure.mgmt.web.web_site_management_client#WebSiteManagementClient.{}",
        client_factory=cf_web_client,
    )
    appservice_plan_sdk = CliCommandType(
        operations_tmpl="azure.mgmt.web.operations#AppServicePlansOperations.{}",
        client_factory=cf_plans,
    )
    webapp_sdk = CliCommandType(
        operations_tmpl="azure.mgmt.web.operations#WebAppsOperations.{}",
        client_factory=cf_webapps,
    )
    appservice_custom = CliCommandType(
        operations_tmpl="azure.cli.command_modules.appservice.custom#{}"
    )

    with self.command_group("webapp", webapp_sdk) as g:
        g.custom_command(
            "create", "create_webapp", exception_handler=ex_handler_factory()
        )
        g.custom_command("up", "webapp_up", exception_handler=ex_handler_factory())
        g.custom_command(
            "ssh", "ssh_webapp", exception_handler=ex_handler_factory(), is_preview=True
        )
        g.custom_command(
            "list", "list_webapp", table_transformer=transform_web_list_output
        )
        g.custom_show_command(
            "show", "show_webapp", table_transformer=transform_web_output
        )
        g.custom_command("delete", "delete_webapp")
        g.custom_command("stop", "stop_webapp")
        g.custom_command("start", "start_webapp")
        g.custom_command("restart", "restart_webapp")
        g.custom_command("browse", "view_in_browser")
        g.custom_command("list-runtimes", "list_runtimes")
        g.custom_command(
            "identity assign", "assign_identity", validator=validate_app_exists_in_rg
        )
        g.custom_show_command(
            "identity show", "show_identity", validator=validate_app_exists_in_rg
        )
        g.custom_command(
            "identity remove", "remove_identity", validator=validate_app_exists_in_rg
        )
        g.custom_command(
            "create-remote-connection",
            "create_tunnel",
            exception_handler=ex_handler_factory(),
        )
        g.generic_update_command(
            "update",
            getter_name="get_webapp",
            setter_name="set_webapp",
            custom_func_name="update_webapp",
            command_type=appservice_custom,
        )

    with self.command_group("webapp traffic-routing") as g:
        g.custom_command("set", "set_traffic_routing")
        g.custom_show_command("show", "show_traffic_routing")
        g.custom_command("clear", "clear_traffic_routing")

    with self.command_group("webapp cors") as g:
        g.custom_command("add", "add_cors")
        g.custom_command("remove", "remove_cors")
        g.custom_command("show", "show_cors")

    with self.command_group("webapp config") as g:
        g.custom_command("set", "update_site_configs")
        g.custom_show_command("show", "get_site_configs")

    with self.command_group("webapp config appsettings") as g:
        g.custom_command("list", "get_app_settings", exception_handler=empty_on_404)
        g.custom_command("set", "update_app_settings")
        g.custom_command("delete", "delete_app_settings")

    with self.command_group("webapp config connection-string") as g:
        g.custom_command(
            "list", "get_connection_strings", exception_handler=empty_on_404
        )
        g.custom_command("set", "update_connection_strings")
        g.custom_command("delete", "delete_connection_strings")

    with self.command_group("webapp config storage-account") as g:
        g.custom_command(
            "list", "get_azure_storage_accounts", exception_handler=empty_on_404
        )
        g.custom_command("add", "add_azure_storage_account")
        g.custom_command("update", "update_azure_storage_account")
        g.custom_command("delete", "delete_azure_storage_accounts")

    with self.command_group("webapp config hostname") as g:
        g.custom_command("add", "add_hostname", exception_handler=ex_handler_factory())
        g.custom_command("list", "list_hostnames")
        g.custom_command("delete", "delete_hostname")
        g.custom_command("get-external-ip", "get_external_ip")

    with self.command_group("webapp config container") as g:
        g.custom_command("set", "update_container_settings")
        g.custom_command("delete", "delete_container_settings")
        g.custom_show_command("show", "show_container_settings")

    with self.command_group("webapp config ssl") as g:
        g.custom_command(
            "upload", "upload_ssl_cert", exception_handler=ex_handler_factory()
        )
        g.custom_command("list", "list_ssl_certs")
        g.custom_command(
            "bind", "bind_ssl_cert", exception_handler=ex_handler_factory()
        )
        g.custom_command("unbind", "unbind_ssl_cert")
        g.custom_command("delete", "delete_ssl_cert")

    with self.command_group("webapp config backup") as g:
        g.custom_command("list", "list_backups")
        g.custom_show_command("show", "show_backup_configuration")
        g.custom_command(
            "create", "create_backup", exception_handler=ex_handler_factory()
        )
        g.custom_command(
            "update", "update_backup_schedule", exception_handler=ex_handler_factory()
        )
        g.custom_command(
            "restore", "restore_backup", exception_handler=ex_handler_factory()
        )

    with self.command_group("webapp config snapshot") as g:
        g.custom_command("list", "list_snapshots")
        g.custom_command("restore", "restore_snapshot")

    with self.command_group("webapp webjob continuous") as g:
        g.custom_command(
            "list", "list_continuous_webjobs", exception_handler=ex_handler_factory()
        )
        g.custom_command(
            "remove", "remove_continuous_webjob", exception_handler=ex_handler_factory()
        )
        g.custom_command(
            "start", "start_continuous_webjob", exception_handler=ex_handler_factory()
        )
        g.custom_command(
            "stop", "stop_continuous_webjob", exception_handler=ex_handler_factory()
        )

    with self.command_group("webapp webjob triggered") as g:
        g.custom_command(
            "list", "list_triggered_webjobs", exception_handler=ex_handler_factory()
        )
        g.custom_command(
            "remove", "remove_triggered_webjob", exception_handler=ex_handler_factory()
        )
        g.custom_command(
            "run", "run_triggered_webjob", exception_handler=ex_handler_factory()
        )
        g.custom_command(
            "log",
            "get_history_triggered_webjob",
            exception_handler=ex_handler_factory(),
        )

    with self.command_group("webapp deployment source") as g:
        g.custom_command("config-local-git", "enable_local_git")
        g.custom_command("config-zip", "enable_zip_deploy")
        g.custom_command(
            "config", "config_source_control", exception_handler=ex_handler_factory()
        )
        g.custom_command(
            "sync", "sync_site_repo", exception_handler=ex_handler_factory()
        )
        g.custom_show_command("show", "show_source_control")
        g.custom_command("delete", "delete_source_control")
        g.custom_command(
            "update-token", "update_git_token", exception_handler=ex_handler_factory()
        )

    with self.command_group("webapp log") as g:
        g.custom_command("tail", "get_streaming_log")
        g.custom_command("download", "download_historical_logs")
        g.custom_command("config", "config_diagnostics")
        g.custom_show_command("show", "show_diagnostic_settings")

    with self.command_group("webapp deployment slot") as g:
        g.custom_command("list", "list_slots", table_transformer=output_slots_in_table)
        g.custom_command("delete", "delete_slot")
        g.custom_command("auto-swap", "config_slot_auto_swap")
        g.custom_command("swap", "swap_slot", exception_handler=ex_handler_factory())
        g.custom_command(
            "create", "create_webapp_slot", exception_handler=ex_handler_factory()
        )

    with self.command_group("webapp deployment") as g:
        g.custom_command("list-publishing-profiles", "list_publish_profiles")
        g.custom_command("list-publishing-credentials", "list_publishing_credentials")

    with self.command_group("webapp deployment user", webclient_sdk) as g:
        g.show_command("show", "get_publishing_user")
        g.custom_command(
            "set", "set_deployment_user", exception_handler=ex_handler_factory()
        )

    with self.command_group("webapp deployment container") as g:
        g.custom_command("config", "enable_cd")
        g.custom_command("show-cd-url", "show_container_cd_url")

    with self.command_group("webapp auth") as g:
        g.custom_show_command("show", "get_auth_settings")
        g.custom_command("update", "update_auth_settings")

    with self.command_group("webapp deleted", is_preview=True) as g:
        g.custom_command("list", "list_deleted_webapp")
        g.custom_command("restore", "restore_deleted_webapp")

    with self.command_group("appservice plan", appservice_plan_sdk) as g:
        g.custom_command(
            "create",
            "create_app_service_plan",
            exception_handler=ex_handler_factory(creating_plan=True),
        )
        g.command("delete", "delete", confirmation=True)
        g.custom_command("list", "list_app_service_plans")
        g.show_command("show", "get")
        g.generic_update_command(
            "update",
            custom_func_name="update_app_service_plan",
            setter_arg_name="app_service_plan",
        )
    with self.command_group("appservice") as g:
        g.custom_command(
            "list-locations", "list_locations", transform=transform_list_location_output
        )

    with self.command_group("functionapp") as g:
        g.custom_command(
            "create", "create_function", exception_handler=ex_handler_factory()
        )
        g.custom_command(
            "list", "list_function_app", table_transformer=transform_web_list_output
        )
        g.custom_show_command(
            "show", "show_webapp", table_transformer=transform_web_output
        )
        g.custom_command("delete", "delete_function_app")
        g.custom_command("stop", "stop_webapp")
        g.custom_command("start", "start_webapp")
        g.custom_command("restart", "restart_webapp")
        g.custom_command("list-consumption-locations", "list_consumption_locations")
        g.custom_command("identity assign", "assign_identity")
        g.custom_show_command("identity show", "show_identity")
        g.custom_command("identity remove", "remove_identity")
        g.generic_update_command(
            "update",
            setter_name="set_functionapp",
            exception_handler=ex_handler_factory(),
            custom_func_name="update_functionapp",
            setter_type=appservice_custom,
            command_type=webapp_sdk,
        )

    with self.command_group("functionapp config") as g:
        g.custom_command("set", "update_site_configs")
        g.custom_show_command("show", "get_site_configs")

    with self.command_group("functionapp config appsettings") as g:
        g.custom_command("list", "get_app_settings", exception_handler=empty_on_404)
        g.custom_command(
            "set", "update_app_settings", exception_handler=ex_handler_factory()
        )
        g.custom_command(
            "delete", "delete_app_settings", exception_handler=ex_handler_factory()
        )

    with self.command_group("functionapp config hostname") as g:
        g.custom_command("add", "add_hostname", exception_handler=ex_handler_factory())
        g.custom_command("list", "list_hostnames")
        g.custom_command("delete", "delete_hostname")
        g.custom_command("get-external-ip", "get_external_ip")

    with self.command_group("functionapp config ssl") as g:
        g.custom_command(
            "upload", "upload_ssl_cert", exception_handler=ex_handler_factory()
        )
        g.custom_command("list", "list_ssl_certs")
        g.custom_command(
            "bind", "bind_ssl_cert", exception_handler=ex_handler_factory()
        )
        g.custom_command("unbind", "unbind_ssl_cert")
        g.custom_command("delete", "delete_ssl_cert")

    with self.command_group("functionapp deployment source") as g:
        g.custom_command("config-local-git", "enable_local_git")
        g.custom_command("config-zip", "enable_zip_deploy_functionapp")
        g.custom_command(
            "config", "config_source_control", exception_handler=ex_handler_factory()
        )
        g.custom_command("sync", "sync_site_repo")
        g.custom_show_command("show", "show_source_control")
        g.custom_command("delete", "delete_source_control")
        g.custom_command(
            "update-token", "update_git_token", exception_handler=ex_handler_factory()
        )

    with self.command_group("functionapp deployment user", webclient_sdk) as g:
        g.custom_command(
            "set", "set_deployment_user", exception_handler=ex_handler_factory()
        )
        g.show_command("show", "get_publishing_user")

    with self.command_group("functionapp deployment") as g:
        g.custom_command("list-publishing-profiles", "list_publish_profiles")
        g.custom_command("list-publishing-credentials", "list_publishing_credentials")

    with self.command_group("functionapp cors") as g:
        g.custom_command("add", "add_cors")
        g.custom_command("remove", "remove_cors")
        g.custom_command("show", "show_cors")

    with self.command_group("functionapp plan", appservice_plan_sdk) as g:
        g.custom_command(
            "create",
            "create_functionapp_app_service_plan",
            exception_handler=ex_handler_factory(),
        )
        g.generic_update_command(
            "update",
            custom_func_name="update_functionapp_app_service_plan",
            setter_arg_name="app_service_plan",
            exception_handler=ex_handler_factory(),
        )
        g.command("delete", "delete", confirmation=True)
        g.custom_command("list", "list_app_service_plans")
        g.show_command("show", "get")

    with self.command_group("functionapp deployment container") as g:
        g.custom_command("config", "enable_cd")
        g.custom_command("show-cd-url", "show_container_cd_url")

    with self.command_group("functionapp config container") as g:
        g.custom_command("set", "update_container_settings_functionapp")
        g.custom_command("delete", "delete_container_settings")
        g.custom_show_command("show", "show_container_settings_functionapp")

    with self.command_group("functionapp devops-pipeline") as g:
        g.custom_command("create", "create_devops_pipeline")

    with self.command_group("functionapp deployment slot") as g:
        g.custom_command("list", "list_slots", table_transformer=output_slots_in_table)
        g.custom_command("delete", "delete_slot")
        g.custom_command("auto-swap", "config_slot_auto_swap")
        g.custom_command("swap", "swap_slot", exception_handler=ex_handler_factory())
        g.custom_command(
            "create", "create_functionapp_slot", exception_handler=ex_handler_factory()
        )


# Traceback (AttributeError)
The command failed with an unexpected error. Here is the traceback:

'NoneType' object has no attribute 'hosting_environment_profile'
Traceback (most recent call last):
File "/opt/az/lib/python3.6/site-packages/knack/cli.py", line 206, in invoke
cmd_result = self.invocation.execute(args)
File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 578, in execute
raise ex
File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 636, in _run_jobs_serially
results.append(self._run_job(expanded_arg, cmd_copy))
File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 627, in _run_job
cmd_copy.exception_handler(ex)
File "/opt/az/lib/python3.6/site-packages/azure/cli/command_modules/appservice/commands.py", line 55, in _polish_bad_errors
raise ex
File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 606, in _run_job
result = cmd_copy(params)
File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 305, in __call__
return self.handler(*args, **kwargs)
File "/opt/az/lib/python3.6/site-packages/azure/cli/core/__init__.py", line 485, in default_command_handler
return op(**command_args)
File "/opt/az/lib/python3.6/site-packages/azure/cli/command_modules/appservice/custom.py", line 1836, in upload_ssl_cert
if webapp.hosting_environment_profile else '')
AttributeError: 'NoneType' object has no attribute 'hosting_environment_profile'

To open an issue, please run: 'az feedback'

# Fixed code
def load_command_table(self, _):
    webclient_sdk = CliCommandType(
        operations_tmpl="azure.mgmt.web.web_site_management_client#WebSiteManagementClient.{}",
        client_factory=cf_web_client,
    )
    appservice_plan_sdk = CliCommandType(
        operations_tmpl="azure.mgmt.web.operations#AppServicePlansOperations.{}",
        client_factory=cf_plans,
    )
    webapp_sdk = CliCommandType(
        operations_tmpl="azure.mgmt.web.operations#WebAppsOperations.{}",
        client_factory=cf_webapps,
    )
    appservice_custom = CliCommandType(
        operations_tmpl="azure.cli.command_modules.appservice.custom#{}"
    )

    with self.command_group("webapp", webapp_sdk) as g:
        g.custom_command(
            "create", "create_webapp", exception_handler=ex_handler_factory()
        )
        g.custom_command("up", "webapp_up", exception_handler=ex_handler_factory())
        g.custom_command(
            "ssh", "ssh_webapp", exception_handler=ex_handler_factory(), is_preview=True
        )
        g.custom_command(
            "list", "list_webapp", table_transformer=transform_web_list_output
        )
        g.custom_show_command(
            "show", "show_webapp", table_transformer=transform_web_output
        )
        g.custom_command("delete", "delete_webapp")
        g.custom_command("stop", "stop_webapp")
        g.custom_command("start", "start_webapp")
        g.custom_command("restart", "restart_webapp")
        g.custom_command("browse", "view_in_browser")
        g.custom_command("list-runtimes", "list_runtimes")
        g.custom_command(
            "identity assign",
            "assign_identity",
            validator=validate_app_or_slot_exists_in_rg,
        )
        g.custom_show_command(
            "identity show",
            "show_identity",
            validator=validate_app_or_slot_exists_in_rg,
        )
        g.custom_command(
            "identity remove",
            "remove_identity",
            validator=validate_app_or_slot_exists_in_rg,
        )
        g.custom_command(
            "create-remote-connection",
            "create_tunnel",
            exception_handler=ex_handler_factory(),
        )
        g.generic_update_command(
            "update",
            getter_name="get_webapp",
            setter_name="set_webapp",
            custom_func_name="update_webapp",
            command_type=appservice_custom,
        )

    with self.command_group("webapp traffic-routing") as g:
        g.custom_command("set", "set_traffic_routing")
        g.custom_show_command("show", "show_traffic_routing")
        g.custom_command("clear", "clear_traffic_routing")

    with self.command_group("webapp cors") as g:
        g.custom_command("add", "add_cors")
        g.custom_command("remove", "remove_cors")
        g.custom_command("show", "show_cors")

    with self.command_group("webapp config") as g:
        g.custom_command("set", "update_site_configs")
        g.custom_show_command("show", "get_site_configs")

    with self.command_group("webapp config appsettings") as g:
        g.custom_command("list", "get_app_settings", exception_handler=empty_on_404)
        g.custom_command("set", "update_app_settings")
        g.custom_command("delete", "delete_app_settings")

    with self.command_group("webapp config connection-string") as g:
        g.custom_command(
            "list", "get_connection_strings", exception_handler=empty_on_404
        )
        g.custom_command("set", "update_connection_strings")
        g.custom_command("delete", "delete_connection_strings")

    with self.command_group("webapp config storage-account") as g:
        g.custom_command(
            "list", "get_azure_storage_accounts", exception_handler=empty_on_404
        )
        g.custom_command("add", "add_azure_storage_account")
        g.custom_command("update", "update_azure_storage_account")
        g.custom_command("delete", "delete_azure_storage_accounts")

    with self.command_group("webapp config hostname") as g:
        g.custom_command("add", "add_hostname", exception_handler=ex_handler_factory())
        g.custom_command("list", "list_hostnames")
        g.custom_command("delete", "delete_hostname")
        g.custom_command("get-external-ip", "get_external_ip")

    with self.command_group("webapp config container") as g:
        g.custom_command("set", "update_container_settings")
        g.custom_command("delete", "delete_container_settings")
        g.custom_show_command("show", "show_container_settings")

    with self.command_group("webapp config ssl") as g:
        g.custom_command(
            "upload", "upload_ssl_cert", validator=validate_app_exists_in_rg
        )
        g.custom_command(
            "list", "list_ssl_certs", exception_handler=ex_handler_factory()
        )
        g.custom_command(
            "bind",
            "bind_ssl_cert",
            exception_handler=ex_handler_factory(),
            validator=validate_app_or_slot_exists_in_rg,
        )
        g.custom_command(
            "unbind", "unbind_ssl_cert", validator=validate_app_or_slot_exists_in_rg
        )
        g.custom_command(
            "delete", "delete_ssl_cert", exception_handler=ex_handler_factory()
        )

    with self.command_group("webapp config backup") as g:
        g.custom_command("list", "list_backups")
        g.custom_show_command("show", "show_backup_configuration")
        g.custom_command(
            "create", "create_backup", exception_handler=ex_handler_factory()
        )
        g.custom_command(
            "update", "update_backup_schedule", exception_handler=ex_handler_factory()
        )
        g.custom_command(
            "restore", "restore_backup", exception_handler=ex_handler_factory()
        )

    with self.command_group("webapp config snapshot") as g:
        g.custom_command("list", "list_snapshots")
        g.custom_command("restore", "restore_snapshot")

    with self.command_group("webapp webjob continuous") as g:
        g.custom_command(
            "list", "list_continuous_webjobs", exception_handler=ex_handler_factory()
        )
        g.custom_command(
            "remove", "remove_continuous_webjob", exception_handler=ex_handler_factory()
        )
        g.custom_command(
            "start", "start_continuous_webjob", exception_handler=ex_handler_factory()
        )
        g.custom_command(
            "stop", "stop_continuous_webjob", exception_handler=ex_handler_factory()
        )

    with self.command_group("webapp webjob triggered") as g:
        g.custom_command(
            "list", "list_triggered_webjobs", exception_handler=ex_handler_factory()
        )
        g.custom_command(
            "remove", "remove_triggered_webjob", exception_handler=ex_handler_factory()
        )
        g.custom_command(
            "run", "run_triggered_webjob", exception_handler=ex_handler_factory()
        )
        g.custom_command(
            "log",
            "get_history_triggered_webjob",
            exception_handler=ex_handler_factory(),
        )

    with self.command_group("webapp deployment source") as g:
        g.custom_command("config-local-git", "enable_local_git")
        g.custom_command("config-zip", "enable_zip_deploy")
        g.custom_command(
            "config", "config_source_control", exception_handler=ex_handler_factory()
        )
        g.custom_command(
            "sync", "sync_site_repo", exception_handler=ex_handler_factory()
        )
        g.custom_show_command("show", "show_source_control")
        g.custom_command("delete", "delete_source_control")
        g.custom_command(
            "update-token", "update_git_token", exception_handler=ex_handler_factory()
        )

    with self.command_group("webapp log") as g:
        g.custom_command("tail", "get_streaming_log")
        g.custom_command("download", "download_historical_logs")
        g.custom_command("config", "config_diagnostics")
        g.custom_show_command("show", "show_diagnostic_settings")

    with self.command_group("webapp deployment slot") as g:
        g.custom_command("list", "list_slots", table_transformer=output_slots_in_table)
        g.custom_command("delete", "delete_slot")
        g.custom_command("auto-swap", "config_slot_auto_swap")
        g.custom_command("swap", "swap_slot", exception_handler=ex_handler_factory())
        g.custom_command(
            "create", "create_webapp_slot", exception_handler=ex_handler_factory()
        )

    with self.command_group("webapp deployment") as g:
        g.custom_command("list-publishing-profiles", "list_publish_profiles")
        g.custom_command("list-publishing-credentials", "list_publishing_credentials")

    with self.command_group("webapp deployment user", webclient_sdk) as g:
        g.show_command("show", "get_publishing_user")
        g.custom_command(
            "set", "set_deployment_user", exception_handler=ex_handler_factory()
        )

    with self.command_group("webapp deployment container") as g:
        g.custom_command("config", "enable_cd")
        g.custom_command("show-cd-url", "show_container_cd_url")

    with self.command_group("webapp auth") as g:
        g.custom_show_command("show", "get_auth_settings")
        g.custom_command("update", "update_auth_settings")

    with self.command_group("webapp deleted", is_preview=True) as g:
        g.custom_command("list", "list_deleted_webapp")
        g.custom_command("restore", "restore_deleted_webapp")

    with self.command_group("appservice plan", appservice_plan_sdk) as g:
        g.custom_command(
            "create",
            "create_app_service_plan",
            exception_handler=ex_handler_factory(creating_plan=True),
        )
        g.command("delete", "delete", confirmation=True)
        g.custom_command("list", "list_app_service_plans")
        g.show_command("show", "get")
        g.generic_update_command(
            "update",
            custom_func_name="update_app_service_plan",
            setter_arg_name="app_service_plan",
        )
    with self.command_group("appservice") as g:
        g.custom_command(
            "list-locations", "list_locations", transform=transform_list_location_output
        )

    with self.command_group("functionapp") as g:
        g.custom_command(
            "create", "create_function", exception_handler=ex_handler_factory()
        )
        g.custom_command(
            "list", "list_function_app", table_transformer=transform_web_list_output
        )
        g.custom_show_command(
            "show", "show_webapp", table_transformer=transform_web_output
        )
        g.custom_command("delete", "delete_function_app")
        g.custom_command("stop", "stop_webapp")
        g.custom_command("start", "start_webapp")
        g.custom_command("restart", "restart_webapp")
        g.custom_command("list-consumption-locations", "list_consumption_locations")
        g.custom_command("identity assign", "assign_identity")
        g.custom_show_command("identity show", "show_identity")
        g.custom_command("identity remove", "remove_identity")
        g.generic_update_command(
            "update",
            setter_name="set_functionapp",
            exception_handler=ex_handler_factory(),
            custom_func_name="update_functionapp",
            setter_type=appservice_custom,
            command_type=webapp_sdk,
        )

    with self.command_group("functionapp config") as g:
        g.custom_command("set", "update_site_configs")
        g.custom_show_command("show", "get_site_configs")

    with self.command_group("functionapp config appsettings") as g:
        g.custom_command("list", "get_app_settings", exception_handler=empty_on_404)
        g.custom_command(
            "set", "update_app_settings", exception_handler=ex_handler_factory()
        )
        g.custom_command(
            "delete", "delete_app_settings", exception_handler=ex_handler_factory()
        )

    with self.command_group("functionapp config hostname") as g:
        g.custom_command("add", "add_hostname", exception_handler=ex_handler_factory())
        g.custom_command("list", "list_hostnames")
        g.custom_command("delete", "delete_hostname")
        g.custom_command("get-external-ip", "get_external_ip")

    with self.command_group("functionapp config ssl") as g:
        g.custom_command(
            "upload", "upload_ssl_cert", exception_handler=ex_handler_factory()
        )
        g.custom_command("list", "list_ssl_certs")
        g.custom_command(
            "bind", "bind_ssl_cert", exception_handler=ex_handler_factory()
        )
        g.custom_command("unbind", "unbind_ssl_cert")
        g.custom_command("delete", "delete_ssl_cert")

    with self.command_group("functionapp deployment source") as g:
        g.custom_command("config-local-git", "enable_local_git")
        g.custom_command("config-zip", "enable_zip_deploy_functionapp")
        g.custom_command(
            "config", "config_source_control", exception_handler=ex_handler_factory()
        )
        g.custom_command("sync", "sync_site_repo")
        g.custom_show_command("show", "show_source_control")
        g.custom_command("delete", "delete_source_control")
        g.custom_command(
            "update-token", "update_git_token", exception_handler=ex_handler_factory()
        )

    with self.command_group("functionapp deployment user", webclient_sdk) as g:
        g.custom_command(
            "set", "set_deployment_user", exception_handler=ex_handler_factory()
        )
        g.show_command("show", "get_publishing_user")

    with self.command_group("functionapp deployment") as g:
        g.custom_command("list-publishing-profiles", "list_publish_profiles")
        g.custom_command("list-publishing-credentials", "list_publishing_credentials")

    with self.command_group("functionapp cors") as g:
        g.custom_command("add", "add_cors")
        g.custom_command("remove", "remove_cors")
        g.custom_command("show", "show_cors")

    with self.command_group("functionapp plan", appservice_plan_sdk) as g:
        g.custom_command(
            "create",
            "create_functionapp_app_service_plan",
            exception_handler=ex_handler_factory(),
        )
        g.generic_update_command(
            "update",
            custom_func_name="update_functionapp_app_service_plan",
            setter_arg_name="app_service_plan",
            exception_handler=ex_handler_factory(),
        )
        g.command("delete", "delete", confirmation=True)
        g.custom_command("list", "list_app_service_plans")
        g.show_command("show", "get")

    with self.command_group("functionapp deployment container") as g:
        g.custom_command("config", "enable_cd")
        g.custom_command("show-cd-url", "show_container_cd_url")

    with self.command_group("functionapp config container") as g:
        g.custom_command("set", "update_container_settings_functionapp")
        g.custom_command("delete", "delete_container_settings")
        g.custom_show_command("show", "show_container_settings_functionapp")

    with self.command_group("functionapp devops-pipeline") as g:
        g.custom_command("create", "create_devops_pipeline")

    with self.command_group("functionapp deployment slot") as g:
        g.custom_command("list", "list_slots", table_transformer=output_slots_in_table)
        g.custom_command("delete", "delete_slot")
        g.custom_command("auto-swap", "config_slot_auto_swap")
        g.custom_command("swap", "swap_slot", exception_handler=ex_handler_factory())
        g.custom_command(
            "create", "create_functionapp_slot", exception_handler=ex_handler_factory()
        )