azure-cli icon indicating copy to clipboard operation
azure-cli copied to clipboard

Missing `--ssh-access disabled` in `az aks update`

Open JoeyC-Dev opened this issue 2 years ago • 8 comments

Describe the bug

In the official document, there is a statement to disable ssh by default for new nodepools: Image Src: https://learn.microsoft.com/en-us/azure/aks/manage-ssh-node-access#disable-ssh-on-an-existing-cluster

But it is missing in the az-cli in current version. Can you confirm is it document bug or az-cli issue?

Related command

az aks update --ssh-access disabled

Errors

az aks update -n ${aks} -g ${rG} --ssh-access disabled 
unrecognized arguments: --ssh-access disabled

Issue script & Debug output

az aks update -n ${aks} -g ${rG} --ssh-access disabled --debug
cli.knack.cli: Command arguments: ['aks', 'update', '-n', 'aks', '-g', 'aks', '--ssh-access', 'disabled', '--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 0x7fa0fc7c91f0>, <function OutputProducer.on_global_arguments at 0x7fa0fc68ab80>, <function CLIQuery.on_global_arguments at 0x7fa0fc624160>]
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableCreate []
cli.azure.cli.core: Modules found from index for 'aks': ['azext_aks_preview', 'azure.cli.command_modules.acs', '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: acs                       0.049        14        77
cli.azure.cli.core: serviceconnector          0.104        20       309
cli.azure.cli.core: Total (2)                 0.153        34       386
cli.azure.cli.core: These extensions are not installed and will be skipped: ['azext_next']
cli.azure.cli.core: Loading extensions:
cli.azure.cli.core: Name                  Load Time    Groups  Commands  Directory
cli.azure.cli.core: ai-examples               0.142         1         1  /usr/lib/python3.9/site-packages/azure-cli-extensions/ai-examples
cli.knack.cli: Event: CommandLoader.OnLoadCommandTable []
cli.azure.cli.core: aks-preview               0.008        21        95  /home/joey/.azure/cliextensions/aks-preview
cli.azure.cli.core: Total (2)                 0.150        22        96  
cli.azure.cli.core: Loaded 43 groups, 416 commands.
cli.azure.cli.core: Found a match in the command table.
cli.azure.cli.core: Raw command  : aks update
cli.azure.cli.core: Command table: aks update
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableTruncate [<function AzCliLogging.init_command_file_logging at 0x7fa0fba81790>]
cli.azure.cli.core.azlogging: metadata file logging enabled - writing logs to '/home/joey/.azure/commands/2024-10-14.03-27-32.aks_update.2677.log'.
az_command_data_logger: command args: aks update -n {} -g {} --ssh-access {} --debug
cli.knack.cli: Event: CommandInvoker.OnPreArgumentLoad [<function register_global_subscription_argument.<locals>.add_subscription_parameter at 0x7fa0fbaab4c0>]
cli.knack.cli: Event: CommandLoader.OnLoadArguments []
cli.knack.cli: Event: CommandInvoker.OnPostArgumentLoad []
cli.knack.cli: Event: CommandInvoker.OnPostCommandTableCreate [<function register_ids_argument.<locals>.add_ids_arguments at 0x7fa0fba504c0>, <function register_cache_arguments.<locals>.add_cache_arguments at 0x7fa0fba6e3a0>, <function register_upcoming_breaking_change_info.<locals>.update_breaking_change_info at 0x7fa0fba6e430>]
cli.knack.cli: Event: CommandInvoker.OnCommandTableLoaded []
cli.knack.cli: Event: CommandInvoker.OnPreParseArgs []
cli.azure.cli.core.command_recommender: "--ssh-access" is an invalid parameter for command "aks update".
urllib3.connectionpool: Starting new HTTPS connection (1): app.aladdin.microsoft.com:443
urllib3.connectionpool: https://app.aladdin.microsoft.com:443 "GET /api/v1.0/suggestions?query=%7B%22command%22%3A+%22aks+update%22%2C+%22parameters%22%3A+%22%22%7D&clientType=AzureCli&context=%7B%22versionNumber%22%3A+%222.65.0%22%2C+%22errorType%22%3A+%22UnrecognizedArguments%22%2C+%22correlationId%22%3A+%22092007db-171a-4b54-aa67-e0581b935e30%22%2C+%22subscriptionId%22%3A+%2250c2e135-4f3e-4840-ae8c-610d7b5dc9f7%22%2C+%22eventId%22%3A+%221953ad55-7561-4f9d-ae6b-1b31a0544310%22%7D HTTP/1.1" 200 None
cli.azure.cli.core.command_recommender: "--ssh-access" is an invalid parameter for command "aks update".
cli.azure.cli.core.azclierror: NoneType: None

cli.azure.cli.core.azclierror: unrecognized arguments: --ssh-access disabled
az_command_data_logger: unrecognized arguments: --ssh-access disabled

Expected behavior

The argument should exists, or fix the document instead.

Environment Summary

azure-cli                         2.65.0

core                              2.65.0
telemetry                          1.1.0

Extensions:
ai-examples                        0.2.5
aks-preview                      9.0.0b6
ml                                2.30.1
ssh                                2.0.5

Dependencies:
msal                              1.31.0
azure-mgmt-resource               23.1.1

Python location '/usr/bin/python3.9'
Extensions directory '/home/joey/.azure/cliextensions'
Extensions system directory '/usr/lib/python3.9/site-packages/azure-cli-extensions'

Python (Linux) 3.9.19 (main, Aug 23 2024, 00:07:48) 
[GCC 11.2.0]

Legal docs and information: aka.ms/AzureCliLegal


Your CLI is up-to-date.

Additional context

No response

JoeyC-Dev avatar Oct 14 '24 03:10 JoeyC-Dev

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

yonzhan avatar Oct 14 '24 03:10 yonzhan

Please fix cli, much needed.

klbrg avatar Oct 15 '24 11:10 klbrg

Please add the option on Terraform. https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/kubernetes_cluster

YvesEarnix avatar Dec 20 '24 20:12 YvesEarnix

hi, what's the status of this please? it's also broken when you issue an "az aks create" command

davidbarrowsatasos avatar Feb 17 '25 11:02 davidbarrowsatasos

From the AKS Preview History notes, it says: "[BREAKING CHANGE]: Remove support for az aks update --ssh-access command to avoid misleading. To update existing cluster's SSH access, please use az aks nodepool update --ssh-access to update node pool's SSH access one by one."

So it appears the Microsoft Learn documentation is outdated. I will update the docs. Is this an acceptable solution to use az aks nodepool update --ssh-access instead?

@davidbarrowsatasos From the docs, --ssh-access for az aks create is only available today in the aks-preview CLI extension. For awareness, it also says: "Configure SSH setting for the first system pool in this cluster. Use "disabled" to disable SSH access, "localuser" to enable SSH access using private key. Note, this configuration will not take effect for later created new node pools, please use option az aks nodepool add --ssh-access to configure SSH access for new node pools."

mbifeld avatar Dec 16 '25 16:12 mbifeld

@mbifeld thanks for your response, and thanks for updating the docs. It's been awhile since I looked at this, and can't speak for anyone else on this chat, but for me yes that sounds like an acceptable solution. Cheers

davidbarrowsatasos avatar Dec 16 '25 16:12 davidbarrowsatasos

I reviewed the documentation and realized it was already updated in https://github.com/MicrosoftDocs/azure-aks-docs/commit/93d57f566c708c267206ffc07a7d159e4408f084 to remove az aks update --ssh-access disabled from the docs.

Image

Will wait a few weeks for any additional comments before closing this issue.

mbifeld avatar Dec 16 '25 16:12 mbifeld

Closing this issue based on the above comment. Thank you.

mbifeld avatar Jan 20 '26 15:01 mbifeld