Azure / azure-cli

Azure Command-Line Interface
MIT License
3.92k stars 2.89k forks source link

Exrension "az logicapp deployment source config-zip" doesn't work with 401 error #29020

Open ShingoHanai opened 1 month ago

ShingoHanai commented 1 month ago

Describe the bug

Through following document, after adding latest extension of az logicapp, zip deploy doesn't work with 401 error.

https://learn.microsoft.com/en-us/azure/logic-apps/set-up-devops-deployment-single-tenant-azure-logic-apps?tabs=azure-cli#tabpanel_1_azure-cli

If removing that extension by following command, zip deploy works correctly without that extension.

az extension remove --name logicapp

Could you fix az logicapp extension?

Related command

az extension add --yes --source "https://aka.ms/logicapp-latest-py2.py3-none-any.whl" az logicapp deployment source config-zip --name test808 --resource-group standard --src test808.zip

Errors

urllib3.connectionpool: https://test808.scm.azurewebsites.net:443 "GET /api/settings HTTP/1.1" 401 0 cli.azure.cli.core.azclierror: Traceback (most recent call last): File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\knack/cli.py", line 233, in invoke File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 663, in execute File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 726, in _run_jobs_serially File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 697, in _run_job File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 333, in call File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/command_operation.py", line 121, in handler File "C:\Users\shhanai.azure\cliextensions\logicapp\azext_logicapp\custom.py", line 1561, in enable_zip_deploy_functionapp remove_remote_build_app_settings(cmd, resource_group_name, name, slot) File "C:\Users\shhanai.azure\cliextensions\logicapp\azext_logicapp\custom.py", line 1467, in remove_remote_build_app_settings scm_is_up_to_date = validate_app_settings_in_scm( File "C:\Users\shhanai.azure\cliextensions\logicapp\azext_logicapp\custom.py", line 1426, in validate_app_settings_in_scm scm_settings = _get_app_settings_from_scm(cmd, resource_group_name, name, slot) File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/appservice/utils.py", line 130, in call File "C:\Users\shhanai.azure\cliextensions\logicapp\azext_logicapp\custom.py", line 1416, in _get_app_settings_from_scm return response.json() or {} File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\requests/models.py", line 910, in json File "json__init__.py", line 346, in loads File "json\decoder.py", line 337, in decode File "json\decoder.py", line 355, in raw_decode json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

cli.azure.cli.core.azclierror: The command failed with an unexpected error. Here is the traceback: az_command_data_logger: The command failed with an unexpected error. Here is the traceback: cli.azure.cli.core.azclierror: Expecting value: line 1 column 1 (char 0) Traceback (most recent call last): File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\knack/cli.py", line 233, in invoke File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 663, in execute File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 726, in _run_jobs_serially File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 697, in _run_job File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 333, in call File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/command_operation.py", line 121, in handler File "C:\Users\shhanai.azure\cliextensions\logicapp\azext_logicapp\custom.py", line 1561, in enable_zip_deploy_functionapp remove_remote_build_app_settings(cmd, resource_group_name, name, slot) File "C:\Users\shhanai.azure\cliextensions\logicapp\azext_logicapp\custom.py", line 1467, in remove_remote_build_app_settings scm_is_up_to_date = validate_app_settings_in_scm( File "C:\Users\shhanai.azure\cliextensions\logicapp\azext_logicapp\custom.py", line 1426, in validate_app_settings_in_scm scm_settings = _get_app_settings_from_scm(cmd, resource_group_name, name, slot) File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/appservice/utils.py", line 130, in call File "C:\Users\shhanai.azure\cliextensions\logicapp\azext_logicapp\custom.py", line 1416, in _get_app_settings_from_scm return response.json() or {} File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\requests/models.py", line 910, in json File "json__init.py", line 346, in loads File "json\decoder.py", line 337, in decode File "json\decoder.py", line 355, in raw_decode json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0) az_command_data_logger: Expecting value: line 1 column 1 (char 0) Traceback (most recent call last): File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\knack/cli.py", line 233, in invoke File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 663, in execute File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 726, in _run_jobs_serially File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 697, in _run_job File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 333, in call File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/command_operation.py", line 121, in handler File "C:\Users\shhanai.azure\cliextensions\logicapp\azext_logicapp\custom.py", line 1561, in enable_zip_deploy_functionapp remove_remote_build_app_settings(cmd, resource_group_name, name, slot) File "C:\Users\shhanai.azure\cliextensions\logicapp\azext_logicapp\custom.py", line 1467, in remove_remote_build_app_settings scm_is_up_to_date = validate_app_settings_in_scm( File "C:\Users\shhanai.azure\cliextensions\logicapp\azext_logicapp\custom.py", line 1426, in validate_app_settings_in_scm scm_settings = _get_app_settings_from_scm(cmd, resource_group_name, name, slot) File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/appservice/utils.py", line 130, in call File "C:\Users\shhanai.azure\cliextensions\logicapp\azext_logicapp\custom.py", line 1416, in _get_app_settings_from_scm return response.json() or {} File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\requests/models.py", line 910, in json File "json\init__.py", line 346, in loads File "json\decoder.py", line 337, in decode File "json\decoder.py", line 355, in raw_decode json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Issue script & Debug output

az logicapp deployment source config-zip --name test808 --resource-group standard --src test808.zip The behavior of this command has been altered by the following extension: logicapp Getting scm site credentials for zip deployment Starting zip deployment. This operation can take a while to complete ... Deployment endpoint responded with status code 401 Deployment status endpoint https://test808.scm.azurewebsites.net/api/deployments/latest returns malformed data. Retrying... Deployment status endpoint https://test808.scm.azurewebsites.net/api/deployments/latest returns malformed data. Retrying... Deployment status endpoint https://test808.scm.azurewebsites.net/api/deployments/latest returns malformed data. Retrying... Deployment status endpoint https://test808.scm.azurewebsites.net/api/deployments/latest returns malformed data. Retrying... Deployment status endpoint https://test808.scm.azurewebsites.net/api/deployments/latest returns malformed data. Retrying... Deployment status endpoint https://test808.scm.azurewebsites.net/api/deployments/latest returns malformed data. Retrying... Deployment status endpoint https://test808.scm.azurewebsites.net/api/deployments/latest returns malformed data. Retrying... Deployment status endpoint https://test808.scm.azurewebsites.net/api/deployments/latest returns malformed data. Retrying... Deployment status endpoint https://test808.scm.azurewebsites.net/api/deployments/latest returns malformed data. Retrying... Deployment status endpoint https://test808.scm.azurewebsites.net/api/deployments/latest returns malformed data. Retrying... Deployment status endpoint https://test808.scm.azurewebsites.net/api/deployments/latest returns malformed data. Retrying... Deployment status endpoint https://test808.scm.azurewebsites.net/api/deployments/latest returns malformed data. Retrying... Deployment status endpoint https://test808.scm.azurewebsites.net/api/deployments/latest returns malformed data. Retrying... Deployment status endpoint https://test808.scm.azurewebsites.net/api/deployments/latest returns malformed data. Retrying... Deployment status endpoint https://test808.scm.azurewebsites.net/api/deployments/latest returns malformed data. Retrying... Deployment status endpoint https://test808.scm.azurewebsites.net/api/deployments/latest returns malformed data. Retrying... Deployment status endpoint https://test808.scm.azurewebsites.net/api/deployments/latest returns malformed data. Retrying... Deployment status endpoint https://test808.scm.azurewebsites.net/api/deployments/latest returns malformed data. Retrying... Deployment status endpoint https://test808.scm.azurewebsites.net/api/deployments/latest returns malformed data. Retrying... Deployment status endpoint https://test808.scm.azurewebsites.net/api/deployments/latest returns malformed data. Retrying... Deployment status endpoint https://test808.scm.azurewebsites.net/api/deployments/latest returns malformed data. Retrying... Deployment status endpoint https://test808.scm.azurewebsites.net/api/deployments/latest returns malformed data. Retrying... Deployment status endpoint https://test808.scm.azurewebsites.net/api/deployments/latest returns malformed data. Retrying...

Expected behavior

Zip deploy works correctly by az logicapp extension without 401 error

Environment Summary

{ "azure-cli": "2.49.0", "azure-cli-core": "2.49.0", "azure-cli-telemetry": "1.0.8", "extensions": { "logic": "0.1.6", "logicapp": "0.1.2", "quota": "0.1.0" } }

Additional context

No response

azure-client-tools-bot-prd[bot] commented 1 month ago

Hi @ShingoHanai,

2.49.0 is not the latest Azure CLI(2.61.0).

If you haven't already attempted to do so, please upgrade to the latest Azure CLI version by following https://learn.microsoft.com/en-us/cli/azure/update-azure-cli.

azure-client-tools-bot-prd[bot] commented 1 month ago
Hi @ShingoHanai Find similar issue https://github.com/Azure/azure-cli/issues/10639.
Issue title Unclear what this error means?
Create time 2019-09-25
Comment number 4

Possible solution: The error message "Expecting value: line 1 column 1 (char 0)" indicates that the JSON response from the server is empty or malformed. This can be caused by various reasons such as network issues or server-side errors. One possible solution is to remove the "az logicapp" extension by running the command "az extension remove --name logicapp" and then try the zip deployment again. If the zip deployment works correctly without the extension, then the issue might be related to the extension itself. You can try to reinstall the extension or contact the extension developer for further assistance.


Please confirm if this resolves your issue.

yonzhan commented 1 month ago

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

microsoft-github-policy-service[bot] commented 1 month ago

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