Azure-cli: az webapp up fails with AttributeError 'NoneType' object has no attribute 'resource_group'

Created on 11 Oct 2019  路  10Comments  路  Source: Azure/azure-cli

This is autogenerated. Please review and update as needed.

Describe the bug

Command Name
az webapp up

Errors:

Get an error saying Webapp NAME already exits. The command will deploy contents to the existing app even though the web app with this name does not exist

'NoneType' object has no attribute 'resource_group'
Traceback (most recent call last):
python3.7/site-packages/knack/cli.py, ln 206, in invoke
    cmd_result = self.invocation.execute(args)
cli/core/commands/__init__.py, ln 603, in execute
    raise ex
cli/core/commands/__init__.py, ln 661, in _run_jobs_serially
    results.append(self._run_job(expanded_arg, cmd_copy))
cli/core/commands/__init__.py, ln 652, in _run_job
    cmd_copy.exception_handler(ex)
...
cli/core/commands/__init__.py, ln 306, in __call__
    return self.handler(*args, **kwargs)
azure/cli/core/__init__.py, ln 485, in default_command_handler
    return op(**command_args)
cli/command_modules/appservice/custom.py, ln 2793, in webapp_up
    current_rg = app_details.resource_group
AttributeError: 'NoneType' object has no attribute 'resource_group'

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 up or az webapp up -n or az webapp up -n -g

Expected Behavior

A new web app with the given name is created.

Environment Summary

Darwin-17.7.0-x86_64-i386-64bit
Python 3.7.4
Shell: bash

azure-cli 2.0.74

Extensions:
db-up 0.1.13

Additional Context

See related:


Service Attention Web Apps

All 10 comments

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @AzureAppServiceCLI @antcp

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @AzureAppServiceCLI @antcp

Can you please re-try with the latest version of CLI we had a regression that should now be fixed. Thank you.

@panchagnula confirmed that upgrading the cli resolved this particular issue

$ az --version
azure-cli                         2.0.75

command-modules-nspkg              2.0.3
core                              2.0.75
nspkg                              3.0.4
telemetry                          1.0.4

Extensions:
db-up                             0.1.13

Hi,
I encounter the same issue also with azure-cli 2.0.75:

$ az --version
azure-cli                         2.0.75

command-modules-nspkg              2.0.3
core                              2.0.75
nspkg                              3.0.4
telemetry                          1.0.4

Following your example, I get:

/python-docs-hello-world$ az webapp up -n Hello
Webapp Hello already exits. The command will deploy contents to the existing app
The command failed with an unexpected error. Here is the traceback:

'NoneType' object has no attribute 'resource_group'
Traceback (most recent call last):
  File "/opt/az/lib/python3.6/site-packages/knack/cli.py", line 206, in invoke
    cmd_result = self.invocation.execute(args)
  File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 603, in execute
    raise ex
  File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 661, 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 652, in _run_job
    cmd_copy.exception_handler(ex)
  File "/opt/az/lib/python3.6/site-packages/azure/cli/command_modules/appservice/commands.py", line 55, in _polish_bad_errors
    raise ex
  File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 631, in _run_job
    result = cmd_copy(params)
  File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 306, in __call__
    return self.handler(*args, **kwargs)
  File "/opt/az/lib/python3.6/site-packages/azure/cli/core/__init__.py", line 485, in default_command_handler
    return op(**command_args)
  File "/opt/az/lib/python3.6/site-packages/azure/cli/command_modules/appservice/custom.py", line 2793, in webapp_up
    current_rg = app_details.resource_group
AttributeError: 'NoneType' object has no attribute 'resource_group' 

I am using WSL (Windows 10 v 1709) with Ubuntu 18.04.

Same issue with azure-cli 2.0.76 using a sandbox on this tutorial

https://docs.microsoft.com/en-us/learn/modules/host-a-web-app-with-azure-app-service/6-exercise-deploy-your-code-to-app-service?pivots=csharp

I am trying the run the az webapp up command as well, with parameters of course.

az --version says 2.0.76 and that I have the latest

Same issue with azure-cli 2.0.76 using a sandbox on this tutorial

https://docs.microsoft.com/en-us/learn/modules/host-a-web-app-with-azure-app-service/6-exercise-deploy-your-code-to-app-service?pivots=csharp

I am trying the run the az webapp up command as well, with parameters of course.

az --version says 2.0.76 and that I have the latest

I created a new ticket here:

https://github.com/Azure/azure-cli/issues/11089

Same...

@Azure:~/contoso-pets/src/ContosoPets.Ui$ az webapp up Webapp webapp238173089 already exists. The command will deploy contents to the existing app. The command failed with an unexpected error. Here is the traceback:

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rlewkowicz picture rlewkowicz  路  3Comments

amarzavery picture amarzavery  路  3Comments

dhermans picture dhermans  路  3Comments

Kannaj picture Kannaj  路  3Comments

seanknox picture seanknox  路  3Comments