Azure-cli: 'NoneType' object has no attribute 'server_farm_id'

Created on 8 Oct 2019  路  9Comments  路  Source: Azure/azure-cli

This is autogenerated. Please review and update as needed.

Describe the bug

Command Name
az functionapp deployment source config-zip

Errors:

'NoneType' object has no attribute 'server_farm_id'
Traceback (most recent call last):
Temp\pip-install-6e754znd\knack\knack\cli.py, ln 206, in invoke
azure\cli\core\commands\__init__.py, ln 603, in execute
azure\cli\core\commands\__init__.py, ln 661, in _run_jobs_serially
azure\cli\core\commands\__init__.py, ln 654, in _run_job
Local\Temp\pip-install-6e754znd\six\six.py, ln 693, in reraise
azure\cli\core\commands\__init__.py, ln 631, in _run_job
azure\cli\core\commands\__init__.py, ln 306, in __call__
azure-cli-core\azure\cli\core\__init__.py, ln 485, in default_command_handler
azure\cli\command_modules\appservice\custom.py, ln 314, in enable_zip_deploy_functionapp
AttributeError: 'NoneType' object has no attribute 'server_farm_id'

To Reproduce:

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

  • az functionapp create ...
  • az functionapp deployment source config-zip --src {} --name {} --resource-group {}

Expected Behavior

I expect it to deploy. Instead I get an error.

Environment Summary

Windows-10-10.0.18362-SP0
Python 3.6.6
Shell: cmd.exe

azure-cli 2.0.74

Additional Context


Functions Service Attention customer-reported

Most helpful comment

I hit this issue and it turns out that I typo'd a resource name (the function app itself). The CLI errors are terrible and make it look like a CLI bug when it actually was mine.

I used --debug at the end of my CLI command to help figure out the issue - there was a 404 HTTP response.

Hope this helps someone.

All 9 comments

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @ ahmedelnably, @fabiocav

Experiencing the same issue

Same issue here

az --version

azure-cli 2.0.74 *

command-modules-nspkg 2.0.3
core 2.0.74 *
nspkg 3.0.4
telemetry 1.0.3 *

Python location '/opt/az/bin/python3'
Extensions directory '/home/xarevision/.azure/cliextensions'

Python (Linux) 3.6.5 (default, Sep 20 2019, 05:43:07)
[GCC 8.3.0]

Legal docs and information: aka.ms/AzureCliLegal

I had exactly this same issue. This tip to set subscription helped. Maybe it will help you also.

https://stuart-moore.com/azure-cli-error-nonetype-object-has-no-attribute-server_farm_id/

This issue also seems to be happening intermittently for webapp deployment.

az webapp deployment source config-zip -g {} -n {} --src {}

This was raised at azure-pipelines-tasks repo.

Any update on this issue? Hoping to get this fixed soon so I can just use Azure CLI instead of a combination of Azure CLI and Azure Function Core Tools (which bloats my Docker image).

I hit this issue and it turns out that I typo'd a resource name (the function app itself). The CLI errors are terrible and make it look like a CLI bug when it actually was mine.

I used --debug at the end of my CLI command to help figure out the issue - there was a 404 HTTP response.

Hope this helps someone.

Confused about the 404 error mentioned above (which I am also getting) - Does the target function app have to already exist? So to copy a function app from resource group A to resource group B using config-zip, one would have to (1) create app plan on target, (2) create function app on target than uses that plan, (3) run az functionapp deployment source config-zip ?

Confused about the 404 error mentioned above (which I am also getting) - Does the target function app have to already exist? So to copy a function app from resource group A to resource group B using config-zip, one would have to (1) create app plan on target, (2) create function app on target than uses that plan, (3) run az functionapp deployment source config-zip ?

I believe so, yes. The CLI won't create anything. You'd probably want to use a deploy template.

Was this page helpful?
0 / 5 - 0 ratings