Zip deployment error message is not clear when AzureWebJobsStorage app setting key is missing
- Dominant language
- Python
- Stars
- 4.6k
- Forks
- 3.5k
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 60
Description
### 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.
https://github.com/Azure/azure-cli/blob/ff7d0fd9b349cece66b9849f665d7a0da0c39616/src/azure-cli/azure/cli/command_modules/appservice/custom.py#L923
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
```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
```
### 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`
https://github.com/Azure/azure-cli/blob/ff7d0fd9b349cece66b9849f665d7a0da0c39616/src/azure-cli/azure/cli/command_modules/appservice/custom.py#L923
```
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_
Contributor guide
Assessment
This issue has not been assessed yet.