Skip to content

[ACS] BREAKING CHANGE: az aks create: Make --no-ssh-key default behaviour#32254

Merged
a0x1ab merged 9 commits intoAzure:devfrom
a0x1ab:dev
Nov 7, 2025
Merged

[ACS] BREAKING CHANGE: az aks create: Make --no-ssh-key default behaviour#32254
a0x1ab merged 9 commits intoAzure:devfrom
a0x1ab:dev

Conversation

@a0x1ab
Copy link
Copy Markdown
Member

@a0x1ab a0x1ab commented Oct 13, 2025

Related command
aks

Description

Testing Guide

  • Can be tested using az aks create with the required parameters and omitting all ssh related parameters
  • Added new test and recording to assess this functionality

This checklist is used to make sure that common guidelines for a pull request are followed.

Enhanced help text to clarify default SSH key behavior for AKS clusters. Updated SSH key validation logic to default to server-side key generation when no local key is present. Added and updated tests to cover scenarios without SSH keys.
@a0x1ab a0x1ab requested a review from jiasli October 13, 2025 23:27
Copilot AI review requested due to automatic review settings October 13, 2025 23:27
@azure-client-tools-bot-prd
Copy link
Copy Markdown

azure-client-tools-bot-prd bot commented Oct 13, 2025

️✔️AzureCLI-FullTest
️✔️acr
️✔️latest
️✔️3.12
️✔️3.13
️✔️acs
️✔️latest
️✔️3.12
️✔️3.13
️✔️advisor
️✔️latest
️✔️3.12
️✔️3.13
️✔️ams
️✔️latest
️✔️3.12
️✔️3.13
️✔️apim
️✔️latest
️✔️3.12
️✔️3.13
️✔️appconfig
️✔️latest
️✔️3.12
️✔️3.13
️✔️appservice
️✔️latest
️✔️3.12
️✔️3.13
️✔️aro
️✔️latest
️✔️3.12
️✔️3.13
️✔️backup
️✔️latest
️✔️3.12
️✔️3.13
️✔️batch
️✔️latest
️✔️3.12
️✔️3.13
️✔️batchai
️✔️latest
️✔️3.12
️✔️3.13
️✔️billing
️✔️latest
️✔️3.12
️✔️3.13
️✔️botservice
️✔️latest
️✔️3.12
️✔️3.13
️✔️cdn
️✔️latest
️✔️3.12
️✔️3.13
️✔️cloud
️✔️latest
️✔️3.12
️✔️3.13
️✔️cognitiveservices
️✔️latest
️✔️3.12
️✔️3.13
️✔️compute_recommender
️✔️latest
️✔️3.12
️✔️3.13
️✔️computefleet
️✔️latest
️✔️3.12
️✔️3.13
️✔️config
️✔️latest
️✔️3.12
️✔️3.13
️✔️configure
️✔️latest
️✔️3.12
️✔️3.13
️✔️consumption
️✔️latest
️✔️3.12
️✔️3.13
️✔️container
️✔️latest
️✔️3.12
️✔️3.13
️✔️containerapp
️✔️latest
️✔️3.12
️✔️3.13
️✔️core
️✔️latest
️✔️3.12
️✔️3.13
️✔️cosmosdb
️✔️latest
️✔️3.12
️✔️3.13
️✔️databoxedge
️✔️latest
️✔️3.12
️✔️3.13
️✔️dls
️✔️latest
️✔️3.12
️✔️3.13
️✔️dms
️✔️latest
️✔️3.12
️✔️3.13
️✔️eventgrid
️✔️latest
️✔️3.12
️✔️3.13
️✔️eventhubs
️✔️latest
️✔️3.12
️✔️3.13
️✔️feedback
️✔️latest
️✔️3.12
️✔️3.13
️✔️find
️✔️latest
️✔️3.12
️✔️3.13
️✔️hdinsight
️✔️latest
️✔️3.12
️✔️3.13
️✔️identity
️✔️latest
️✔️3.12
️✔️3.13
️✔️iot
️✔️latest
️✔️3.12
️✔️3.13
️✔️keyvault
️✔️latest
️✔️3.12
️✔️3.13
️✔️lab
️✔️latest
️✔️3.12
️✔️3.13
️✔️managedservices
️✔️latest
️✔️3.12
️✔️3.13
️✔️maps
️✔️latest
️✔️3.12
️✔️3.13
️✔️marketplaceordering
️✔️latest
️✔️3.12
️✔️3.13
️✔️monitor
️✔️latest
️✔️3.12
️✔️3.13
️✔️mysql
️✔️latest
️✔️3.12
️✔️3.13
️✔️netappfiles
️✔️latest
️✔️3.12
️✔️3.13
️✔️network
️✔️latest
️✔️3.12
️✔️3.13
️✔️policyinsights
️✔️latest
️✔️3.12
️✔️3.13
️✔️privatedns
️✔️latest
️✔️3.12
️✔️3.13
️✔️profile
️✔️latest
️✔️3.12
️✔️3.13
️✔️rdbms
️✔️latest
️✔️3.12
️✔️3.13
️✔️redis
️✔️latest
️✔️3.12
️✔️3.13
️✔️relay
️✔️latest
️✔️3.12
️✔️3.13
️✔️resource
️✔️latest
️✔️3.12
️✔️3.13
️✔️role
️✔️latest
️✔️3.12
️✔️3.13
️✔️search
️✔️latest
️✔️3.12
️✔️3.13
️✔️security
️✔️latest
️✔️3.12
️✔️3.13
️✔️servicebus
️✔️latest
️✔️3.12
️✔️3.13
️✔️serviceconnector
️✔️latest
️✔️3.12
️✔️3.13
️✔️servicefabric
️✔️latest
️✔️3.12
️✔️3.13
️✔️signalr
️✔️latest
️✔️3.12
️✔️3.13
️✔️sql
️✔️latest
️✔️3.12
️✔️3.13
️✔️sqlvm
️✔️latest
️✔️3.12
️✔️3.13
️✔️storage
️✔️latest
️✔️3.12
️✔️3.13
️✔️synapse
️✔️latest
️✔️3.12
️✔️3.13
️✔️telemetry
️✔️latest
️✔️3.12
️✔️3.13
️✔️util
️✔️latest
️✔️3.12
️✔️3.13
️✔️vm
️✔️latest
️✔️3.12
️✔️3.13

