Skip to content

[AKS] Clarify aks update outbound type migration error for managed VNet clusters#33330

Draft
Copilot wants to merge 3 commits intodevfrom
copilot/fix-aks-update-outbound-type
Draft

[AKS] Clarify aks update outbound type migration error for managed VNet clusters#33330
Copilot wants to merge 3 commits intodevfrom
copilot/fix-aks-update-outbound-type

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 8, 2026

Related command
az aks update --outbound-type userDefinedRouting

Description
az aks update --outbound-type userDefinedRouting could fail with a message requiring --vnet-subnet-id, but aks update does not accept that argument. This change makes update-time validation reflect supported migration paths for existing clusters.

  • What changed

    • In AKSManagedClusterContext._raise_missing_vnet_subnet_for_outbound_type, update mode now raises InvalidArgumentValueError with a migration-path message instead of a missing-argument message.
    • Create-mode behavior is unchanged (still enforces subnet requirements where applicable).
  • User-visible effect

    • For update attempts on non-BYO-VNet clusters, CLI now returns a direct “unsupported for this cluster type” message with docs link, instead of suggesting an unusable flag.
  • Targeted coverage

    • Added a unit assertion in test_get_outbound_type to verify update mode returns the new error text (only supported for clusters created with --vnet-subnet-id).
  • Example

az aks update -g rg -n aks --outbound-type userDefinedRouting
# InvalidArgumentValueError:
# Updating outbound type to userDefinedRouting is only supported for clusters created with --vnet-subnet-id...

Testing Guide

# Repro path (managed VNet cluster)
az aks update -g <rg> -n <cluster> --outbound-type userDefinedRouting

# Verify new error message points to unsupported migration path, not missing --vnet-subnet-id argument.

History Notes
[AKS] az aks update: Improve outbound-type update error messaging for managed VNet clusters to align with supported migration paths.


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

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

azure-client-tools-bot-prd Bot commented May 8, 2026

️✔️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
️✔️postgresql
️✔️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 May 8, 2026

️✔️AzureCLI-BreakingChangeTest
️✔️Non Breaking Changes

@yonzhan
Copy link
Copy Markdown
Collaborator

yonzhan commented May 8, 2026

aks

Copilot AI changed the title [WIP] Fix aks update outbound type userDefinedRouting issue [AKS] Clarify aks update outbound type migration error for managed VNet clusters May 8, 2026
Copilot AI requested a review from a0x1ab May 8, 2026 04:51
Copilot finished work on behalf of a0x1ab May 8, 2026 04:51
Copy link
Copy Markdown
Member

@a0x1ab a0x1ab left a comment

Choose a reason for hiding this comment

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

🤖 This review was generated by the GitHub Copilot CLI agent as part of the automated bug triage pipeline.

✅ Tests Passed — Approving PR

Test Results for PR #33330 — [AKS] Clarify aks update outbound type migration error

Test Run Summary

  • Scope: test_managed_cluster_decorator.py
  • Targeted tests: test_get_outbound_type, test_update_outbound_type2/2 PASSED
  • Full suite: 268/268 PASSED (0 failures, 0 regressions)

Code Review

The fix correctly addresses the root cause:

  • Before: Users get --vnet-subnet-id must be specified, but az aks update doesn't accept --vnet-subnet-id → impossible to satisfy
  • After: Clear message: "Updating outbound type to userDefinedRouting is only supported for clusters created with --vnet-subnet-id" → actionable guidance

The change is scoped to update mode only; create-mode validation is unchanged. The unit test covers both the new error text and the update-mode path.

🟢 Approved — all tests pass, fix is correct.

Copy link
Copy Markdown
Member

@a0x1ab a0x1ab left a comment

Choose a reason for hiding this comment

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

🤖 Copilot Squad — Reviewer (Code Analysis)

Code review result: ⚠️ Escalating for human test verification

Changes reviewed

File Assessment
managed_cluster_decorator.py ✅ Logic is correct — converts static method to instance method to access self.decorator_mode, adds early InvalidArgumentValueError for UPDATE mode on managed VNet clusters
test_managed_cluster_decorator.py ✅ Unit test covers the new error path

Automated VM testing: ❌ Blocked

The Tester phase could not run because Azure credentials (AZURE_CLIENT_ID / AZURE_CLIENT_SECRET) are not configured in the agent environment. Live testing on an ephemeral VM was skipped.

What a human reviewer should verify

  1. Run azdev test acs (unit tests) — should pass with the new test case
  2. Manually test az aks update --outbound-type userDefinedRouting on a cluster with an AKS-managed VNet to confirm the improved error message appears
  3. Verify that az aks update --outbound-type userDefinedRouting with --vnet-subnet-id still works correctly (no regression)

Max iterations reached

Automated pipeline is escalating to human review after being unable to complete VM-based testing.


🤖 This comment was posted by the Copilot Squad AI agent — automated triage & fix pipeline.

Copy link
Copy Markdown
Member

@a0x1ab a0x1ab left a comment

Choose a reason for hiding this comment

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

🤖 AI Agent | This comment was posted automatically by the GitHub Copilot agent assist loop.

✅ Reviewer — PR #33330 Approved

Issue: #33204 — Cannot use az aks update --outbound-type userDefinedRouting

Code Review Results

Code change: _raise_missing_vnet_subnet_for_outbound_type changed from @staticmethod to instance method so it can inspect self.decorator_mode.

  • ✅ Single caller at line 2491 uses self._raise_missing_vnet_subnet_for_outbound_type(...) — no breaking change from static→instance conversion
  • ✅ UPDATE mode now raises InvalidArgumentValueError with a clear, actionable message pointing to the docs
  • ✅ CREATE mode behavior is unchanged
  • ✅ Unit test added covering the UPDATE path
  • ✅ All 48 CI checks pass (Full Test Python 3.12 & 3.13, Style, Unit Tests, Build, Breaking Change)

Note: Azure VM-based testing was blocked (no credentials in agent environment), but the full CI suite ran and passed all tests including the new unit test.

This fix correctly addresses the root cause: az aks update does not accept --vnet-subnet-id, so suggesting it in an error message was misleading. The new message clearly explains that outbound type migration is unsupported for managed-VNet clusters and links to the relevant docs.

Copy link
Copy Markdown
Member

@a0x1ab a0x1ab left a comment

Choose a reason for hiding this comment

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

🤖 AI Agent | Automated Quality Gate

✅ Test Results — Issue #33204 / PR #33330

Test environment: Local unit test run on PR branch copilot/fix-aks-update-outbound-type

Test Suite Result
test_managed_cluster_decorator.py ✅ 268/268 passed
test_get_outbound_type (new assertion) ✅ PASSED

Validation: The new _raise_missing_vnet_subnet_for_outbound_type update-mode path raises InvalidArgumentValueError with the expected message (only supported for clusters created with --vnet-subnet-id) instead of the misleading --vnet-subnet-id must be specified... error.

No regressions detected. The fix correctly addresses the confusion described in issue #33204 by giving a clear, actionable error for managed-VNet clusters.

⚠️ Note: Azure VM provisioning was unavailable in this environment; live E2E tests against a real AKS cluster could not be run. Unit test coverage of the changed code path is complete.

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.

Cannot use aks update --outbound-type userDefinedRouting

4 participants