Skip to content

{AKS} az aks create/update: Add --enable-default-domain and --disable-default-domain parameters to manage the default domain feature for web app routing#9578

Merged
yanzhudd merged 15 commits intoAzure:mainfrom
OliverMKing:kingoliver/defaultdomain
Feb 16, 2026
Merged

{AKS} az aks create/update: Add --enable-default-domain and --disable-default-domain parameters to manage the default domain feature for web app routing#9578
yanzhudd merged 15 commits intoAzure:mainfrom
OliverMKing:kingoliver/defaultdomain

Conversation

@OliverMKing
Copy link
Copy Markdown
Contributor

@OliverMKing OliverMKing commented Feb 5, 2026


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

Related command

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 February 5, 2026 03:46
@azure-client-tools-bot-prd
Copy link
Copy Markdown

azure-client-tools-bot-prd bot commented Feb 5, 2026

⚠️Azure CLI Extensions Breaking Change Test
⚠️aks-preview
rule cmd_name rule_message suggest_message
⚠️ 1011 - SubgroupAdd aks approuting defaultdomain sub group aks approuting defaultdomain added
⚠️ 1006 - ParaAdd aks approuting enable cmd aks approuting enable added parameter enable_default_domain
⚠️ 1006 - ParaAdd aks approuting update cmd aks approuting update added parameter disable_default_domain
⚠️ 1006 - ParaAdd aks approuting update cmd aks approuting update added parameter enable_default_domain
⚠️ 1006 - ParaAdd aks create cmd aks create added parameter enable_default_domain

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

Hi @OliverMKing,
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.

@yonzhan
Copy link
Copy Markdown
Collaborator

yonzhan commented Feb 5, 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

github-actions bot commented Feb 5, 2026

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>

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 5, 2026

Hi @OliverMKing

Release Suggestions

Module: aks-preview

  • Update VERSION to 19.0.0b23 in src/aks-preview/setup.py

Notes

@OliverMKing OliverMKing force-pushed the kingoliver/defaultdomain branch from d35a8a2 to 34e9a1d Compare February 5, 2026 03:54
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 5, 2026

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

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 pull request adds support for managing default domains in the AKS Application Routing addon through Azure CLI commands. The feature allows users to enable or disable a default domain for Application Routing, which provides automatic domain assignment to clusters.

Changes:

  • Added az aks approuting defaultdomain show command to display the default domain configuration
  • Added --enable-default-domain and --disable-default-domain flags to aks create, aks approuting enable, and aks approuting update commands
  • Implemented comprehensive test coverage for the default domain lifecycle

Reviewed changes

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

Show a summary per file
File Description
src/aks-preview/azext_aks_preview/tests/latest/test_aks_commands.py Added two test cases covering default domain enable/disable/show operations and cluster creation with default domain
src/aks-preview/azext_aks_preview/managed_cluster_decorator.py Added getter methods for default domain flags and logic to configure default domain during cluster creation and updates
src/aks-preview/azext_aks_preview/custom.py Added aks_approuting_default_domain_show function and integrated default domain flags into enable/update commands with conflict validation
src/aks-preview/azext_aks_preview/commands.py Registered the new aks approuting defaultdomain show command
src/aks-preview/azext_aks_preview/_params.py Defined parameters for enable_default_domain and disable_default_domain flags across relevant commands
src/aks-preview/azext_aks_preview/_help.py Added help documentation for the new command and parameters
Comments suppressed due to low confidence (1)

src/aks-preview/azext_aks_preview/custom.py:4137

  • While the default domain functionality is tested via the create and update commands, there is no test coverage for enabling default domain using the "aks approuting enable" command with the --enable-default-domain flag. Consider adding a test case to verify this code path works correctly.
def aks_mesh_upgrade_complete(
        cmd,
        client,
        resource_group_name,
        name,
        yes=False
):
    return _aks_mesh_update(
        cmd,
        client,
        resource_group_name,
        name,


def get_nginx(self):
"""Obtain the value of nginx, written to the update decorator context by _aks_approuting_update

Copy link

Copilot AI Feb 5, 2026

Choose a reason for hiding this comment

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

Trailing whitespace detected after the function definition. Please remove the trailing spaces to maintain code cleanliness.

Copilot uses AI. Check for mistakes.
Comment on lines 4077 to +4093
)
)

if "web_application_routing" in addons:
dns_zone_resource_ids = self.context.get_dns_zone_resource_ids()
mc.ingress_profile.web_app_routing.dns_zone_resource_ids = dns_zone_resource_ids

if self.context.get_enable_default_domain() or self.context.get_disable_default_domain():
if mc.ingress_profile is None:
mc.ingress_profile = self.models.ManagedClusterIngressProfile() # pylint: disable=no-member
if mc.ingress_profile.web_app_routing is None:
mc.ingress_profile.web_app_routing = (
self.models.ManagedClusterIngressProfileWebAppRouting(enabled=True) # pylint: disable=no-member
)

enable = True
if self.context.get_disable_default_domain():
Copy link

Copilot AI Feb 5, 2026

Choose a reason for hiding this comment

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

The logic checking for disable_default_domain is unnecessary in set_up_ingress_web_app_routing since this function is only called during cluster creation, and disable_default_domain is not defined in the create command's argument context (only in update). The condition should be simplified to only check get_enable_default_domain(). This would make the code clearer and more maintainable.

Copilot uses AI. Check for mistakes.
self.models.ManagedClusterIngressProfileWebAppRouting(enabled=True) # pylint: disable=no-member
)

enable = True
Copy link

Copilot AI Feb 5, 2026

Choose a reason for hiding this comment

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

Trailing whitespace detected on empty lines. Please remove the trailing spaces to maintain code cleanliness.

Suggested change
enable = True
enable = True

Copilot uses AI. Check for mistakes.
dns_zone_resource_ids = self.context.get_dns_zone_resource_ids()
mc.ingress_profile.web_app_routing.dns_zone_resource_ids = dns_zone_resource_ids

if self.context.get_enable_default_domain() or self.context.get_disable_default_domain():
Copy link

Copilot AI Feb 5, 2026

Choose a reason for hiding this comment

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

The code implicitly enables App Routing (by creating web_app_routing with enabled=True) when enable_default_domain is specified, even if enable_app_routing is not set. While this is functionally correct (default domain requires App Routing), it creates implicit behavior that may be confusing. Consider adding validation to require --enable-app-routing when --enable-default-domain is used, or document this implicit behavior in the help text. This would make the dependency explicit and avoid user confusion.

Suggested change
if self.context.get_enable_default_domain() or self.context.get_disable_default_domain():
if self.context.get_enable_default_domain() or self.context.get_disable_default_domain():
# Default domain requires App Routing; make this dependency explicit to avoid
# implicitly enabling App Routing when the user has not requested it.
if not (self.context.get_enable_app_routing() or "web_application_routing" in addons):
raise ArgumentUsageError(
"--enable-default-domain/--disable-default-domain requires either "
"--enable-app-routing or --enable-addons web_application_routing."
)

Copilot uses AI. Check for mistakes.
@FumingZhang
Copy link
Copy Markdown
Member

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 2 pipeline(s).

self.cmd(delete_cmd, checks=[self.is_empty()])

@AllowLargeResponse()
@AKSCustomResourceGroupPreparer(
Copy link
Copy Markdown
Member

@FumingZhang FumingZhang Feb 5, 2026

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, test passed!

Please also commit recording files to pass CI check

arg_type=get_enum_type(app_routing_nginx_configs),
options_list=["--app-routing-default-nginx-controller", "--ardnc"]
)
c.argument("enable_default_domain", action="store_true", is_preview=True)
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.

I'm curious why only this occurrence is marked as is_preview, while the others are not.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

added is_preview to the rest. Good catch!


return mc

def set_up_ingress_web_app_routing(self, mc: ManagedCluster) -> ManagedCluster:
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.

please also add some unit tests for changes in this file

@FumingZhang
Copy link
Copy Markdown
Member

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 2 pipeline(s).

@FumingZhang
Copy link
Copy Markdown
Member

Azure.azure-cli-extensions (Integration Tests, Build Tests Python310)

FAILED src/aks-preview/azext_aks_preview/tests/latest/test_aks_commands.py::AzureKubernetesServiceScenarioTest::test_aks_approuting_defaultdomain
FAILED src/aks-preview/azext_aks_preview/tests/latest/test_aks_commands.py::AzureKubernetesServiceScenarioTest::test_aks_create_with_defaultdomain
FAILED src/aks-preview/azext_aks_preview/tests/latest/test_managed_cluster_decorator.py::AKSPreviewManagedClusterUpdateDecoratorTestCase::test_enable_container_network_logs

You can resolve the first 2 issues by committing the recording file to your branch, you can find them from pipeline artifact

image

The 3rd issue is being fixed by #9575

@OliverMKing OliverMKing force-pushed the kingoliver/defaultdomain branch from f7b84f0 to 98583be Compare February 10, 2026 20:22
@OliverMKing
Copy link
Copy Markdown
Contributor Author

/azp run

@azure-pipelines
Copy link
Copy Markdown

Commenter does not have sufficient privileges for PR 9578 in repo Azure/azure-cli-extensions

@FumingZhang FumingZhang changed the title add aks default domain az cli commands {AKS} az aks create/update: Add --enable-default-domain and --disable-default-domain parameters to manage the default domain feature for web app routing Feb 11, 2026
19.0.0b22
+++++++
* `az aks create/update`: Automatically enable `--enable-high-log-scale-mode` when `--enable-container-network-logs` is specified. Raises an error if user explicitly disables HLSM while enabling CNL.
* `az aks create/update`: Add `--enable-default-domain` and `--disable-default-domain` parameters to manage the default domain feature for web app routing.
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.

it would be better to create a new version

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Created a new version

@OliverMKing
Copy link
Copy Markdown
Contributor Author

Should be good to go now :). Just need pipelines run

@yonzhan
Copy link
Copy Markdown
Collaborator

yonzhan commented Feb 12, 2026

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 2 pipeline(s).

FumingZhang
FumingZhang previously approved these changes Feb 12, 2026
19.0.0b23
+++++++
* `az aks create/update`: Add `--enable-default-domain` and `--disable-default-domain` parameters to manage the default domain feature for web app routing.

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.

please pull the latest code from the main branch.
there should a feature in the pending session, please involve the changelog under the upcoming version:

Pending
+++++++
* `az aks create/update`: Add `--enable-azure-monitor-logs` support to container network logs validation.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

updated to that. thank you!

@FumingZhang
Copy link
Copy Markdown
Member

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 2 pipeline(s).

@yanzhudd yanzhudd merged commit 179e0c7 into Azure:main Feb 16, 2026
24 checks passed
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