azure-cli: FunctionApp:az functionapp deployment fails after upgrade to Azure-cli 2.29

After updating to Azure-cli 2.29, my functionapp zip deployment no longer works. Downgrading to 2.28 resolves the issue. I first noticed this issue when my bitbucket pipeline failed as it uses the latest image of mcr.microsoft.com/azure-cli.

Command Name az functionapp deployment source config-zip

Errors:

The command failed with an unexpected error. Here is the traceback:
'str' object has no attribute 'value'
Traceback (most recent call last):
  File "/opt/az/lib/python3.6/site-packages/knack/cli.py", line 231, in invoke
    cmd_result = self.invocation.execute(args)
  File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 657, in execute
    raise ex
  File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 720, 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 691, in _run_job
    result = cmd_copy(params)
  File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 328, in __call__
    return self.handler(*args, **kwargs)
  File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler
    return op(**command_args)
  File "/opt/az/lib/python3.6/site-packages/azure/cli/command_modules/appservice/custom.py", line 405, in enable_zip_deploy_functionapp
    return enable_zip_deploy(cmd, resource_group_name, name, src, timeout, slot)
  File "/opt/az/lib/python3.6/site-packages/azure/cli/command_modules/appservice/custom.py", line 417, in enable_zip_deploy
    scm_url = _get_scm_url(cmd, resource_group_name, name, slot)
  File "/opt/az/lib/python3.6/site-packages/azure/cli/command_modules/appservice/custom.py", line 1948, in _get_scm_url
    webapp = show_webapp(cmd, resource_group_name, name, slot=slot)
  File "/opt/az/lib/python3.6/site-packages/azure/cli/command_modules/appservice/custom.py", line 607, in show_webapp
    return _show_app(cmd, resource_group_name, name, "webapp", slot)
  File "/opt/az/lib/python3.6/site-packages/azure/cli/command_modules/appservice/custom.py", line 736, in _show_app
    "Unable to find {} '{}', in RG '{}'".format(cmd_app_type.value, name, resource_group_name),
AttributeError: 'str' object has no attribute 'value'

To Reproduce:

Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.

  • login using az login
  • az functionapp deployment source config-zip --name {} --resource-group {} --src {a zip file} --timeout 300

Expected Behavior

Prior to Azure-cli version 2.29, the above command worked

Environment Summary

I also get this issue running in bitbucket pipeline using image mcr.microsoft.com/azure-cli

Linux-5.4.72-microsoft-standard-WSL2-x86_64-with-debian-bullseye-sid, Ubuntu 20.04.3 LTS
Python 3.6.10
Installer: DEB

azure-cli 2.29.0

Extensions:
datafactory 0.2.0

Additional Context

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 6
  • Comments: 19 (9 by maintainers)

Most upvoted comments

@panchagnula & @parth21999 This is a blocker for functions deployment. Is it possible to release a hotfix?

PR #19493 is causing the issue.

@Kotasudhakarreddy Is there an ETA when this will become available in the https://packages.microsoft.com/ubuntu/20.04/prod repository?

For the “deb package missing for focal” issue, let’s work on #20023.

Is there perhaps an eta for this fix?

similar question: Any timeline on when the new version will also be deployed within focal? It is not possible to upgrade the CLI via the “upgrade” in DevOps pipelines conveniently.

https://packages.microsoft.com/repos/azure-cli/dists/focal/ Thanks!

Fix has been released. Please upgrade to Azure CLI 2.29.1

Yup same problem for me - do we know the latest version that DOES work ok? i.e. exactly which version to roll back to where it still works.

I am successfully using Azure-cli version 2.28, and image mcr.microsoft.com/azure-cli:2.28.0.