Repository: Azure/azure-cli-extensions

Issue:
Functionapp extension not working after CLI update
### Extension name (the extension in question)

functionapp

### Description of issue (in as much detail as possible)

After updating az CLI to 2.34.1, `az functionapp devops-pipeline create` fails with

```shell
$ az functionapp devops-pipeline create
The command failed with an unexpected error. Here is the traceback:
cannot import name 'show_functionapp' from 'azure.cli.command_modules.appservice.custom' (/opt/azure-cli/lib/python3.10/site-packages/azure/cli/command_modules/appservice/custom.py)
Traceback (most recent call last):
  File "/opt/azure-cli/lib/python3.10/site-packages/knack/cli.py", line 231, in invoke
    cmd_result = self.invocation.execute(args)
  File "/opt/azure-cli/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 658, in execute
    raise ex
  File "/opt/azure-cli/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 721, in _run_jobs_serially
    results.append(self._run_job(expanded_arg, cmd_copy))
  File "/opt/azure-cli/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 692, in _run_job
    result = cmd_copy(params)
  File "/opt/azure-cli/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 328, in __call__
    return self.handler(*args, **kwargs)
  File "/opt/azure-cli/lib/python3.10/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler
    return op(**command_args)
  File "/home/ilkka/.azure/cliextensions/functionapp/azext_functionapp/custom.py", line 22, in create_devops_pipeline
    from .azure_devops_build_interactive import AzureDevopsBuildInteractive
  File "/home/ilkka/.azure/cliextensions/functionapp/azext_functionapp/azure_devops_build_interactive.py", line 31, in <module>
    from azure.cli.command_modules.appservice.custom import (
ImportError: cannot import name 'show_functionapp' from 'azure.cli.command_modules.appservice.custom' (/opt/azure-cli/lib/python3.10/site-packages/azure/cli/command_modules/appservice/custom.py)
To open an issue, please run: 'az feedback'
```

Here's the version information:

```shell
$ az --version                            
azure-cli                         2.34.1

core                              2.34.1
telemetry                          1.0.6

Extensions:
functionapp                        0.1.0

Dependencies:
msal                              1.17.0
azure-mgmt-resource               20.0.0

Python location '/opt/azure-cli/bin/python'
Extensions directory '/home/ilkka/.azure/cliextensions'

Python (Linux) 3.10.2 (main, Jan 15 2022, 19:56:27) [GCC 11.1.0]

Legal docs and information: aka.ms/AzureCliLegal


Your CLI is up-to-date.

Please let us know how we are doing: https://aka.ms/azureclihats
and let us know if you're interested in trying out our newest features: https://aka.ms/CLIUXstudy
```

-----




Discussion:
route to CXP team
@ilkka Thanks for the feedback! I can confirm the same error and will work with the concerned team to get this fixed.

Resolving patch:
diff --git a/src/functionapp/azext_functionapp/azure_devops_build_interactive.py b/src/functionapp/azext_functionapp/azure_devops_build_interactive.py
--- a/src/functionapp/azext_functionapp/azure_devops_build_interactive.py
+++ b/src/functionapp/azext_functionapp/azure_devops_build_interactive.py
@@ -30,7 +30,7 @@
 )
 from azure.cli.command_modules.appservice.custom import (
     list_function_app,
-    show_functionapp,
+    show_webapp,
     get_app_settings)
 from azure.cli.command_modules.appservice.utils import str2bool
 from .azure_devops_build_provider import AzureDevopsBuildProvider
@@ -242,7 +242,7 @@ def process_functionapp(self):
         else:
             functionapp = self.cmd_selector.cmd_functionapp(self.functionapp_name)
 
-        kinds = show_functionapp(self.cmd, functionapp.resource_group, functionapp.name).kind.split(',')
+        kinds = show_webapp(self.cmd, functionapp.resource_group, functionapp.name).kind.split(',')
 
         # Get functionapp settings in Azure
         app_settings = get_app_settings(self.cmd, functionapp.resource_group, functionapp.name)
diff --git a/src/functionapp/setup.py b/src/functionapp/setup.py
--- a/src/functionapp/setup.py
+++ b/src/functionapp/setup.py
@@ -16,7 +16,7 @@
 
 # TODO: Confirm this is the right version number you want and it matches your
 # HISTORY.rst entry.
-VERSION = '0.1.0'
+VERSION = '0.1.1'
 
 # The full list of classifiers is available at
 # https://pypi.python.org/pypi?%3Aaction=list_classifiers


Test patch:
diff --git a/src/functionapp/azext_functionapp/tests/latest/test_devops_build_commands_thru_mock.py b/src/functionapp/azext_functionapp/tests/latest/test_devops_build_commands_thru_mock.py
--- a/src/functionapp/azext_functionapp/tests/latest/test_devops_build_commands_thru_mock.py
+++ b/src/functionapp/azext_functionapp/tests/latest/test_devops_build_commands_thru_mock.py
@@ -130,7 +130,7 @@ def test_github_prechecks(self, _find_github_repository_runtime_language, check_
         self._client.pre_checks_github()
 
     @patch(interactive_patch_path("get_app_settings"), MagicMock())
-    @patch(interactive_patch_path("show_functionapp"), MagicMock())
+    @patch(interactive_patch_path("show_webapp"), MagicMock())
     @patch(interactive_patch_path("AzureDevopsBuildInteractive._find_type"), MagicMock())
     @patch(interactive_patch_path("AzureDevopsBuildInteractive._get_functionapp_runtime_language"), MagicMock())
     @patch(interactive_patch_path("AzureDevopsBuildInteractive._get_functionapp_storage_name"), MagicMock())