azure-cli icon indicating copy to clipboard operation
azure-cli copied to clipboard

'NoneType' object has no attribute 'server_farm_id'

Open evandervalk opened this issue 7 years ago • 14 comments

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

evandervalk avatar Oct 08 '19 10:10 evandervalk

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

ghost avatar Oct 09 '19 02:10 ghost

Experiencing the same issue

tbarlow12 avatar Oct 10 '19 18:10 tbarlow12

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

BrixSat avatar Oct 22 '19 10:10 BrixSat

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/

mlomat avatar Nov 07 '19 02:11 mlomat

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.

jalajmsft avatar Dec 09 '19 06:12 jalajmsft

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).

evandervalk avatar Dec 17 '19 15:12 evandervalk

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.

MarkHerhold avatar Feb 19 '20 18:02 MarkHerhold

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 ?

amac44 avatar Feb 25 '20 00:02 amac44

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.

MarkHerhold avatar Feb 25 '20 02:02 MarkHerhold

@evandervalk Apologies for the late reply. Could you please let me know if you are still facing the same issue with most recent version of Az CLI? Awaiting you reply.

navba-MSFT avatar Mar 21 '22 09:03 navba-MSFT

Hi, we're sending this friendly reminder because we haven't heard back from you in a while. We need more information about this issue to help address it. Please be sure to give us your input within the next 7 days. If we don't hear back from you within 14 days of this comment the issue will be automatically closed. Thank you!

ghost avatar Mar 28 '22 14:03 ghost

Seeing as I created this ticket 2 years ago, we've since worked around the problem and I don't even know if the workaround is still in place. I'd have to check and get into it when I'm not busy, which I'm happy to do but it will take some time.

On that note, it's interesting to see that it can take 2 years for a reply from Microsoft but I'm expected to solve this in 14 days 😕.

Regardless, I'll give it a shot this week and see if it helps.

evandervalk avatar Mar 28 '22 14:03 evandervalk

We are having this same issue when deploying to an azure function using the latest azure-cli. https://github.com/Azure/azure-cli/issues/23050

markhoratiowalmsley avatar Jun 28 '22 11:06 markhoratiowalmsley

This issue is fixed. Please upgrade to latest version of az cli 2.40.0 and retry

RakeshMohanMSFT avatar Sep 20 '22 05:09 RakeshMohanMSFT