Azure / azure-cli

Azure Command-Line Interface
MIT License
4.03k stars 3.01k forks source link

az functionapp - fails with ModuleNotFoundError: No module named 'ctypes' in SAW #30379

Open JuanP-EscobarZ opened 4 days ago

JuanP-EscobarZ commented 4 days ago

Describe the bug

Not able to use any az functionapp command in my saw, always gets the ModuleNotFoundError: No module named 'ctypes' even after running the az alone in the terminal as the wiki says in the point 2 of the Known Issues section

Related command

az functionapp

Errors

The command failed with an unexpected error. Here is the traceback: No module named 'ctypes' Traceback (most recent call last): File "C:\Users\VssAdministrator\AppData\Local\Temp\pip-target-6cbhvr91\lib\python\knack/cli.py", line 233, in invoke File "D:\a\1\s\build_scripts\windows\artifacts\Python\Lib\site-packages\azure/cli/core/commands/init.py", line 588, in execute File "C:\Users\VssAdministrator\AppData\Local\Temp\pip-target-6cbhvr91\lib\python\knack/parser.py", line 261, in parse_args File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\argparse.py", line 1870, in parse_args File "D:\a\1\s\build_scripts\windows\artifacts\Python\Lib\site-packages\azure/cli/core/parser.py", line 281, in parse_known_args File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\argparse.py", line 1903, in parse_known_args File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\argparse.py", line 2118, in _parse_known_args File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\argparse.py", line 2074, in consume_positionals File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\argparse.py", line 1979, in take_action File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\argparse.py", line 1242, in call File "D:\a\1\s\build_scripts\windows\artifacts\Python\Lib\site-packages\azure/cli/core/parser.py", line 281, in parse_known_args File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\argparse.py", line 1903, in parse_known_args File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\argparse.py", line 2143, in _parse_known_args File "D:\a\1\s\build_scripts\windows\artifacts\Python\Lib\site-packages\azure/cli/core/parser.py", line 157, in error File "D:\a\1\s\build_scripts\windows\artifacts\Python\Lib\site-packages\azure/cli/core/parser.py", line 198, in get_examples File "D:\a\1\s\build_scripts\windows\artifacts\Python\Lib\site-packages\azure/cli/core/_help.py", line 185, in get_examples File "C:\Users\VssAdministrator\AppData\Local\Temp\pip-target-6cbhvr91\lib\python\knack/help.py", line 253, in init File "D:\a\1\s\build_scripts\windows\artifacts\Python\Lib\site-packages\azure/cli/core/_help.py", line 296, in load File "D:\a\1\s\build_scripts\windows\artifacts\Python\Lib\site-packages\azure/cli/core/_help_loaders.py", line 154, in versioned_load File "C:\Users\VssAdministrator\AppData\Local\Temp\pip-target-6cbhvr91\lib\python\knack/help.py", line 198, in load File "C:\Users\VssAdministrator\AppData\Local\Temp\pip-target-6cbhvr91\lib\python\knack/parser.py", line 241, in getattribute File "D:\a\1\s\build_scripts\windows\artifacts\Python\Lib\site-packages\azure/cli/core/commands/command_operation.py", line 133, in description_loader File "D:\a\1\s\build_scripts\windows\artifacts\Python\Lib\site-packages\azure/cli/core/commands/command_operation.py", line 59, in get_op_handler File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\importlib__init.py", line 127, in import_module File "", line 1204, in _gcd_import File "", line 1176, in _find_and_load File "", line 1147, in _find_and_load_unlocked File "", line 690, in _load_unlocked File "", line 940, in exec_module File "", line 241, in _call_with_frames_removed File "D:\a\1\s\build_scripts\windows\artifacts\Python\Lib\site-packages\azure/cli/command_modules/appservice/custom.py", line 23, in File "D:\a\1\s\build_scripts\windows\artifacts\Python\Lib\site-packages\azure/cli/main.py", line 28, in skip_imports File "C:\Users\VssAdministrator\AppData\Local\Temp\pip-target-6cbhvr91\lib\python\invoke/init__.py", line 2, in File "D:\a\1\s\build_scripts\windows\artifacts\Python\Lib\site-packages\azure/cli/main.py", line 28, in skip_imports File "C:\Users\VssAdministrator\AppData\Local\Temp\pip-target-6cbhvr91\lib\python\invoke/collection.py", line 6, in File "D:\a\1\s\build_scripts\windows\artifacts\Python\Lib\site-packages\azure/cli/main.py", line 28, in skip_imports File "C:\Users\VssAdministrator\AppData\Local\Temp\pip-target-6cbhvr91\lib\python\invoke/config.py", line 32, in File "D:\a\1\s\build_scripts\windows\artifacts\Python\Lib\site-packages\azure/cli/main.py", line 28, in skip_imports File "C:\Users\VssAdministrator\AppData\Local\Temp\pip-target-6cbhvr91\lib\python\invoke/runners.py", line 29, in File "D:\a\1\s\build_scripts\windows\artifacts\Python\Lib\site-packages\azure/cli/main.py", line 28, in skip_imports File "C:\Users\VssAdministrator\AppData\Local\Temp\pip-target-6cbhvr91\lib\python\invoke/terminals.py", line 32, in File "D:\a\1\s\build_scripts\windows\artifacts\Python\Lib\site-packages\azure/cli/main.py", line 28, in skip_imports ModuleNotFoundError: No module named 'ctypes'

Issue script & Debug output

cli.knack.cli: Command arguments: ['functionapp', 'deployment', 'source', 'config-zip', '-g', 'metrics', '-n', 'msbmetricsfunctionscp-wu2', '--src', 'C:\Users\juane\Work Folders\Documents\msbmetricsfunctionscp-wu2\function_app.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 0x0000015258F5F560>, <function OutputProducer.on_global_arguments at 0x00000152590E22A0>, <function CLIQuery.on_global_arguments at 0x0000015259117D80>] cli.knack.cli: Event: CommandInvoker.OnPreCommandTableCreate [] cli.azure.cli.core: Modules found from index for 'functionapp': ['azure.cli.command_modules.appservice', 'azure.cli.command_modules.serviceconnector'] cli.azure.cli.core: Loading command modules: cli.azure.cli.core: Name Load Time Groups Commands cli.azure.cli.core: appservice 0.135 73 260 cli.azure.cli.core: serviceconnector 0.021 16 235 cli.azure.cli.core: Total (2) 0.156 89 495 cli.azure.cli.core: Loaded 87 groups, 495 commands. cli.azure.cli.core: Found a match in the command table. cli.azure.cli.core: Raw command : functionapp deployment source config-zip cli.azure.cli.core: Command table: functionapp deploy cli.azure.cli.core: remaining : ent source config-zip cli.knack.cli: Event: CommandInvoker.OnPreCommandTableTruncate [<function AzCliLogging.init_command_file_logging at 0x000001525A8E9EE0>] cli.azure.cli.core.azlogging: metadata file logging enabled - writing logs to 'C:\Users\juane.azure\commands\2024-11-18.12-37-37.functionapp_deployment_source_config-zip.20968.log'. az_command_data_logger: command args: functionapp deployment source config-zip -g {} -n {} --src {} --debug cli.knack.cli: Event: CommandInvoker.OnPreArgumentLoad [<function register_global_subscription_argument..add_subscription_parameter at 0x000001525A91A200>] cli.azure.cli.core.azclierror: Traceback (most recent call last): File "C:\Users\VssAdministrator\AppData\Local\Temp\pip-target-6cbhvr91\lib\python\knack/cli.py", line 233, in invoke File "D:\a\1\s\build_scripts\windows\artifacts\Python\Lib\site-packages\azure/cli/core/commands/init.py", line 561, in execute File "D:\a\1\s\build_scripts\windows\artifacts\Python\Lib\site-packages\azure/cli/core/init.py", line 523, in load_arguments File "D:\a\1\s\build_scripts\windows\artifacts\Python\Lib\site-packages\azure/cli/core/commands/init.py", line 318, in load_arguments File "C:\Users\VssAdministrator\AppData\Local\Temp\pip-target-6cbhvr91\lib\python\knack/commands.py", line 104, in load_arguments File "D:\a\1\s\build_scripts\windows\artifacts\Python\Lib\site-packages\azure/cli/core/commands/command_operation.py", line 125, in arguments_loader File "D:\a\1\s\build_scripts\windows\artifacts\Python\Lib\site-packages\azure/cli/core/commands/command_operation.py", line 59, in get_op_handler File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\importlib__init.py", line 127, in import_module File "", line 1204, in _gcd_import File "", line 1176, in _find_and_load File "", line 1147, in _find_and_load_unlocked File "", line 690, in _load_unlocked File "", line 940, in exec_module File "", line 241, in _call_with_frames_removed File "D:\a\1\s\build_scripts\windows\artifacts\Python\Lib\site-packages\azure/cli/command_modules/appservice/custom.py", line 23, in File "D:\a\1\s\build_scripts\windows\artifacts\Python\Lib\site-packages\azure/cli/main.py", line 28, in skip_imports File "C:\Users\VssAdministrator\AppData\Local\Temp\pip-target-6cbhvr91\lib\python\invoke/init__.py", line 2, in File "D:\a\1\s\build_scripts\windows\artifacts\Python\Lib\site-packages\azure/cli/main.py", line 28, in skip_imports File "C:\Users\VssAdministrator\AppData\Local\Temp\pip-target-6cbhvr91\lib\python\invoke/collection.py", line 6, in File "D:\a\1\s\build_scripts\windows\artifacts\Python\Lib\site-packages\azure/cli/main.py", line 28, in skip_imports File "C:\Users\VssAdministrator\AppData\Local\Temp\pip-target-6cbhvr91\lib\python\invoke/config.py", line 32, in File "D:\a\1\s\build_scripts\windows\artifacts\Python\Lib\site-packages\azure/cli/main.py", line 28, in skip_imports File "C:\Users\VssAdministrator\AppData\Local\Temp\pip-target-6cbhvr91\lib\python\invoke/runners.py", line 29, in File "D:\a\1\s\build_scripts\windows\artifacts\Python\Lib\site-packages\azure/cli/main.py", line 28, in skip_imports File "C:\Users\VssAdministrator\AppData\Local\Temp\pip-target-6cbhvr91\lib\python\invoke/terminals.py", line 32, in File "D:\a\1\s\build_scripts\windows\artifacts\Python\Lib\site-packages\azure/cli/main.py", line 28, in skip_imports ModuleNotFoundError: No module named 'ctypes'

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: No module named 'ctypes' Traceback (most recent call last): File "C:\Users\VssAdministrator\AppData\Local\Temp\pip-target-6cbhvr91\lib\python\knack/cli.py", line 233, in invoke File "D:\a\1\s\build_scripts\windows\artifacts\Python\Lib\site-packages\azure/cli/core/commands/init.py", line 561, in execute File "D:\a\1\s\build_scripts\windows\artifacts\Python\Lib\site-packages\azure/cli/core/init.py", line 523, in load_arguments File "D:\a\1\s\build_scripts\windows\artifacts\Python\Lib\site-packages\azure/cli/core/commands/init.py", line 318, in load_arguments File "C:\Users\VssAdministrator\AppData\Local\Temp\pip-target-6cbhvr91\lib\python\knack/commands.py", line 104, in load_arguments File "D:\a\1\s\build_scripts\windows\artifacts\Python\Lib\site-packages\azure/cli/core/commands/command_operation.py", line 125, in arguments_loader File "D:\a\1\s\build_scripts\windows\artifacts\Python\Lib\site-packages\azure/cli/core/commands/command_operation.py", line 59, in get_op_handler File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\importlib__init.py", line 127, in import_module File "", line 1204, in _gcd_import File "", line 1176, in _find_and_load File "", line 1147, in _find_and_load_unlocked File "", line 690, in _load_unlocked File "", line 940, in exec_module File "", line 241, in _call_with_frames_removed File "D:\a\1\s\build_scripts\windows\artifacts\Python\Lib\site-packages\azure/cli/command_modules/appservice/custom.py", line 23, in File "D:\a\1\s\build_scripts\windows\artifacts\Python\Lib\site-packages\azure/cli/main.py", line 28, in skip_imports File "C:\Users\VssAdministrator\AppData\Local\Temp\pip-target-6cbhvr91\lib\python\invoke/init.py", line 2, in File "D:\a\1\s\build_scripts\windows\artifacts\Python\Lib\site-packages\azure/cli/main.py", line 28, in skip_imports File "C:\Users\VssAdministrator\AppData\Local\Temp\pip-target-6cbhvr91\lib\python\invoke/collection.py", line 6, in File "D:\a\1\s\build_scripts\windows\artifacts\Python\Lib\site-packages\azure/cli/main.py", line 28, in skip_imports File "C:\Users\VssAdministrator\AppData\Local\Temp\pip-target-6cbhvr91\lib\python\invoke/config.py", line 32, in File "D:\a\1\s\build_scripts\windows\artifacts\Python\Lib\site-packages\azure/cli/main.py", line 28, in skip_imports File "C:\Users\VssAdministrator\AppData\Local\Temp\pip-target-6cbhvr91\lib\python\invoke/runners.py", line 29, in File "D:\a\1\s\build_scripts\windows\artifacts\Python\Lib\site-packages\azure/cli/main.py", line 28, in skip_imports File "C:\Users\VssAdministrator\AppData\Local\Temp\pip-target-6cbhvr91\lib\python\invoke/terminals.py", line 32, in File "D:\a\1\s\build_scripts\windows\artifacts\Python\Lib\site-packages\azure/cli/main.py", line 28, in skip_imports ModuleNotFoundError: No module named 'ctypes' az_command_data_logger: No module named 'ctypes' Traceback (most recent call last): File "C:\Users\VssAdministrator\AppData\Local\Temp\pip-target-6cbhvr91\lib\python\knack/cli.py", line 233, in invoke File "D:\a\1\s\build_scripts\windows\artifacts\Python\Lib\site-packages\azure/cli/core/commands/init.py", line 561, in execute File "D:\a\1\s\build_scripts\windows\artifacts\Python\Lib\site-packages\azure/cli/core/init.py", line 523, in load_arguments File "D:\a\1\s\build_scripts\windows\artifacts\Python\Lib\site-packages\azure/cli/core/commands/init.py", line 318, in load_arguments File "C:\Users\VssAdministrator\AppData\Local\Temp\pip-target-6cbhvr91\lib\python\knack/commands.py", line 104, in load_arguments File "D:\a\1\s\build_scripts\windows\artifacts\Python\Lib\site-packages\azure/cli/core/commands/command_operation.py", line 125, in arguments_loader File "D:\a\1\s\build_scripts\windows\artifacts\Python\Lib\site-packages\azure/cli/core/commands/command_operation.py", line 59, in get_op_handler File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\importlib__init__.py", line 127, in import_module File "", line 1204, in _gcd_import File "", line 1176, in _find_and_load File "", line 1147, in _find_and_load_unlocked File "", line 690, in _load_unlocked File "", line 940, in exec_module File "", line 241, in _call_with_frames_removed File "D:\a\1\s\build_scripts\windows\artifacts\Python\Lib\site-packages\azure/cli/command_modules/appservice/custom.py", line 23, in File "D:\a\1\s\build_scripts\windows\artifacts\Python\Lib\site-packages\azure/cli/main.py", line 28, in skip_imports File "C:\Users\VssAdministrator\AppData\Local\Temp\pip-target-6cbhvr91\lib\python\invoke/init.py", line 2, in File "D:\a\1\s\build_scripts\windows\artifacts\Python\Lib\site-packages\azure/cli/main.py", line 28, in skip_imports File "C:\Users\VssAdministrator\AppData\Local\Temp\pip-target-6cbhvr91\lib\python\invoke/collection.py", line 6, in File "D:\a\1\s\build_scripts\windows\artifacts\Python\Lib\site-packages\azure/cli/main.py", line 28, in skip_imports File "C:\Users\VssAdministrator\AppData\Local\Temp\pip-target-6cbhvr91\lib\python\invoke/config.py", line 32, in File "D:\a\1\s\build_scripts\windows\artifacts\Python\Lib\site-packages\azure/cli/main.py", line 28, in skip_imports File "C:\Users\VssAdministrator\AppData\Local\Temp\pip-target-6cbhvr91\lib\python\invoke/runners.py", line 29, in File "D:\a\1\s\build_scripts\windows\artifacts\Python\Lib\site-packages\azure/cli/main.py", line 28, in skip_imports File "C:\Users\VssAdministrator\AppData\Local\Temp\pip-target-6cbhvr91\lib\python\invoke/terminals.py", line 32, in File "D:\a\1\s\build_scripts\windows\artifacts\Python\Lib\site-packages\azure/cli/main__.py", line 28, in skip_imports ModuleNotFoundError: No module named 'ctypes' To check existing issues, please visit: https://github.com/Azure/azure-cli/issues cli.knack.cli: Event: Cli.PostExecute [<function AzCliLogging.deinit_cmd_metadata_logging at 0x000001525A8EA160>] az_command_data_logger: exit code: 1 cli.main: Command ran in 0.503 seconds (init: 0.215, invoke: 0.288)

Expected behavior

az functionapp should allow to manage azure function apps

Environment Summary

azure-cli v2.55.0

Additional context

No response

microsoft-github-policy-service[bot] commented 4 days ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @AnatoliB, @Francisco-Gamino, @shreyabatra4.

yonzhan commented 4 days ago

route to service team