Azure / azure-cli-extensions

Public Repository for Extensions of Azure CLI.
https://docs.microsoft.com/en-us/cli/azure
MIT License
379 stars 1.19k forks source link

Unable to deploy Azure Logic App (ZIP deploy) #4064

Closed Kalyan-D closed 2 years ago

Kalyan-D commented 2 years ago

This is autogenerated. Please review and update as needed.

Describe the bug

Command Name az logicapp deployment source config-zip Extension Name: logicapp. Version: 0.1.2.

Errors:

The command failed with an unexpected error. Here is the traceback:
Expecting value: line 1 column 1 (char 0)
Traceback (most recent call last):
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\knack/cli.py", line 231, in invoke
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 657, in execute
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 720, in _run_jobs_serially
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 691, in _run_job
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 328, in __call__
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/command_operation.py", line 121, in handler
  File "C:\Users\kd2204\.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\kd2204\.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\kd2204\.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\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/appservice/utils.py", line 75, in call
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/appservice/utils.py", line 71, in call
  File "C:\Users\kd2204\.azure\cliextensions\logicapp\azext_logicapp\custom.py", line 1416, in _get_app_settings_from_scm
    return response.json() or {}
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\requests/models.py", line 900, in json
  File "json\__init__.py", line 357, 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)

To Reproduce:

Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.

Expected Behavior

Environment Summary

Windows-10-10.0.19041-SP0
Python 3.8.9
Installer: MSI

azure-cli 2.27.2 *

Extensions:
logicapp 0.1.2

Additional Context

ghost commented 2 years ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @Azure/azure-logicapps-team.

Issue Details
### **This is autogenerated. Please review and update as needed.** ## Describe the bug **Command Name** `az logicapp deployment source config-zip Extension Name: logicapp. Version: 0.1.2.` **Errors:** ``` The command failed with an unexpected error. Here is the traceback: Expecting value: line 1 column 1 (char 0) Traceback (most recent call last): File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\knack/cli.py", line 231, in invoke File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 657, in execute File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 720, in _run_jobs_serially File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 691, in _run_job File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 328, in __call__ File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/command_operation.py", line 121, in handler File "C:\Users\kd2204\.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\kd2204\.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\kd2204\.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\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/appservice/utils.py", line 75, in call File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/appservice/utils.py", line 71, in call File "C:\Users\kd2204\.azure\cliextensions\logicapp\azext_logicapp\custom.py", line 1416, in _get_app_settings_from_scm return response.json() or {} File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\requests/models.py", line 900, in json File "json\__init__.py", line 357, 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) ``` ## 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 logicapp deployment source config-zip --name {} --resource-group {} --subscription {} --src {}` ## Expected Behavior ## Environment Summary ``` Windows-10-10.0.19041-SP0 Python 3.8.9 Installer: MSI azure-cli 2.27.2 * Extensions: logicapp 0.1.2 ``` ## Additional Context
Author: Kalyan-D
Assignees: -
Labels: `customer-reported`, `Logic App`, `Service Attention`
Milestone: -
yonzhan commented 2 years ago

route to service team

DevArjun23 commented 2 years ago

@Kalyan-D Is your logicapp in Azure Arc or is it non Arc?

DevArjun23 commented 2 years ago

@Kalyan-D can you share the output of your deploy command with "--debug" parameter?

ahmedsza commented 2 years ago

hitting a similar issue output from debug

