Skip to content

[AKS] Support configuring SSH for AKS nodepools - #34161

Merged
JaysonTaiMicrosoft merged 8 commits into
Azure:devfrom
norshtein:tosi/entraid-ssh
Oct 11, 2026
Merged

JaysonTaiMicrosoft merged 8 commits into
Azure:devfrom
norshtein:tosi/entraid-ssh

Conversation

@norshtein

@norshtein Tongyao Si (norshtein) commented Oct 2, 2026 •

Copy link
Copy Markdown
Member

Related command
az aks support configuring SSH setting for node pools.

Description
This PR add support for configuring SSH access for AKS node pool.

Testing Guide

History Notes

[AKS] az aks create: Add --ssh-access with localuser, disabled and entraid options to configure SSH access for the node pools
[AKS] az aks nodepool add/update: Add --ssh-access with localuser, disabled and entraid options to configure SSH access for the node pool


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

Copilot AI balanced review requested due to automatic review settings October 2, 2026 08:20
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

CI reports missing parameter help and scenario coverage, and the changes include minor style violations.

Review effort: Balanced
Findings: 6 Low severity

Open (6)
What changed in this PR

Adds configurable SSH access modes for AKS cluster and node-pool creation/update.

Changes:

  • Adds --ssh-access modes and update confirmation.
  • Applies SSH settings to agent-pool security profiles.
  • Adds decorator tests and history entries.
File Description
HISTORY.rst Documents the new options.
test_managed_cluster_decorator.py Tests cluster creation behavior.
test_agentpool_decorator.py Tests node-pool creation and updates.
managed_cluster_decorator.py Applies SSH access during cluster creation.
custom.py Exposes handler parameters.
agentpool_decorator.py Implements node-pool SSH configuration.
_params.py Registers arguments and accepted values.
_consts.py Defines SSH access constants.

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/azure-cli/azure/cli/command_modules/acs/_params.py Outdated
Comment thread src/azure-cli/azure/cli/command_modules/acs/_params.py Outdated
c.argument('enable_secure_boot', action='store_true')
c.argument('disable_secure_boot', action='store_true')
# in update scenario, use empty str as default
c.argument('ssh_access', arg_type=get_enum_type(ssh_accesses), is_preview=True)
Comment thread src/azure-cli/azure/cli/command_modules/acs/managed_cluster_decorator.py Outdated

def test_set_up_ssh_access(self):
self.common_set_up_ssh_access()

@a0x1ab

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).

Tongyao Si (norshtein) and others added 3 commits October 2, 2026 19:51
Add help text for ssh_access argument in _params.py

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
- Add parameter help for --ssh-access on aks nodepool add and nodepool
  update to satisfy the azdev-linter missing_parameter_help check
- Remove is_preview=True from --ssh-access on aks create, nodepool add,
  and nodepool update since the feature is now GA
- Wrap the AgentPoolSecurityProfile assignment to stay within the
  120-column limit in managed_cluster_decorator.py
- Remove trailing whitespace in test_agentpool_decorator.py
- Remove unused CONST_SSH_ACCESS_ENTRAID import in test_managed_cluster_decorator.py

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Drop the advisory warning emitted when --ssh-access is localuser in
set_up_ssh_access, along with the now-unused CONST_SSH_ACCESS_LOCALUSER
import in agentpool_decorator.py.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@a0x1ab

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).

@yonzhan Yong Zhang (yonzhan) added this to the Backlog milestone Oct 2, 2026
@yonzhan

Copy link
Copy Markdown
Collaborator

Please fix CI issues

@a0x1ab

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).

@norshtein

Copy link
Copy Markdown
Member Author

Close and reopen to re-trigger the CI.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@a0x1ab

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).

@norshtein

Copy link
Copy Markdown
Member Author

Hi Yong Zhang (@yonzhan) , the CI passed. Could you help review the PR? Thanks!

@FumingZhang FumingZhang left a comment

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.

lgtm

Comment thread src/azure-cli/HISTORY.rst Outdated

* `az aks create/update`: Preserve the default managed outbound IPv4 count when only the IPv6 count is provided (#33886)
* `az aks nodepool add/update`: Add `--enable-managed-dranet` to enable Managed DRANET on a node pool. (#34003)
* `az aks create`: Add `--ssh-access` with `localuser`, `disabled` and `entraid` options to configure SSH access for the node pools. (#34161)

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.

There’s no need to manually update the history note for changes in the official azure-cli repository. CI automatically generates it from the PR title or description.

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.

Removed it, thanks for reviewing!

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@norshtein

Copy link
Copy Markdown
Member Author

FumingZhang NoriZC could you help revisit the PR? Thanks!

@a0x1ab

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).


msg = (
f"You're going to update agentpool {agentpool.name} ssh access to '{ssh_access}' "
"This change will take effect after you upgrade the nodepool. Proceed?"

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.

[P2] Warn that updating SSH access can trigger a reimage

This prompt unconditionally says the change takes effect after upgrading the node pool. For Kubernetes 1.37+, changing SSH access can trigger node-pool reimaging as part of this update, rather than waiting for a separate upgrade. A user could therefore approve this expecting a configuration-only change and encounter unexpected node disruption.

Please update both this confirmation and the --ssh-access help to describe the version-dependent behavior and warn that changing SSH access can trigger reimaging.

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.

good point, updated code, PTAL, thanks!

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@a0x1ab

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).

@norshtein

Copy link
Copy Markdown
Member Author

NoriZC could you please help take a look? Thanks!

Comment thread src/azure-cli/azure/cli/command_modules/acs/_params.py
@norshtein

Copy link
Copy Markdown
Member Author

JaysonTaiMicrosoft could you please help revisit the PR? Thanks!

@JaysonTaiMicrosoft
JaysonTaiMicrosoft merged commit 2aef50c into Azure:dev Oct 11, 2026
50 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants