Skip to content

[AKS] az aks install-cli: Add optional host-managed Azure plugin setup - #34115

Open
Tom Gamble (gambtho) wants to merge 7 commits into
Azure:devfrom
gambtho:feature/aks-azure-plugin
Open

Tom Gamble (gambtho) wants to merge 7 commits into
Azure:devfrom
gambtho:feature/aks-azure-plugin

Conversation

@gambtho

@gambtho Tom Gamble (gambtho) commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

🤖 PR Validation — ⚠️ Review suggested

Breaking Changes Tests
⚠️ None ️✔️ 130/130
⚠️AzureCLI-BreakingChangeTest
⚠️acs
rule cmd_name rule_message suggest_message
⚠️ 1006 - ParaAdd aks install-cli cmd aks install-cli added parameter install_azure_plugin
⚠️ 1006 - ParaAdd aks install-cli cmd aks install-cli added parameter plugin_hosts

Related command

az aks install-cli

Description

Draft replacement candidate for #34101. That PR remains open for comparison; these are alternative approaches, not changes intended to land together.

Instead of downloading and copying standalone skill files, optionally install the full published Azure plugin through the user's existing Claude Code, GitHub Copilot CLI, or Codex CLI plugin manager. Azure CLI adds no separate skill updater, package registry, or direct host-configuration writer.

  • Existing kubectl → kubelogin installation stays unchanged. Plugin setup runs only after both succeed.
  • Omitted --install-azure-plugin offers default-No setup only in an interactive terminal, with numbered host selection and a second default-No scope/enablement confirmation. Noninteractive sessions, disabled confirmation prompts, and sudo skip the offer. Explicit false skips it entirely.
  • Explicit true requires --plugin-hosts and never prompts. Invalid combinations and explicit sudo requests fail before binary side effects.
  • New installations use native user/global scope. Reported existing Azure installations—including disabled/live entries—are skipped. When a valid native inventory reports absence, consent authorizes normal native install-and-enable behavior, including changes to hidden/stale local disable preferences. This distinction matters because host inventories do not expose every saved registration.
  • Existing marketplace registrations/refs are reused, not repointed. There are no forced update, enable, trust-bypass or custom repair calls. Malformed, ambiguous or warning-bearing inventory fails safely; an existing Copilot azure MCP server blocks fresh installation to avoid shadowing it.
  • A fresh installation requires an installed host CLI and Node.js 22+ with npx on PATH. Prerequisites and agent applications are not installed automatically.
  • The full upstream plugin includes skills, MCP configuration and hooks. Authentication, activation, hook approval and sovereign-cloud setup may still be required. Host policies and update settings remain authoritative. The stock Azure MCP command currently uses @azure/mcp@latest: pinning the plugin does not also pin that runtime.
  • Optional setup failures warn while preserving binary success; explicit failures return nonzero. Partial outcomes and interruption uncertainty are reported without automatic retries/rollback. Inventory diagnostics suppress potentially credential-bearing output; timeout/cancellation cleanup targets the owned process group/tree.

Scope is the base Azure plugin in the three CLI hosts above. Pi, VS Code-specific setup, deeper AKS add-on selection, prerequisite installation, Azure authentication and Azure resource operations are not added here.

Testing Guide

Binary-only automation:

az aks install-cli --install-azure-plugin false

Interactive, default-No offer:

az aks install-cli

Explicit native plugin setup (requires the selected host CLI and runtime prerequisites):

az aks install-cli --install-azure-plugin true --plugin-hosts claude-code
az aks install-cli --install-azure-plugin true --plugin-hosts github-copilot codex

Local verification:

  • azdev test acs --series --no-exitfirst on Python 3.12.3 and 3.14.6: 1,190 passed, 90 skipped on each, on final implementation head 56a29a0945.
  • Final focused helper/custom/validators/scenario suites: 356 passed, 1 skipped, 420 subtests passed on each version.
  • Actual selected azdev scenario: 2 passed on each version. It exercises real CLI parsing, binary installation and subprocess dispatch against disposable fake Codex executables, followed by a disabled-existing rerun that leaves registration bytes/mtime unchanged.
  • Missing-orchestration, destructive-reinstall and false-constructor-failure mutations fail the intended assertions. Constructor, filesystem, network and real-host guards are exercised.
  • Real Linux launcher/descendant tests cover timeout and cancellation cleanup; inventory confidentiality and duplicate-key regressions cover all adapters.
  • Full-repository azdev style passed before the final hardening; affected ACS Pylint/Flake8 and targeted E128 passed again on the final head. Python 3.10 grammar and diff checks passed.

History Notes

[AKS] az aks install-cli: Add optional host-managed Azure plugin setup


@azure-client-tools-bot-prd

Copy link
Copy Markdown

Hi Tom Gamble (@gambtho),
Since the current milestone time is less than 7 days, this pr will be reviewed in the next milestone.

Intercept only owned-fixture taskkill commands separately from host commands, and register unconditional child cleanup. Cover the original confidentiality test with the Windows branch selected so taskkill cannot hit the Copilot-only Popen guard.
@yonzhan

Copy link
Copy Markdown
Collaborator

Please fix CI issues

@x-engineering-agent

Copy link
Copy Markdown
Contributor

Automated sensitive-information remediation ran on this pull request.

  • Detected categories: credential
  • Replaced with typed [REDACTED:category] placeholders in: no PR metadata fields
  • Comment/review owners notified because X Engineering Agent cannot edit another user's text: none

X Engineering Agent does not modify source files. The PR creator must remove or replace each suspected value at the linked line:

If a credential was exposed, rotate or revoke it immediately. Detected values are never copied into this comment.

✅ Confirm the finding · ❌ Dispute the finding

GitHub only supports a fixed reaction set, so 👍 represents ✅ and 👎 represents ❌. The bot-created reactions are only poll choices.

@gambtho

Copy link
Copy Markdown
Contributor Author

Please fix CI issues

The failures look like CI setup issues: the style job hit a PyPI download timeout, and the
Python 3.14 core job hit its time limit before tests started. Could someone with permissions
rerun them?

The credential warnings are false positives—all three values are synthetic fixtures used to
test redaction, not real credentials.

@gambtho
Tom Gamble (gambtho) marked this pull request as ready for review September 24, 2026 02:17
@gambtho
Tom Gamble (gambtho) requested a review from a team as a code owner September 24, 2026 02:17
Copilot AI lite review requested due to automatic review settings September 24, 2026 02:17
@gambtho

Copy link
Copy Markdown
Contributor Author

assuming this approach is approved, we can close #34101

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

Process cleanup can incorrectly report successful termination as uncertain; handle already-terminated processes correctly.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 Medium severity

Open (1)
What changed in this PR

Adds optional native Azure plugin setup to az aks install-cli for supported host CLIs while preserving existing binary installation.

Changes:

  • Adds host validation, consent, inventory handling, installation, and cleanup.
  • Adds plugin-related CLI arguments and help documentation.
  • Adds extensive unit, integration, and scenario tests.
File Summary
src/​azure-cli/​azure/​cli/​command_modules/​acs/​tests/​latest/​test_custom.py Tests parsing, orchestration, and command behavior.
src/​azure-cli/​azure/​cli/​command_modules/​acs/​tests/​latest/​test_azure_plugin.py Tests plugin workflows, validation, security, and cleanup.
src/​azure-cli/​azure/​cli/​command_modules/​acs/​tests/​latest/​test_aks_install_plugin.py Tests isolated end-to-end installation scenarios.
src/​azure-cli/​azure/​cli/​command_modules/​acs/​custom.py Integrates plugin setup after binary installation.
src/​azure-cli/​azure/​cli/​command_modules/​acs/​_params.py Adds plugin-related CLI parameters.
src/​azure-cli/​azure/​cli/​command_modules/​acs/​_help.py Documents plugin behavior and usage.
src/​azure-cli/​azure/​cli/​command_modules/​acs/​_azure_plugin.py Implements host integration, installation, diagnostics, and process management.

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

Comment thread src/azure-cli/azure/cli/command_modules/acs/_azure_plugin.py
Comment thread src/azure-cli/azure/cli/command_modules/acs/_azure_plugin.py
if not executable:
raise ResourceNotFoundError(_failure(host_id, 'prerequisite check',
f'Install {_EXECUTABLES[host_id]} and make it available on PATH.'))
args = ['plugin', 'list', '--available', '--json'] if host_id == 'codex' else ['plugin', 'list', '--json']

@FumingZhang FumingZhang Sep 24, 2026 •

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] Check host compatibility before redacted JSON inventory

This checks that the executable exists but assumes it supports the required plugin JSON commands. Reproduced with GitHub Copilot CLI 1.0.75 against head 93e2513a: plugin list --json rejects --json, and the actual installer reports only exit 1 plus [sensitive inventory output suppressed]. The host is installed, but users receive no actionable indication that they need to upgrade it.

Please check/document the required host versions or capabilities and provide safe upgrade guidance for unsupported-command/option failures, while keeping inventory payloads redacted. A regression test for an installed host lacking the required JSON command would cover this path.

@x-engineering-agent

Copy link
Copy Markdown
Contributor

Automated sensitive-information remediation ran on this pull request.

  • Detected categories: credential
  • Replaced with typed [REDACTED:category] placeholders in: no PR metadata fields
  • Comment/review owners notified because X Engineering Agent cannot edit another user's text: none

X Engineering Agent does not modify source files. The PR creator must remove or replace each suspected value at the linked line:

If a credential was exposed, rotate or revoke it immediately. Detected values are never copied into this comment.

✅ Confirm the finding · ❌ Dispute the finding

GitHub only supports a fixed reaction set, so 👍 represents ✅ and 👎 represents ❌. The bot-created reactions are only poll choices.

'github-copilot': 'Update: copilot plugin update azure@azure-skills\n'
'Remove: copilot plugin uninstall azure@azure-skills',
'codex': 'Update (marketplace-wide; affects other installed plugins from azure-skills): '
'codex plugin marketplace upgrade azure-skills\n'

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] Make Codex update guidance conditional on the marketplace source

install_plugin() intentionally reuses an existing marketplace named azure-skills, including a local marketplace, but a successful install always prints this Git-only update command. I reproduced this with native Codex 0.146.0: register an inert local azure-skills marketplace, install azure@azure-skills through this PR's helper, then run the exact printed command. Installation succeeds; the update command exits 1 with:

Error: marketplace `azure-skills` is not configured as a Git marketplace

For Git-backed marketplaces this command does refresh installed plugin caches; that behavior is correct. The issue is specifically the unconditional advice after an installation from a supported existing local source.

Please make the guidance source-aware, or explicitly qualify the Git-only command rather than presenting it as applicable to every successful Codex installation. Add a local-marketplace case to the lifecycle-guidance coverage.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants