azure-cli: Bind SSL Certificates : ERROR: 'str' object has no attribute 'value'

This is autogenerated. Please review and update as needed.

Describe the bug

Command Name az webapp config ssl bind

Errors:

The command failed with an unexpected error. Here is the traceback:
'str' object has no attribute 'value'
Traceback (most recent call last):
  File "/usr/local/Cellar/azure-cli/2.29.1/libexec/lib/python3.9/site-packages/knack/cli.py", line 231, in invoke
    cmd_result = self.invocation.execute(args)
  File "/usr/local/Cellar/azure-cli/2.29.1/libexec/lib/python3.9/site-packages/azure/cli/core/commands/__init__.py", line 657, in execute
    raise ex
  File "/usr/local/Cellar/azure-cli/2.29.1/libexec/lib/python3.9/site-packages/azure/cli/core/commands/__init__.py", line 720, in _run_jobs_serially
    results.append(self._run_job(expanded_arg, cmd_copy))
  File "/usr/local/Cellar/azure-cli/2.29.1/libexec/lib/python3.9/site-packages/azure/cli/core/commands/__init__.py", line 712, in _run_job
    return cmd_copy.exception_handler(ex)
  File "/usr/local/Cellar/azure-cli/2.29.1/libexec/lib/python3.9/site-packages/azure/cli/command_modules/appservice/commands.py", line 37, in _ex_handler
    raise ex
  File "/usr/local/Cellar/azure-cli/2.29.1/libexec/lib/python3.9/site-packages/azure/cli/core/commands/__init__.py", line 691, in _run_job
    result = cmd_copy(params)
  File "/usr/local/Cellar/azure-cli/2.29.1/libexec/lib/python3.9/site-packages/azure/cli/core/commands/__init__.py", line 328, in __call__
    return self.handler(*args, **kwargs)
  File "/usr/local/Cellar/azure-cli/2.29.1/libexec/lib/python3.9/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler
    return op(**command_args)
  File "/usr/local/Cellar/azure-cli/2.29.1/libexec/lib/python3.9/site-packages/azure/cli/command_modules/appservice/custom.py", line 2597, in bind_ssl_cert
    return _update_ssl_binding(cmd, resource_group_name, name, certificate_thumbprint,
  File "/usr/local/Cellar/azure-cli/2.29.1/libexec/lib/python3.9/site-packages/azure/cli/command_modules/appservice/custom.py", line 2590, in _update_ssl_binding
    return show_webapp(cmd, resource_group_name, name, slot)
  File "/usr/local/Cellar/azure-cli/2.29.1/libexec/lib/python3.9/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 "/usr/local/Cellar/azure-cli/2.29.1/libexec/lib/python3.9/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.

  • Put any pre-requisite steps here…
  • az webapp config ssl bind --certificate-thumbprint {} --name {} --resource-group {} --ssl-type {} --subscription {}

Expected Behavior

Environment Summary

macOS-11.6-x86_64-i386-64bit, Darwin 20.6.0
Python 3.9.7
Installer: HOMEBREW

azure-cli 2.29.1

Extensions:
azure-devops 0.18.0

Additional Context

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 1
  • Comments: 23 (8 by maintainers)

Most upvoted comments

@louisbergmann sorry for the lack of response on this. Yes, the issues with changes to show webapp being used for show function app is known - the fix is in progress & targeting March CLI release. Thanks!

@jiasli Looks like the issue has been fixed

az version
{
  "azure-cli": "2.31.0",
  "azure-cli-core": "2.31.0",
  "azure-cli-telemetry": "1.0.6",
  "extensions": {
    "azure-devops": "0.18.0"
  }
}

az webapp config ssl bind --certificate-thumbprint XXXX --name XXXX --resource-group XXXX --ssl-type SNI | ConvertFrom-Json

appServicePlanId            : XXXX
availabilityState           : Normal
clientAffinityEnabled       : True
clientCertEnabled           : False
clientCertExclusionPaths    : 
clientCertMode              : Required
cloningInfo                 : 
...

but when I try this az functionapp config ssl bind --certificate-thumbprint XXXX --name BBBB --resource-group BBBB --ssl-type SNI | ConvertFrom-Json

ERROR: Unable to find webapp 'BBBB', in resource group 'BBBB'
Use 'az functionapp show' to show functionapps

I can check this resource

az functionapp config appsettings list --name BBBB --resource-group BBBB

[
  {
    "name": "Name",
    "slotSetting": false,
    "value": "1111"
  },
  {
    "name": "Name2",
    "slotSetting": false,
    "value": "2222"
  },
....

This error is happening for me when trying to deploy a config-zip on both a webapp and a functionapp …

az functionapp deployment source config-zip -g $env:RESOURCE_GROUP_NAME -n $env:APP_NAME -t 300 --src $env:FILE_PATH

ERROR: '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'

route o service team