Skip to content

az functionapp plan create with --min-instances option fail #23135

@georgeOsdDev

Description

@georgeOsdDev

This is autogenerated. Please review and update as needed.

Describe the bug

This error may happen below line.
max() function does not accept str input

sku_def.capacity = max(3, number_of_workers)

Command Name
az functionapp plan create

Errors:

The command failed with an unexpected error. Here is the traceback:
'>' not supported between instances of 'str' and 'int'
Traceback (most recent call last):
  File "/opt/az/lib/python3.10/site-packages/knack/cli.py", line 231, in invoke
    cmd_result = self.invocation.execute(args)
  File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 663, in execute
    raise ex
  File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 726, in _run_jobs_serially
    results.append(self._run_job(expanded_arg, cmd_copy))
  File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 718, in _run_job
    return cmd_copy.exception_handler(ex)
  File "/opt/az/lib/python3.10/site-packages/azure/cli/command_modules/appservice/commands.py", line 39, in _ex_handler
    raise ex
  File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 697, in _run_job
    result = cmd_copy(params)
  File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 333, in __call__
    return self.handler(*args, **kwargs)
  File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler
    return op(**command_args)
  File "/opt/az/lib/python3.10/site-packages/azure/cli/command_modules/appservice/custom.py", line 3388, in create_functionapp_app_service_plan
    _enable_zone_redundant(plan_def, sku_def, number_of_workers)
  File "/opt/az/lib/python3.10/site-packages/azure/cli/command_modules/appservice/custom.py", line 1918, in _enable_zone_redundant
    sku_def.capacity = max(3, number_of_workers)
TypeError: '>' not supported between instances of 'str' and 'int'

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 functionapp plan create --name {} --resource-group {} --sku {} --location {} --min-instances {} --tags {} --zone-redundant --verbose --debug

Expected Behavior

Environment Summary

Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.31, Ubuntu 20.04.1 LTS
Python 3.10.5
Installer: DEB

azure-cli 2.38.0

Extensions:
appservice-kube 0.1.7
connectedk8s 1.2.9
customlocation 0.1.3
k8s-extension 1.2.3

Dependencies:
msal 1.18.0b1
azure-mgmt-resource 21.1.0b1

Additional Context

Metadata

Metadata

Labels

Auto-AssignAuto assign by botCXP AttentionThis issue is handled by CXP team.Functionsaz functionapp

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions