Azure / azure-cli

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

az spring connection create redis does not work #27134

Closed anishp55 closed 1 year ago

anishp55 commented 1 year ago

Describe the bug

following the documentation here

https://learn.microsoft.com/en-us/cli/azure/spring/connection/create?view=azure-cli-latest#az-spring-connection-create-redis

the command says it runs successfully, but the portal does not show the new connection.

Related command

az spring connection create redis --resource-group ${RESOURCE_GROUP} --service ${SPRING_APPS_SERVICE} --connection ${CART_SERVICE_CACHE_CONNECTION} --app ${CART_SERVICE_APP} --tg ${RESOURCE_GROUP} --server ${AZURE_CACHE_NAME} --database 0 --client-type java

Errors

no error is returned, just a red 0

Issue script & Debug output

cli.knack.cli: Command arguments: ['spring', 'connection', 'create', 'redis', '--resource-group', 'azure-acme-fitness-useast', '--service', 'asae-acme-fitness-service8', '--connection', 'cart_service_cache', '--app', 'cart-service', '--tg', 'azure-acme-fitness-useast', '--server', 'acme-cache-8', '--database', '0', '--client-type', 'java', '--subscription', 'ManleyAzureSandbox', '--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 0x10d315ea0>, <function OutputProducer.on_global_arguments at 0x10d3c6f80>, <function CLIQuery.on_global_arguments at 0x10d3f8430>] cli.knack.cli: Event: CommandInvoker.OnPreCommandTableCreate [] cli.azure.cli.core: Modules found from index for 'spring': ['azure.cli.command_modules.serviceconnector', 'azext_serviceconnector_passwordless', 'azext_spring'] cli.azure.cli.core: Loading command modules: cli.azure.cli.core: Name Load Time Groups Commands cli.azure.cli.core: serviceconnector 0.476 16 235 cli.azure.cli.core: Total (1) 0.476 16 235 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: serviceconnector-passwordless 0.122 11 16 /Users/anishpatel/.azure/cliextensions/serviceconnector-passwordless cli.azure.cli.core: spring 0.199 39 180 /Users/anishpatel/.azure/cliextensions/spring cli.azure.cli.core: Total (2) 0.321 50 196
cli.azure.cli.core: Loaded 54 groups, 415 commands. cli.azure.cli.core: Found a match in the command table. cli.azure.cli.core: Raw command : spring connection create redis cli.azure.cli.core: Command table: spring connection create redis cli.knack.cli: Event: CommandInvoker.OnPreCommandTableTruncate [<function AzCliLogging.init_command_file_logging at 0x10e07aef0>] cli.azure.cli.core.azlogging: metadata file logging enabled - writing logs to '/Users/anishpatel/.azure/commands/2023-08-09.14-57-10.spring_connection_create_redis.16817.log'. az_command_data_logger: command args: spring connection create redis --resource-group {} --service {} --connection {} --app {} --tg {} --server {} --database {} --client-type {} --subscription {} --debug cli.knack.cli: Event: CommandInvoker.OnPreArgumentLoad [<function register_global_subscription_argument..add_subscription_parameter at 0x10e08b880>] cli.knack.cli: Event: CommandInvoker.OnPostArgumentLoad [] cli.knack.cli: Event: CommandInvoker.OnPostCommandTableCreate [<function register_ids_argument..add_ids_arguments at 0x10e0cd630>, <function register_cache_arguments..add_cache_arguments at 0x10e0cd750>] cli.knack.cli: Event: CommandInvoker.OnCommandTableLoaded [] cli.knack.cli: Event: CommandInvoker.OnPreParseArgs [] cli.knack.cli: Event: CommandInvoker.OnPostParseArgs [<function OutputProducer.handle_output_argument at 0x10d3c7010>, <function CLIQuery.handle_query_parameter at 0x10d3f84c0>, <function register_ids_argument..parse_ids_arguments at 0x10e0cd6c0>] cli.azure.cli.core.azclierror: Traceback (most recent call last): File "/usr/local/Cellar/azure-cli/2.50.0_1/libexec/lib/python3.10/site-packages/knack/invocation.py", line 113, in _validation self._validate_arg_level(parsed_ns) File "/usr/local/Cellar/azure-cli/2.50.0_1/libexec/lib/python3.10/site-packages/azure/cli/core/commands/init.py", line 859, in _validate_arg_level validator(**self._build_kwargs(validator, ns)) File "/usr/local/Cellar/azure-cli/2.50.0_1/libexec/lib/python3.10/site-packages/azure/cli/command_modules/serviceconnector/_validators.py", line 782, in validate_params _validate_and_apply(validate_create_params, apply_create_params) File "/usr/local/Cellar/azure-cli/2.50.0_1/libexec/lib/python3.10/site-packages/azure/cli/command_modules/serviceconnector/_validators.py", line 764, in _validate_and_apply missing_args = validate(cmd, namespace) File "/usr/local/Cellar/azure-cli/2.50.0_1/libexec/lib/python3.10/site-packages/azure/cli/command_modules/serviceconnector/_validators.py", line 555, in validate_create_params missing_args.update(get_missing_auth_args(cmd, namespace)) File "/usr/local/Cellar/azure-cli/2.50.0_1/libexec/lib/python3.10/site-packages/azure/cli/command_modules/serviceconnector/_validators.py", line 460, in get_missing_auth_args default_auth_type = SUPPORTED_AUTH_TYPE.get(source, {}).get(target, {})[0] KeyError: 0

cli.azure.cli.core.azclierror: 0 az_command_data_logger: 0 cli.knack.cli: Event: Cli.PostExecute [<function AzCliLogging.deinit_cmd_metadata_logging at 0x10e07b130>] az_command_data_logger: exit code: 2 cli.main: Command ran in 1.239 seconds (init: 0.331, invoke: 0.907) telemetry.main: Begin splitting cli events and extra events, total events: 1 telemetry.client: Accumulated 0 events. Flush the clients. telemetry.main: Finish splitting cli events and extra events, cli events: 1 telemetry.save: Save telemetry record of length 3624 in cache

Expected behavior

expect to see a redis service connector created for the app.

Environment Summary

az cli | 2.50 account | 0.2.5 application-insights | 0.1.19 serviceconnector-passwordless | 0.3.6 spring | 1.14.0

Additional context

No response

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

Hi @anishp55,

2.50.0 is not the latest Azure CLI(2.51.0).

Please upgrade to the latest Azure CLI version by following https://learn.microsoft.com/en-us/cli/azure/update-azure-cli.

yonzhan commented 1 year ago

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

anishp55 commented 1 year ago

the result is also the same with 2.51. as a note installing 2.51 does not currently seem possible through brew

selvasingh commented 1 year ago

@xfz11 please see

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

Thank you for your feedback. This has been routed to the support team for assistance.

navba-MSFT commented 1 year ago

@anishp55 Apologies for the late reply. Thanks for reaching out to us and reporting this issue. The above PR has been filed which has the fix for this issue.

xfz11 commented 1 year ago

@anishp55 Thanks for your feedback. We are fixing the issue and will release a new version for it. I'll keep you posted when it's ready. For a workaround, you can run az extension remove -n serviceconnector-passwordless to remove the extension temporally.

xfz11 commented 1 year ago

The bug is fixed now. @anishp55 You can update extension to 0.3.8 with az extension add --name serviceconnector-passwordless --upgrade

anishp55 commented 1 year ago

hello @xfz11 we have verified the new release works. thanks