Azure / azure-cli

Azure Command-Line Interface
MIT License
4.03k stars 3k forks source link

Updating SKU for app service plan fails #21425

Closed RyanHill-MSFT closed 2 years ago

RyanHill-MSFT commented 2 years ago

This is autogenerated. Please review and update as needed.

Describe the bug

When attempting to update the sku for an appservice plan, the command fails with the error down below

Command Name az appservice plan update

Errors:

The command failed with an unexpected error. Here is the traceback:
'NoneType' object has no attribute 'sku'
Traceback (most recent call last):
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\knack/cli.py", line 231, in invoke
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 658, in execute
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 721, in _run_jobs_serially
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 713, in _run_job
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/appservice/commands.py", line 38, in _ex_handler
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 692, in _run_job
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 328, in __call__
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/command_operation.py", line 200, in handler
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/appservice/custom.py", line 1885, in update_app_service_plan
AttributeError: 'NoneType' object has no attribute 'sku'

To Reproduce:

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

Expected Behavior

Environment Summary

Windows-10-10.0.22563-SP0
Python 3.8.9
Installer: MSI

azure-cli 2.33.0 *

Extensions:
authV2 0.1.1
azure-devops 0.23.0
containerapp 0.2.0
db-up 0.2.6
interactive 0.4.5
ssh 1.0.0
webpubsub 1.1.0

Dependencies:
msal 1.16.0
azure-mgmt-resource 20.0.0

Additional Context

yonzhan commented 2 years ago

route to CXP team

SubhashVasarapu-MSFT commented 2 years ago

@RyanHill-MSFT , Looks like the command requires extra params inputs like "SKU" value. Could you please try this way? Also, make sure that you pass "APP Service Plan name" instead of "App Service name".

az appservice plan update --name MyAppServicePlan --resource-group MyResourceGroup --sku F1
RyanHill-MSFT commented 2 years ago

@RyanHill-MSFT , Looks like the command requires extra params inputs like "SKU" value. Could you please try this way? Also, make sure that you pass "APP Service Plan name" instead of "App Service name".

az appservice plan update --name MyAppServicePlan --resource-group MyResourceGroup --sku F1

I did have --sku

  LCARS.Console.Interface.Delta██ qna/728427-zipdeploy ≡  ~2 ?3  3███ █ az appservice plan update --name ryhill-plan-linux-eastus --sku S1     
The command failed with an unexpected error. Here is the traceback:                                                                                          
'NoneType' object has no attribute 'sku'                                                                                                                     
Traceback (most recent call last):                                                                                                                           
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\knack/cli.py", line 231, in invoke                                                    
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 658, in execute                            
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 721, in _run_jobs_serially                 
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 713, in _run_job                           
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/appservice/commands.py", line 38, in _ex_handler            
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 692, in _run_job                           
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 328, in __call__                           
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/command_operation.py", line 200, in handler                   
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/appservice/custom.py", line 1885, in update_app_service_plan
AttributeError: 'NoneType' object has no attribute 'sku'                                                                                                     
To open an issue, please run: 'az feedback'                                                                                                                  

The command isn't recognizing the sku argument. Seems like a bug in the subcommand.

RyanHill-MSFT commented 2 years ago

This issue doesn't occur in Az CLI 2.3.4. If anyone runs into issue, upgrade your CLI.