question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

az functionapp deployment source config-zip fails with AttributeError: 'NoneType' object has no attribute 'lower'

See original GitHub issue

Using latest azure-cli I cannot deploy to a functionapp using cli locally. Update to latest azure-cli did not work as specified here: https://github.com/Azure/azure-cli/issues/10773

This is autogenerated. Please review and update as needed.

Describe the bug

Command Name az functionapp deployment source config-zip

Errors:

The command failed with an unexpected error. Here is the traceback:
'NoneType' object has no attribute 'lower'
Traceback (most recent call last):
  File "/opt/az/lib/python3.10/site-packages/knack/cli.py", line 231, in invoke
    cmd_result = self.invocation.execute(args)
  File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 663, in execute
    raise ex
  File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 726, in _run_jobs_serially
    results.append(self._run_job(expanded_arg, cmd_copy))
  File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 697, in _run_job
    result = cmd_copy(params)
  File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 333, in __call__
    return self.handler(*args, **kwargs)
  File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler
    return op(**command_args)
  File "/opt/az/lib/python3.10/site-packages/azure/cli/command_modules/appservice/custom.py", line 522, in enable_zip_deploy_functionapp
    remove_remote_build_app_settings(cmd, resource_group_name, name, slot)
  File "/opt/az/lib/python3.10/site-packages/azure/cli/command_modules/appservice/custom.py", line 645, in remove_remote_build_app_settings
    value = keyval['value'].lower()
AttributeError: 'NoneType' object has no attribute 'lower'

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 functionapp deployment source config-zip --src {} --subscription {} --resource-group {} --name {}

Expected Behavior

Environment Summary

Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.31, Ubuntu 20.04 LTS
Python 3.10.4
Installer: DEB

azure-cli 2.37.0

Additional Context

`

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
RakeshMohanMSFTcommented, Jun 29, 2022

@markhoratiowalmsley Thank you for reaching out, we are looking into it.

0reactions
leadponycommented, Oct 17, 2022

@RakeshMohanMSFT

I reproduced the problem with the latest version: 2.41.0.

The functionapp as a deployment target is configured as follows:

  • Stack: custom docker image
  • Registry source: Azure Container Registry
  • Registry authentication: Admin Credentials
  • Set WEBSITE-ENABLE_APP_SERVICE_STORAGE in the appsettings to true, for deploying the app under /home

Please see the article https://learn.microsoft.com/en-us/azure/app-service/configure-custom-container?pivots=container-linux#configure-environment-variables

If your app uses images from a private registry or from Docker Hub, credentials for accessing the repository are saved in environment variables: DOCKER_REGISTRY_SERVER_URL, DOCKER_REGISTRY_SERVER_USERNAME and DOCKER_REGISTRY_SERVER_PASSWORD. Because of security risks, none of these reserved variable names are exposed to the application.

Functionapp services automatically replace the value of DOCKER_REGISTRY_SERVER_* in the appsettings with null, which is mapped to None in the Azure CLI. NoneType object has no attribute lower in Python.

Could you please reopen this issue?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Publish function succeeds but no function gets created
az functionapp deployment source config -zip -g <our_grp_name> -n myfnapp --src zipfile.zip ... AttributeError: 'NoneType' object has no attribute 'lower'.
Read more >
GitHub Actions - Azure Function Apps zip deployment - ERROR
Azure Function App zip deployment: az functionapp deployment source config-zip. ... ERROR: 'str' object has no attribute 'value'
Read more >
Django & Djoser 'NoneType' object has no attribute 'lower ...
Hey I got the same error while override Djoser's UserCreateSerializer. This solution works fine for me
Read more >
azure-cli 2.16.0 - PyPI
az functionapp deployment source config -zip : Fixed an issue where config-zip could throw an exception on success on linux consumption (#15174).
Read more >
ERROR: 'NoneType' object has no attribute 'lower'
we were able to work around by upgrading the worker VM with a new Azure CLI version and then using the OctopusDisableAzureCLI to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found