Azure / Azure/azure-cli

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

Open
#29,020 5 comments 0 reactions 2 assignees Claimed by @zhoxing-ms View on GitHub
act-observability-squad Auto-Assign Auto-Resolve bug customer-reported Logic App Possible-Solution Service Attention Similar-Issue
Dominant language
Python
Stars
4.6k
Forks
3.5k
Avg merge
3d 2h
Merged PRs (30d)
60

Description

### 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_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.