@azure-client-tools-bot-prd
Copy link
Copy Markdown

azure-client-tools-bot-prd bot commented Oct 13, 2025

⚠️AzureCLI-BreakingChangeTest
⚠️acs
rule cmd_name rule_message suggest_message
⚠️ 1004 - CmdPropRemove aks create cmd aks create removed property deprecate_info_target

@yonzhan
Copy link
Copy Markdown
Collaborator

yonzhan commented Oct 13, 2025

Thank you for your contribution! We will review the pull request and get back to you soon.

@github-actions
Copy link
Copy Markdown

The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR.

Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions).
After that please run the following commands to enable git hooks:

pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements a breaking change to the az aks create command to make --no-ssh-key the default behavior when no SSH-related parameters are provided. Previously, the command would fail if no SSH parameters were provided, now it defaults to using server-side generated keys.

Key changes:

  • Updated SSH key validation logic to default to --no-ssh-key behavior when no valid SSH key is found
  • Added a comprehensive test case to verify the new default behavior
  • Updated help documentation to reflect the behavior change

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
test_aks_commands.py Added new test test_aks_create_no_ssh_key to verify cluster creation without SSH parameters
test_aks_create_no_ssh_key.yaml Test recording file for the new SSH-less cluster creation test
_validators.py Modified SSH key validation to default to no_ssh_key=True when no valid key is found
_help.py Updated help text for --ssh-key-value and --no-ssh-key parameters to document new behavior
Comments suppressed due to low confidence (1)

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread src/azure-cli/azure/cli/command_modules/acs/_validators.py
Comment thread src/azure-cli/azure/cli/command_modules/acs/_validators.py
@FumingZhang
Copy link
Copy Markdown
Member

I believe this is a good time to merge this PR, but don't forget to fix the failed CI check, there's a recent change that bumps the SDK and default API version to 2025-09-01.

      raise AssertionError(ex)

E AssertionError: Can't overwrite existing cassette ('/mnt/vss/_work/1/s/src/azure-cli/azure/cli/command_modules/acs/tests/latest/recordings/test_aks_create_no_ssh_key.yaml') in your current record mode ('once').
E No match for the request (<Request (PUT) https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.ContainerService/managedClusters/cliakstest000002?api-version=2025-09-01>) was found.
E Found 1 similar requests with 1 different matcher(s) :
E
E 1 - (<Request (PUT) https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.ContainerService/managedClusters/cliakstest000002?api-version=2025-07-01>)..)
E Matchers succeeded : ['method', 'scheme', 'host', 'port', 'path']
E Matchers failed :
E _custom_request_query_matcher - assertion failure :
E None

https://dev.azure.com/azclitools/public/public%20Team/_build/results?buildId=280893&view=logs&j=950e443e-fa90-5f50-4303-cd9168964025&t=e8e1e5d0-e808-59fd-7db9-daddfd146787&l=4126

@ReaNAiveD
Copy link
Copy Markdown
Member

ReaNAiveD commented Nov 5, 2025

Please remove the breaking change pre-announcement in src/azure-cli/azure/cli/command_modules/acs/_breaking_change.py.

Deleted _breaking_change.py which registered a logic breaking change for default SSH key handling in 'az aks create'. This cleanup removes an outdated breaking change registration.
bebound
bebound previously approved these changes Nov 6, 2025

@AllowLargeResponse()
@AKSCustomResourceGroupPreparer(random_name_length=17, name_prefix='clitest', location='westus2')
def test_aks_create_no_ssh_key(self, resource_group, resource_group_location):
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Queued live test to validate the change.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successful

@a0x1ab a0x1ab merged commit e831f2d into Azure:dev Nov 7, 2025
48 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AKS az aks/acs/openshift Auto-Assign Auto assign by bot

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Set '--no-ssh-key' as default bahavior for 'az aks create' in CLI

8 participants