Azure / azure-cli

Azure Command-Line Interface
MIT License
3.98k stars 2.95k forks source link

'int' object is not subscriptable when trying to create autoscale profile for recurrence #17929

Open chigeroo opened 3 years ago

chigeroo commented 3 years ago

This is autogenerated. Please review and update as needed.

Describe the bug

When trying to create a recurrence profile using --recurrence week sat sun or any combination of days throws the below error. It does not happen when creating a profile with a start date and end date, seems to be confined to recurrence.

Command Name az monitor autoscale profile create

Errors:

'int' object is not subscriptable
Traceback (most recent call last):
Lib\site-packages\knack\cli.py, ln 231, in invoke
cli\core\commands\__init__.py, ln 657, in execute
cli\core\commands\__init__.py, ln 720, in _run_jobs_serially
cli\core\commands\__init__.py, ln 712, in _run_job
...
cli\core\commands\__init__.py, ln 691, in _run_job
cli\core\commands\__init__.py, ln 328, in __call__
azure\cli\core\__init__.py, ln 807, in default_command_handler
command_modules\monitor\operations\autoscale_settings.py, ln 248, in autoscale_profile_create
command_modules\monitor\operations\autoscale_settings.py, ln 215, in _create_recurring_profile
cli\command_modules\monitor\_autoscale_util.py, ln 591, in build_autoscale_profile
TypeError: 'int' object is not subscriptable

To Reproduce:

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

Expected Behavior

For it to create a recurrence scale setting

Environment Summary

Windows-10-10.0.19041-SP0
Python 3.6.8
Installer: MSI

azure-cli 2.22.1

Extensions:
subscription 0.1.4
webapp 0.3.1

Additional Context

yonzhan commented 3 years ago

monitor

Jing-song commented 3 years ago

Hi @chigeroo ,Maybe you can try the updated version. I did not find the same problem in the following versions. azure-cli: 2.27.0 logic: 0.1.4 This is the command I used:az monitor autoscale profile create -g rg --autoscale-name myvmss -n test1 --copy-rules default --min-count 1 --count 2 --max-count 2 --recurrence week sat --timezone "Pacific Standard Time"