Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zip deployment error message is not clear when AzureWebJobsStorage app setting key is missing #30590

Open
jfo8000 opened this issue Dec 28, 2024 · 2 comments
Assignees
Labels
Auto-Assign Auto assign by bot bug This issue requires a change to an existing behavior in the product in order to be resolved. customer-reported Issues that are reported by GitHub users external to the Azure organization. Functions az functionapp Possible-Solution Service Attention This issue is responsible by Azure service team. Similar-Issue

Comments

@jfo8000
Copy link

jfo8000 commented Dec 28, 2024

Describe the bug

I was trying to deploy a function app using zip deploy on a clean account and there was no app setting for AzureWebJobsStorage.

The error message provided did not mention the lack of AzureWebJobsStorage key - instead sending me on a wild goose chase in the docs to look for something unrelated. I had to turn on debug mode and jump into the source code for the CLI to understand what was wrong with my Azure account.

def validate_zip_deploy_app_setting_exists(cmd, resource_group_name, name, slot=None):

The Azure CLI does not support this deployment path. Please configure the app to deploy from a remote package using the steps here: https://aka.ms/deployfromurl

How I got there

  • New Azure Account
  • New python function app, built in Azure pipelines using UsePythonVersion@0, ArchiveFiles@2, PublishBuildArtifacts@1.
  • I was trying to use AzureFunctionApp@2 to deploy, but fell back to testing the Azure CLI when it was having trouble

Related command

Steps to reproduce
New function app with no AzureWebJobsStorage in the app settings
From the resultant zip, try and use the azure CLI to deploy a function app with no AzureWebJobsStorage in the app settings

Errors

The Azure CLI does not support this deployment path. Please configure the app to deploy from a remote package using the steps here: https://aka.ms/deployfromurl

Issue script & Debug output

az functionapp deployment source config-zip --resource-group az-test-group --name my-app-name-here --src /azp/_work/1/s/build37.zip --debug --slot staging

The error message is raised out of validate_zip_deploy_app_setting_exists

def validate_zip_deploy_app_setting_exists(cmd, resource_group_name, name, slot=None):

cli.azure.cli.core.sdk.policies: {"id":null,"name":"yulungah-py","type":"Microsoft.Web/sites","location":"Australia East","tags":{},"properties":{"connectionStringNames":[],"appSettingNames":[],"azureStorageConfigNames":[]}}
cli.azure.cli.core.azclierror: Traceback (most recent call last):
  File "/azp/_work/_tool/Python/3.9.21/x64/lib/python3.9/site-packages/knack/cli.py", line 233, in invoke
    cmd_result = self.invocation.execute(args)
  File "/azp/_work/_tool/Python/3.9.21/x64/lib/python3.9/site-packages/azure/cli/core/commands/__init__.py", line 666, in execute
    raise ex
  File "/azp/_work/_tool/Python/3.9.21/x64/lib/python3.9/site-packages/azure/cli/core/commands/__init__.py", line 733, in _run_jobs_serially
    results.append(self._run_job(expanded_arg, cmd_copy))
  File "/azp/_work/_tool/Python/3.9.21/x64/lib/python3.9/site-packages/azure/cli/core/commands/__init__.py", line 703, in _run_job
    result = cmd_copy(params)
  File "/azp/_work/_tool/Python/3.9.21/x64/lib/python3.9/site-packages/azure/cli/core/commands/__init__.py", line 336, in __call__
    return self.handler(*args, **kwargs)
  File "/azp/_work/_tool/Python/3.9.21/x64/lib/python3.9/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler
    return op(**command_args)
  File "/azp/_work/_tool/Python/3.9.21/x64/lib/python3.9/site-packages/azure/cli/command_modules/appservice/custom.py", line 667, in enable_zip_deploy_functionapp
    validate_zip_deploy_app_setting_exists(cmd, resource_group_name, name, slot)
  File "/azp/_work/_tool/Python/3.9.21/x64/lib/python3.9/site-packages/azure/cli/command_modules/appservice/custom.py", line 932, in validate_zip_deploy_app_setting_exists
    raise ValidationError(('The Azure CLI does not support this deployment path. Please '
azure.cli.core.azclierror.ValidationError: The Azure CLI does not support this deployment path. Please configure the app to deploy from a remote package using the steps here: https://aka.ms/deployfromurl

Expected behavior

Information telling me about missing app configuration settings keys in the error message, not a please swap to another method to deploy message

Environment Summary

azure-cli 2.67.0

core 2.67.0
telemetry 1.1.0

Dependencies:
msal 1.31.0
azure-mgmt-resource 23.1.1

Python location '/azp/_work/_tool/Python/3.9.21/x64/bin/python'
Extensions directory '/home/agent/.azure/cliextensions'

Python (Linux) 3.9.21 (main, Dec 12 2024, 19:07:50)
[GCC 11.4.0]

Legal docs and information: aka.ms/AzureCliLegal

Your CLI is up-to-date.

Additional context

No response

@jfo8000 jfo8000 added the bug This issue requires a change to an existing behavior in the product in order to be resolved. label Dec 28, 2024
@yonzhan
Copy link
Collaborator

yonzhan commented Dec 28, 2024

Thank you for opening this issue, we will look into it.

Copy link

Here are some similar issues that might help you. Please check if they can solve your problem.


Possible solution (Extracted from existing issue, might be incorrect; please verify carefully)

Solution 1:

Looks like the app was still restarting after changing the app setting when you started the deployment command. Can you either wait until the restart completes or change the setting after deployment is complete?

Reference:

Solution 2:

Even if I update the appsettings later after deployment it fails with same error. It started to fail after azure cli was updated to latest version on azure DevOps hosted agent

Reference:

@microsoft-github-policy-service microsoft-github-policy-service bot added customer-reported Issues that are reported by GitHub users external to the Azure organization. Auto-Assign Auto assign by bot labels Dec 28, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added Functions az functionapp Service Attention This issue is responsible by Azure service team. labels Dec 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auto-Assign Auto assign by bot bug This issue requires a change to an existing behavior in the product in order to be resolved. customer-reported Issues that are reported by GitHub users external to the Azure organization. Functions az functionapp Possible-Solution Service Attention This issue is responsible by Azure service team. Similar-Issue
Projects
None yet
Development

No branches or pull requests

6 participants