cli.knack.cli: Command arguments: ['logicapp', 'deployment', 'source', 'config-zip', '--name', 'ahmslogicappstd', '--resource-group', 'logicappstd', '--subscription', 'subid, '--src', 'Draft.zip', '--debug'] cli.knack.cli: init debug log: Enable color in terminal. cli.knack.cli: Event: Cli.PreExecute [] cli.knack.cli: Event: CommandParser.OnGlobalArgumentsCreate [<function CLILogging.on_global_arguments at 0x038F6190>, <function OutputProducer.on_global_arguments at 0x03CA1028>, <function CLIQuery.on_global_arguments at 0x03CBABF8>] cli.knack.cli: Event: CommandInvoker.OnPreCommandTableCreate [] cli.azure.cli.core: Modules found from index for 'logicapp': ['azext_logicapp'] cli.azure.cli.core: Loading command modules: cli.azure.cli.core: Name Load Time Groups Commands cli.azure.cli.core: Total (0) 0.000 0 0 cli.azure.cli.core: These extensions are not installed and will be skipped: ['azext_ai_examples', 'azext_next'] cli.azure.cli.core: Loading extensions: cli.azure.cli.core: Name Load Time Groups Commands Directory cli.azure.cli.core: logicapp 0.362 5 13 C:\Users\ahmeds.azure\cliextensions\logicapp cli.azure.cli.core: Total (1) 0.362 5 13 cli.azure.cli.core: Loaded 5 groups, 13 commands. cli.azure.cli.core: Found a match in the command table. cli.azure.cli.core: Raw command : logicapp deployment source config-zip cli.azure.cli.core: Command table: logicapp deployment source config-zip cli.knack.cli: Event: CommandInvoker.OnPreCommandTableTruncate [<function AzCliLogging.init_command_file_logging at 0x040240B8>] cli.knack.cli: Event: CommandInvoker.OnPreArgumentLoad [<function register_global_subscription_argument..add_subscription_parameter at 0x040693D0>, <function register_global_query_examples_argument..register_query_examples at 0x04082A90>] cli.knack.cli: Event: CommandInvoker.OnPostArgumentLoad [] cli.knack.cli: Event: CommandInvoker.OnPostCommandTableCreate [<function register_ids_argument..add_ids_arguments at 0x04082AD8>, <function register_cache_arguments..add_cache_arguments at 0x04082B68>] cli.knack.cli: Event: CommandInvoker.OnCommandTableLoaded [] cli.knack.cli: Event: CommandInvoker.OnPreParseArgs [] cli.knack.cli: Event: CommandInvoker.OnPostParseArgs [<function OutputProducer.handle_output_argument at 0x03CA1070>, <function CLIQuery.handle_query_parameter at 0x03CBAC40>, <function register_global_query_examples_argument..handle_example_parameter at 0x04069460>, <function register_ids_argument..parse_ids_arguments at 0x04082B20>] cli.azure.cli.core.util: azure.cli.core.util.handle_exception is called with an exception: cli.azure.cli.core.util: Traceback (most recent call last): File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\knack/cli.py", line 231, in invoke File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 657, in execute File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 720, in _run_jobs_serially File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 691, in _run_job File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 328, in call File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/command_operation.py", line 121, in handler File "C:\Users\ahmeds.azure\cliextensions\logicapp\azext_logicapp\custom.py", line 1534, in enable_zip_deploy_functionapp notify_if_upgrade_available() File "C:\Users\ahmeds.azure\cliextensions\logicapp\azext_logicapp\custom.py", line 1767, in notify_if_upgrade_available new_version = is_new_version_available() File "C:\Users\ahmeds.azure\cliextensions\logicapp\azext_logicapp\custom.py", line 1752, in is_new_version_available current_version = json.loads(os.popen('az version').read())['extensions']['logicapp'] File "json__init__.py", line 357, 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\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\knack/cli.py", line 231, in invoke File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 657, in execute File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 720, in _run_jobs_serially File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 691, in _run_job File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 328, in call File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/command_operation.py", line 121, in handler File "C:\Users\ahmeds.azure\cliextensions\logicapp\azext_logicapp\custom.py", line 1534, in enable_zip_deploy_functionapp notify_if_upgrade_available() File "C:\Users\ahmeds.azure\cliextensions\logicapp\azext_logicapp\custom.py", line 1767, in notify_if_upgrade_available new_version = is_new_version_available() File "C:\Users\ahmeds.azure\cliextensions\logicapp\azext_logicapp\custom.py", line 1752, in is_new_version_available current_version = json.loads(os.popen('az version').read())['extensions']['logicapp'] File "json__init.py", line 357, 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\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\knack/cli.py", line 231, in invoke File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 657, in execute File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 720, in _run_jobs_serially File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 691, in _run_job File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 328, in call File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/command_operation.py", line 121, in handler File "C:\Users\ahmeds.azure\cliextensions\logicapp\azext_logicapp\custom.py", line 1534, in enable_zip_deploy_functionapp notify_if_upgrade_available() File "C:\Users\ahmeds.azure\cliextensions\logicapp\azext_logicapp\custom.py", line 1767, in notify_if_upgrade_available new_version = is_new_version_available() File "C:\Users\ahmeds.azure\cliextensions\logicapp\azext_logicapp\custom.py", line 1752, in is_new_version_available current_version = json.loads(os.popen('az version').read())['extensions']['logicapp'] File "json\init.py", line 357, 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) To open an issue, please run: 'az feedback' cli.knack.cli: Event: Cli.PostExecute [<function AzCliLogging.deinit_cmd_metadata_logging at 0x040241D8>] cli.main__: Command ran in 3.030 seconds (init: 0.539, invoke: 2.491)

DevArjun23 commented 2 years ago

@ahmedsza if you execute az version what does it show?

ahmedsza commented 2 years ago

azure-cli 2.30.0

core 2.30.0 telemetry 1.0.6

Extensions: aks-preview 0.5.42 aks-virtual-node 0.2.0 application-insights 0.1.14 azure-devops 0.20.0 azure-firewall 0.12.0 connectedk8s 1.1.10 db-up 0.2.5 dev-spaces 1.0.6 dev-spaces-preview 0.1.6 interactive 0.4.5 k8s-extension 0.7.0 k8sconfiguration 0.2.4 logicapp 0.1.2 notification-hub 0.2.0 resource-graph 2.1.0 spring-cloud 2.8.0

Python location 'C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\python.exe' Extensions directory 'C:\Users\ahmeds.azure\cliextensions'

Python (Windows) 3.8.9 (tags/v3.8.9:a743f81, Apr 6 2021, 13:22:56) [MSC v.1928 32 bit (Intel)]

ahmedsza commented 2 years ago

I tried az functionapp deployment source config-zip --name ahmslogicappstd --resource-group logicappstd --subscription XXXXX --src Draft.zip

and that seems to work. did not test a lot but seems to work..

DevArjun23 commented 2 years ago

Where are you running the command? I was expecting the output in the form on JSON.

ahmedsza commented 2 years ago

here is the output in json format. I might have set my default output for az cli to table at some point

{ "azure-cli": "2.30.0", "azure-cli-core": "2.30.0", "azure-cli-telemetry": "1.0.6", "extensions": { "aks-preview": "0.5.42", "aks-virtual-node": "0.2.0", "application-insights": "0.1.14", "azure-devops": "0.20.0", "azure-firewall": "0.12.0", "connectedk8s": "1.1.10", "db-up": "0.2.5", "dev-spaces": "1.0.6", "dev-spaces-preview": "0.1.6", "interactive": "0.4.5", "k8s-extension": "0.7.0", "k8sconfiguration": "0.2.4", "logicapp": "0.1.2", "notification-hub": "0.2.0", "resource-graph": "2.1.0", "spring-cloud": "2.8.0" } }

DevArjun23 commented 2 years ago

Do you still face the issue if you set your default output to json instead of table?

ahmedsza commented 2 years ago

That fixed it - setting the default to json with az config set core.output=json

I would however have expected that it should have worked with table (everything else seems too)

DevArjun23 commented 2 years ago

You are right, it should have worked. I will log a bug to get it fixed in the next release.