Skip to content

az aks approuting enable with aks-preview command failed #31346

@robertwmcavoy

Description

@robertwmcavoy

Describe the bug

Attempting to enable the app routing system in AKS using Azure CLI, specifically using an "Internal" nginx ingress. Base AzCLI command does not include the --nginx parameter. "az extension add --name aks-preview" used to install the AzCLI aks-preview module for the --nginx parameter.

The base "az aks approuting enable" works without the "aks-preview" extension added into AzCLI.

Related command

az extension add --name aks-preview
az aks approuting enable --resource-group <> --name <>
az aks approuting enable --resource-group <> --name <> --nginx Internal

az aks approuting enable seems to fail both from cloudshell and another host with Azure CLI installed, including both with the --nginx parameter added, and without.

Errors

The command failed with an unexpected error. Here is the traceback:
'NoneType' object has no attribute 'dict'
Traceback (most recent call last):
File "/opt/az/lib/python3.12/site-packages/knack/cli.py", line 233, in invoke
cmd_result = self.invocation.execute(args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/az/lib/python3.12/site-packages/azure/cli/core/commands/init.py", line 564, in execute
self.commands_loader.load_arguments(command)
File "/opt/az/lib/python3.12/site-packages/azure/cli/core/init.py", line 549, in load_arguments
loader.load_arguments(command) # this adds entries to the argument registries
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/myuser/.azure/cliextensions/aks-preview/azext_aks_preview/init.py", line 45, in load_arguments
load_arguments(self, command)
File "/home/myuser/.azure/cliextensions/aks-preview/azext_aks_preview/_params.py", line 429, in load_arguments
k8s_support_plans = self.get_models(
^^^^^^^^^^^^^^^^
File "/opt/az/lib/python3.12/site-packages/azure/cli/core/init.py", line 804, in get_models
return get_sdk(self.cli_ctx, resource_type, *attr_args, mod='models', operation_group=operation_group)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/az/lib/python3.12/site-packages/azure/cli/core/profiles/init.py", line 91, in get_sdk
return _sdk_get_versioned_sdk(cli_ctx.cloud.profile, resource_type, *attr_args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/az/lib/python3.12/site-packages/azure/cli/core/profiles/_shared.py", line 692, in get_versioned_sdk
sdk_path = get_versioned_sdk_path(api_profile, resource_type, operation_group)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/az/lib/python3.12/site-packages/azure/cli/core/profiles/_shared.py", line 684, in get_versioned_sdk_path
api_version = getattr(api_version, operation_group)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/az/lib/python3.12/site-packages/azure/cli/core/profiles/_shared.py", line 479, in getattr
self._resolve()
File "/opt/az/lib/python3.12/site-packages/azure/cli/core/profiles/_shared.py", line 466, in _resolve
for operation_group_name, operation_type in self._client_type.dict.items():
^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'dict'. Did you mean: 'dir'?

Issue script & Debug output

az aks approuting enable --resource-group <> --name <> --debug
cli.knack.cli: Command arguments: ['aks', 'approuting', 'enable', '--resource-group', '<>', '--name', '<>', '--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 0x7f0b262bf7e0>, <function OutputProducer.on_global_arguments at 0x7f0b260127a0>, <function CLIQuery.on_global_arguments at 0x7f0b26057ce0>]
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableCreate []
cli.azure.cli.core: Command index version or cloud profile is invalid or doesn't match the current command.
cli.azure.cli.core: Command index has been invalidated.
cli.azure.cli.core: No module found from index for '['aks', 'approuting', 'enable', '--resource-group', '<>', '--name', '<>', '--debug']'
cli.azure.cli.core: Loading all modules and extensions
cli.azure.cli.core: Discovered command modules: ['acr', 'acs', 'advisor', 'ams', 'apim', 'appconfig', 'appservice', 'aro', 'backup', 'batch', 'batchai', 'billing', 'botservice', 'cdn', 'cloud', 'cognitiveservices', 'compute_recommender', 'computefleet', 'config', 'configure', 'consumption', 'container', 'containerapp', 'cosmosdb', 'databoxedge', 'dls', 'dms', 'eventgrid', 'eventhubs', 'extension', 'feedback', 'find', 'hdinsight', 'identity', 'interactive', 'iot', 'keyvault', 'lab', 'managedservices', 'maps', 'marketplaceordering', 'monitor', 'mysql', 'netappfiles', 'network', 'policyinsights', 'privatedns', 'profile', 'rdbms', 'redis', 'relay', 'resource', 'role', 'search', 'security', 'servicebus', 'serviceconnector', 'servicefabric', 'signalr', 'sql', 'sqlvm', 'storage', 'synapse', 'util', 'vm']
cli.azure.cli.core: Loading command modules:
cli.azure.cli.core: Name Load Time Groups Commands
cli.azure.cli.core: acr 0.114 36 149
cli.azure.cli.core: acs 0.012 15 79
cli.azure.cli.core: advisor 0.001 3 6
cli.azure.cli.core: ams 0.003 22 100
cli.azure.cli.core: apim 0.003 14 69
cli.azure.cli.core: appconfig 0.002 9 47
cli.azure.cli.core: appservice 0.014 80 277
cli.azure.cli.core: aro 0.005 1 10
cli.azure.cli.core: backup 0.002 16 60
cli.azure.cli.core: batch 0.042 32 96
cli.azure.cli.core: batchai 0.002 10 30
cli.azure.cli.core: billing 0.007 19 52
cli.azure.cli.core: botservice 0.002 12 42
cli.azure.cli.core: cdn 0.091 8 50
cli.azure.cli.core: cloud 0.001 1 7
cli.azure.cli.core: cognitiveservices 0.001 10 33
cli.azure.cli.core: compute_recommender 0.001 1 1
cli.azure.cli.core: computefleet 0.005 1 1
cli.azure.cli.core: config 0.001 2 7
cli.azure.cli.core: configure 0.001 2 5
cli.azure.cli.core: consumption 0.009 8 9
cli.azure.cli.core: container 0.005 2 17
cli.azure.cli.core: containerapp 0.060 37 123
cli.azure.cli.core: cosmosdb 0.008 58 200
cli.azure.cli.core: databoxedge 0.004 5 28
cli.azure.cli.core: dls 0.001 6 36
cli.azure.cli.core: dms 0.001 3 22
cli.azure.cli.core: eventgrid 0.003 25 96
cli.azure.cli.core: eventhubs 0.005 13 20
cli.azure.cli.core: extension 0.001 1 7
cli.azure.cli.core: feedback 0.000 1 2
cli.azure.cli.core: find 0.000 1 1
cli.azure.cli.core: hdinsight 0.003 9 42
cli.azure.cli.core: identity 0.001 2 11
cli.azure.cli.core: interactive 0.000 1 1
cli.azure.cli.core: iot 0.053 19 82
cli.azure.cli.core: keyvault 0.005 20 113
cli.azure.cli.core: lab 0.050 9 30
cli.azure.cli.core: managedservices 0.005 3 8
cli.azure.cli.core: maps 0.001 5 13
cli.azure.cli.core: marketplaceordering 0.001 1 2
cli.azure.cli.core: monitor 0.325 18 61
cli.azure.cli.core: mysql 0.046 16 56
cli.azure.cli.core: netappfiles 0.025 8 17
cli.azure.cli.core: network 0.082 104 345
cli.azure.cli.core: policyinsights 0.006 9 17
cli.azure.cli.core: privatedns 0.011 14 60
cli.azure.cli.core: profile 0.001 2 8
cli.azure.cli.core: rdbms 0.125 53 223
cli.azure.cli.core: redis 0.001 7 38
cli.azure.cli.core: relay 0.012 7 8
cli.azure.cli.core: resource 0.009 52 232
cli.azure.cli.core: role 0.003 17 62
cli.azure.cli.core: search 0.005 7 19
cli.azure.cli.core: security 0.009 48 98
cli.azure.cli.core: servicebus 0.007 14 17
cli.azure.cli.core: serviceconnector 0.041 20 323
cli.azure.cli.core: servicefabric 0.008 27 80
cli.azure.cli.core: signalr 0.002 10 42
cli.azure.cli.core: sql 0.008 56 215
cli.azure.cli.core: sqlvm 0.014 4 20
cli.azure.cli.core: storage 0.035 60 275
cli.azure.cli.core: synapse 0.008 54 246
cli.azure.cli.core: util 0.001 3 7
cli.azure.cli.core: vm 0.057 59 219
cli.azure.cli.core: Total (65) 1.365 1192 4672
cli.azure.cli.core: Loading extensions:
cli.azure.cli.core: Name Load Time Groups Commands Directory
cli.knack.cli: Event: CommandLoader.OnLoadCommandTable []
cli.azure.cli.core: aks-preview 0.006 22 103 /home/<>/.azure/cliextensions/aks-preview
cli.azure.cli.core: Total (1) 0.006 22 103
cli.azure.cli.core: Loaded 1187 groups, 4707 commands.
cli.azure.cli.core: Updated command index in 0.003 seconds.
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableTruncate [<function AzCliLogging.init_command_file_logging at 0x7f0b251b4220>]
cli.azure.cli.core.azlogging: metadata file logging enabled - writing logs to '/home/<>/.azure/commands/2025-04-24.14-14-47.aks_approuting_enable.231470.log'.
az_command_data_logger: command args: aks approuting enable --resource-group {} --name {} --debug
cli.knack.cli: Event: CommandInvoker.OnPreArgumentLoad [<function register_global_subscription_argument..add_subscription_parameter at 0x7f0b2520c720>]
cli.knack.cli: Event: CommandLoader.OnLoadArguments []
cli.azure.cli.core.profiles._shared: Traceback (most recent call last):
File "/opt/az/lib/python3.12/site-packages/azure/cli/core/profiles/_shared.py", line 653, in _get_attr
op = import_module(full_mod_path)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/az/lib/python3.12/importlib/init.py", line 90, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 1387, in _gcd_import
File "", line 1360, in _find_and_load
File "", line 1331, in _find_and_load_unlocked
File "", line 935, in _load_unlocked
File "", line 999, in exec_module
File "", line 488, in _call_with_frames_removed
File "/home/<>/.azure/cliextensions/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/init.py", line 9, in
from ._container_service_client import ContainerServiceClient
File "/home/<>/.azure/cliextensions/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/_container_service_client.py", line 19, in
from azure.mgmt.core.tools import get_arm_endpoints
ImportError: cannot import name 'get_arm_endpoints' from 'azure.mgmt.core.tools' (/opt/az/lib/python3.12/site-packages/azure/mgmt/core/tools.py)

cli.azure.cli.core.azclierror: Traceback (most recent call last):
File "/opt/az/lib/python3.12/site-packages/knack/cli.py", line 233, in invoke
cmd_result = self.invocation.execute(args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/az/lib/python3.12/site-packages/azure/cli/core/commands/init.py", line 564, in execute
self.commands_loader.load_arguments(command)
File "/opt/az/lib/python3.12/site-packages/azure/cli/core/init.py", line 549, in load_arguments
loader.load_arguments(command) # this adds entries to the argument registries
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/<>/.azure/cliextensions/aks-preview/azext_aks_preview/init.py", line 45, in load_arguments
load_arguments(self, command)
File "/home/<>/.azure/cliextensions/aks-preview/azext_aks_preview/_params.py", line 429, in load_arguments
k8s_support_plans = self.get_models(
^^^^^^^^^^^^^^^^
File "/opt/az/lib/python3.12/site-packages/azure/cli/core/init.py", line 804, in get_models
return get_sdk(self.cli_ctx, resource_type, *attr_args, mod='models', operation_group=operation_group)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/az/lib/python3.12/site-packages/azure/cli/core/profiles/init.py", line 91, in get_sdk
return _sdk_get_versioned_sdk(cli_ctx.cloud.profile, resource_type, *attr_args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/az/lib/python3.12/site-packages/azure/cli/core/profiles/_shared.py", line 692, in get_versioned_sdk
sdk_path = get_versioned_sdk_path(api_profile, resource_type, operation_group)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/az/lib/python3.12/site-packages/azure/cli/core/profiles/_shared.py", line 684, in get_versioned_sdk_path
api_version = getattr(api_version, operation_group)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/az/lib/python3.12/site-packages/azure/cli/core/profiles/_shared.py", line 479, in getattr
self._resolve()
File "/opt/az/lib/python3.12/site-packages/azure/cli/core/profiles/_shared.py", line 466, in _resolve
for operation_group_name, operation_type in self._client_type.dict.items():
^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'dict'. Did you mean: 'dir'?

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: 'NoneType' object has no attribute 'dict'
Traceback (most recent call last):
File "/opt/az/lib/python3.12/site-packages/knack/cli.py", line 233, in invoke
cmd_result = self.invocation.execute(args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/az/lib/python3.12/site-packages/azure/cli/core/commands/init.py", line 564, in execute
self.commands_loader.load_arguments(command)
File "/opt/az/lib/python3.12/site-packages/azure/cli/core/init.py", line 549, in load_arguments
loader.load_arguments(command) # this adds entries to the argument registries
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/<>/.azure/cliextensions/aks-preview/azext_aks_preview/init.py", line 45, in load_arguments
load_arguments(self, command)
File "/home/<>/.azure/cliextensions/aks-preview/azext_aks_preview/_params.py", line 429, in load_arguments
k8s_support_plans = self.get_models(
^^^^^^^^^^^^^^^^
File "/opt/az/lib/python3.12/site-packages/azure/cli/core/init.py", line 804, in get_models
return get_sdk(self.cli_ctx, resource_type, *attr_args, mod='models', operation_group=operation_group)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/az/lib/python3.12/site-packages/azure/cli/core/profiles/init.py", line 91, in get_sdk
return _sdk_get_versioned_sdk(cli_ctx.cloud.profile, resource_type, *attr_args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/az/lib/python3.12/site-packages/azure/cli/core/profiles/_shared.py", line 692, in get_versioned_sdk
sdk_path = get_versioned_sdk_path(api_profile, resource_type, operation_group)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/az/lib/python3.12/site-packages/azure/cli/core/profiles/_shared.py", line 684, in get_versioned_sdk_path
api_version = getattr(api_version, operation_group)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/az/lib/python3.12/site-packages/azure/cli/core/profiles/_shared.py", line 479, in getattr
self._resolve()
File "/opt/az/lib/python3.12/site-packages/azure/cli/core/profiles/_shared.py", line 466, in _resolve
for operation_group_name, operation_type in self._client_type.dict.items():
^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'dict'. Did you mean: 'dir'?
az_command_data_logger: 'NoneType' object has no attribute 'dict'
Traceback (most recent call last):
File "/opt/az/lib/python3.12/site-packages/knack/cli.py", line 233, in invoke
cmd_result = self.invocation.execute(args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/az/lib/python3.12/site-packages/azure/cli/core/commands/init.py", line 564, in execute
self.commands_loader.load_arguments(command)
File "/opt/az/lib/python3.12/site-packages/azure/cli/core/init.py", line 549, in load_arguments
loader.load_arguments(command) # this adds entries to the argument registries
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/<>/.azure/cliextensions/aks-preview/azext_aks_preview/init.py", line 45, in load_arguments
load_arguments(self, command)
File "/home/<>/.azure/cliextensions/aks-preview/azext_aks_preview/_params.py", line 429, in load_arguments
k8s_support_plans = self.get_models(
^^^^^^^^^^^^^^^^
File "/opt/az/lib/python3.12/site-packages/azure/cli/core/init.py", line 804, in get_models
return get_sdk(self.cli_ctx, resource_type, *attr_args, mod='models', operation_group=operation_group)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/az/lib/python3.12/site-packages/azure/cli/core/profiles/init.py", line 91, in get_sdk
return _sdk_get_versioned_sdk(cli_ctx.cloud.profile, resource_type, *attr_args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/az/lib/python3.12/site-packages/azure/cli/core/profiles/_shared.py", line 692, in get_versioned_sdk
sdk_path = get_versioned_sdk_path(api_profile, resource_type, operation_group)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/az/lib/python3.12/site-packages/azure/cli/core/profiles/_shared.py", line 684, in get_versioned_sdk_path
api_version = getattr(api_version, operation_group)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/az/lib/python3.12/site-packages/azure/cli/core/profiles/_shared.py", line 479, in getattr
self._resolve()
File "/opt/az/lib/python3.12/site-packages/azure/cli/core/profiles/_shared.py", line 466, in _resolve
for operation_group_name, operation_type in self._client_type.dict.items():
^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'dict'. Did you mean: 'dir'?
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 0x7f0b251b44a0>]
az_command_data_logger: exit code: 1
cli.main: Command ran in 1.720 seconds (init: 0.109, invoke: 1.610)
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 7930 in cache file under /home/<>/.azure/telemetry/20250424141447266
telemetry.main: Begin creating telemetry upload process.
telemetry.process: Creating upload process: "/opt/az/bin/python3 /opt/az/lib/python3.12/site-packages/azure/cli/telemetry/init.py /home/<>/.azure /home/<>/.azure/telemetry/20250424141447266"
telemetry.process: Return from creating process 231502
telemetry.main: Finish creating telemetry upload process.

Expected behavior

Expecting Azure to deploy Internal nginx load balancer along with the AKS CRD's for app-routing-system including its namespace.

Environment Summary

azure-cli 2.71.0

core 2.71.0
telemetry 1.1.0

Extensions:
aks-preview 14.0.0b4

Dependencies:
msal 1.31.2b1
azure-mgmt-resource 23.1.1

Python location '/opt/az/bin/python3'
Config directory '/home/<>/.azure'
Extensions directory '/home/<>/.azure/cliextensions'

Python (Linux) 3.12.8 (main, Mar 25 2025, 10:55:23) [GCC 13.3.0]

Legal docs and information: aka.ms/AzureCliLegal

Your CLI is up-to-date.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    AKSaz aks/acs/openshiftAuto-AssignAuto assign by botService AttentionThis issue is responsible by Azure service team.bugThis issue requires a change to an existing behavior in the product in order to be resolved.customer-reportedIssues that are reported by GitHub users external to the Azure organization.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions