Skip to content

[AKS] az aks upgrade: Support tier switch with AKS upgrade#9785

Open
m-chau wants to merge 19 commits intoAzure:mainfrom
m-chau:feature/upgrade-tier-support-plan
Open

[AKS] az aks upgrade: Support tier switch with AKS upgrade#9785
m-chau wants to merge 19 commits intoAzure:mainfrom
m-chau:feature/upgrade-tier-support-plan

Conversation

@m-chau
Copy link
Copy Markdown
Contributor

@m-chau m-chau commented Apr 15, 2026


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

Related command

az aks upgrade

Description

Adding options --tier and --k8s-support-plan to az aks upgrade command to support enable/disable AKSLongTermSupport with upgrade operation.

For example, if a cluster is currently on out-of-support version 1.29, they can upgrade to 1.30 LTS with command: az aks upgrade -g myResourceGroup -n myCluster -k 1.30--tier Premium --k8s-support-plan AKSLongTermSupport

Similarly, to exit LTS for clusters on 1.34 that are still in community support, they can do: az aks upgrade -g myResourceGroup -n myCluster -k 1.35 --tier Standard --k8s-support-plan KubernetesOfficial

The feature is actually in GA with Azure/azure-cli#29448. Thie PR backports it to preview CLI to algin behavior between preview extension and GA.

General Guidelines

  • Have you run azdev style <YOUR_EXT> locally? (pip install azdev required)
  • Have you run python scripts/ci/test_index.py -q locally? (pip install wheel==0.30.0 required)
  • My extension version conforms to the Extension version schema

For new extensions:

About Extension Publish

There is a pipeline to automatically build, upload and publish extension wheels.
Once your pull request is merged into main branch, a new pull request will be created to update src/index.json automatically.
You only need to update the version information in file setup.py and historical information in file HISTORY.rst in your PR but do not modify src/index.json.

Copilot AI review requested due to automatic review settings April 15, 2026 01:22
@azure-client-tools-bot-prd
Copy link
Copy Markdown

azure-client-tools-bot-prd bot commented Apr 15, 2026

⚠️Azure CLI Extensions Breaking Change Test
⚠️aks-preview
rule cmd_name rule_message suggest_message
⚠️ 1006 - ParaAdd aks upgrade cmd aks upgrade added parameter k8s_support_plan
⚠️ 1006 - ParaAdd aks upgrade cmd aks upgrade added parameter tier

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

Hi @m-chau,
Please write the description of changes which can be perceived by customers into HISTORY.rst.
If you want to release a new extension version, please update the version in setup.py as well.

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines:
Successfully started running 2 pipeline(s).

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

Note

Copilot was unable to run its full agentic suite in this review.

Adds support for switching AKS SKU tier and Kubernetes support plan during az aks upgrade, enabling entry/exit from AKS Long Term Support (LTS) as part of an upgrade operation.

Changes:

  • Adds --tier and --k8s-support-plan parameters to az aks upgrade.
  • Updates upgrade logic to apply/support-plan + tier switching and validates LTS requires Premium tier.
  • Adds a live test covering tier/support-plan switching during upgrade.

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
src/aks-preview/azext_aks_preview/custom.py Applies --tier / --k8s-support-plan during upgrade and validates LTS↔tier constraints.
src/aks-preview/azext_aks_preview/_params.py Wires new parameters into aks upgrade argument definitions.
src/aks-preview/azext_aks_preview/_help.py Documents new CLI flags for aks upgrade.
src/aks-preview/azext_aks_preview/tests/latest/test_aks_commands.py Adds test + helper methods to exercise tier/support-plan switching during upgrade.
src/aks-preview/HISTORY.rst Notes new az aks upgrade flags in changelog.

Comment thread src/aks-preview/azext_aks_preview/custom.py Outdated
Comment thread src/aks-preview/azext_aks_preview/custom.py Outdated
Comment thread src/aks-preview/azext_aks_preview/custom.py Outdated
Comment thread src/aks-preview/azext_aks_preview/tests/latest/test_aks_commands.py Outdated
Comment thread src/aks-preview/azext_aks_preview/tests/latest/test_aks_commands.py Outdated
Comment thread src/aks-preview/azext_aks_preview/tests/latest/test_aks_commands.py Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines:
Successfully started running 2 pipeline(s).

…ds.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines:
Successfully started running 2 pipeline(s).

…ds.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines:
Successfully started running 2 pipeline(s).

@yonzhan
Copy link
Copy Markdown
Collaborator

yonzhan commented Apr 15, 2026

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

@github-actions
Copy link
Copy Markdown
Contributor

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>

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines:
Successfully started running 2 pipeline(s).

@github-actions
Copy link
Copy Markdown
Contributor

CodeGen Tools Feedback Collection

Thank you for using our CodeGen tool. We value your feedback, and we would like to know how we can improve our product. Please take a few minutes to fill our codegen survey

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 15, 2026

Hi @m-chau

Release Suggestions

Module: aks-preview

  • Update VERSION to 20.0.0b3 in src/aks-preview/setup.py

Notes


@AllowLargeResponse()
@AKSCustomResourceGroupPreparer(random_name_length=17, name_prefix='clitest', location='westus2')
def test_aks_upgrade_with_tier_switch(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
Contributor Author

@m-chau m-chau Apr 16, 2026

Choose a reason for hiding this comment

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

@FumingZhang Undo some copilot suggestions and the PR gate tests have passed :)

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.

the previous live test run failed with error

  self.assertIn("AKSLongTermSupport", fail_upgrade_result.error)
                                        ^^^^^^^^^^^^^^^^^^^^^^^^^

E AttributeError: 'ExecutionResult' object has no attribute 'error'

https://dev.azure.com/msazure/CloudNativeCompute/CloudNativeCompute%20Team/_build/results?buildId=160496427&view=logs&j=b162b355-d59d-5864-ce0f-0a70f12dd28b&t=a26fe913-e2be-5062-b08e-d15f1acc7ea2&l=4134

Re-queued

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines:
Successfully started running 2 pipeline(s).

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines:
Successfully started running 2 pipeline(s).

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines:
Successfully started running 2 pipeline(s).

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

Labels

AKS Auto-Assign Auto assign by bot

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants