Skip to content

Conversation

@Tratcher
Copy link
Contributor

Due to a design change these two parameters are no longer needed. Ingress will instead scale to one large instance per workload profile node. This redoes #9023 with deprecation instead of removal.

Contributes to https://msazure.visualstudio.com/Antares/_workitems/edit/33117299


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

Related command

az containerapp env premium-ingress add/update

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

Copilot AI review requested due to automatic review settings July 30, 2025 17:13
@azure-client-tools-bot-prd
Copy link

azure-client-tools-bot-prd bot commented Jul 30, 2025

⚠️Azure CLI Extensions Breaking Change Test
⚠️containerapp
rule cmd_name rule_message suggest_message
⚠️ 1008 - ParaPropAdd containerapp env premium-ingress add cmd containerapp env premium-ingress add update parameter max_replicas: added property deprecate_info_expiration=2.78.0
⚠️ 1008 - ParaPropAdd containerapp env premium-ingress add cmd containerapp env premium-ingress add update parameter max_replicas: added property deprecate_info_hide=True
⚠️ 1008 - ParaPropAdd containerapp env premium-ingress add cmd containerapp env premium-ingress add update parameter max_replicas: added property deprecate_info_target=max_replicas
⚠️ 1009 - ParaPropRemove containerapp env premium-ingress add cmd containerapp env premium-ingress add update parameter max_replicas: removed property required=True
⚠️ 1008 - ParaPropAdd containerapp env premium-ingress add cmd containerapp env premium-ingress add update parameter min_replicas: added property deprecate_info_expiration=2.78.0
⚠️ 1008 - ParaPropAdd containerapp env premium-ingress add cmd containerapp env premium-ingress add update parameter min_replicas: added property deprecate_info_hide=True
⚠️ 1008 - ParaPropAdd containerapp env premium-ingress add cmd containerapp env premium-ingress add update parameter min_replicas: added property deprecate_info_target=min_replicas
⚠️ 1009 - ParaPropRemove containerapp env premium-ingress add cmd containerapp env premium-ingress add update parameter min_replicas: removed property required=True
⚠️ 1008 - ParaPropAdd containerapp env premium-ingress update cmd containerapp env premium-ingress update update parameter max_replicas: added property deprecate_info_expiration=2.78.0
⚠️ 1008 - ParaPropAdd containerapp env premium-ingress update cmd containerapp env premium-ingress update update parameter max_replicas: added property deprecate_info_hide=True
⚠️ 1008 - ParaPropAdd containerapp env premium-ingress update cmd containerapp env premium-ingress update update parameter max_replicas: added property deprecate_info_target=max_replicas
⚠️ 1008 - ParaPropAdd containerapp env premium-ingress update cmd containerapp env premium-ingress update update parameter min_replicas: added property deprecate_info_expiration=2.78.0
⚠️ 1008 - ParaPropAdd containerapp env premium-ingress update cmd containerapp env premium-ingress update update parameter min_replicas: added property deprecate_info_hide=True
⚠️ 1008 - ParaPropAdd containerapp env premium-ingress update cmd containerapp env premium-ingress update update parameter min_replicas: added property deprecate_info_target=min_replicas

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

Hi @Tratcher,
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
Collaborator

yonzhan commented Jul 30, 2025

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

@github-actions
Copy link

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>

Copy link
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 PR deprecates the --min-replicas and --max-replicas parameters from the az containerapp env premium-ingress commands due to a design change where ingress will now scale to one large instance per workload profile node instead of using these explicit replica settings.

  • Deprecated the min_replicas and max_replicas parameters in the command definitions
  • Removed scale-related logic from the add and update functions for premium ingress
  • Updated tests to remove assertions for scale properties and removed scale parameters from test commands

Reviewed Changes

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

Show a summary per file
File Description
_params.py Added deprecation warnings to min_replicas and max_replicas parameters
custom.py Removed scale configuration logic from add/update premium ingress functions
test_containerapp_commands.py Updated tests to remove scale parameters and related assertions
_help.py Updated help examples to remove deprecated scale parameters
HISTORY.rst Added changelog entry documenting the parameter deprecation

@github-actions
Copy link

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

Hi @Tratcher

Release Suggestions

Module: containerapp

  • Update VERSION to 1.2.0b4 in src/containerapp/setup.py

Notes

env_patch = {}
ingress_config = {}
safe_set(env_patch, "properties", "ingressConfiguration", value=ingress_config)
scale = {}
Copy link
Contributor

Choose a reason for hiding this comment

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

pls keep the code until parameter is removed. Currently they are in deprecated mode and hidden to customers.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The control plane change has already fully deployed, the properties are ignored and there's no reason to send them.

c.argument('workload_profile_name', options_list=['--workload-profile-name', '-w'], help="The workload profile to run ingress replicas on. This profile must not be shared with any container app or job.")
c.argument('min_replicas', options_list=['--min-replicas'], type=int, help="Minimum number of replicas to run. Default 2, minimum 2.")
c.argument('max_replicas', options_list=['--max-replicas'], type=int, help="Maximum number of replicas to run. Default 10. The upper limit is the maximum cores available in the workload profile.")
c.argument('min_replicas', options_list=['--min-replicas'], type=int, deprecate_info=c.deprecate(hide=True, expiration='1.3.0b1'), help="The workload profile minimum instances is used instead.")
Copy link
Contributor Author

@Tratcher Tratcher Aug 11, 2025

Choose a reason for hiding this comment

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

Parameter: containerapp env premium-ingress add, max_replicas - Deprecated parameter is expired and should be removed.

??

@yonzhan
Copy link
Collaborator

yonzhan commented Aug 11, 2025

Please fix CI issues

@Tratcher
Copy link
Contributor Author

@yonzhan The error seems incorrect, do you know who can help troubleshoot the deprecate logic?

@Greedygre
Copy link
Contributor

Hi @Tratcher
The CI failed.
About the linter failed

-  FAIL - HIGH severity: expired_parameter
    Parameter: containerapp env premium-ingress add, `max_replicas` - Deprecated parameter is expired and should be removed.
    Parameter: containerapp env premium-ingress add, `min_replicas` - Deprecated parameter is expired and should be removed.
    Parameter: containerapp env premium-ingress update, `max_replicas` - Deprecated parameter is expired and should be removed.
    Parameter: containerapp env premium-ingress update, `min_replicas` - Deprecated parameter is expired and should be removed.

This is cause by
c.argument('max_replicas', options_list=['--max-replicas'], type=int, deprecate_info=c.deprecate(hide=True, expiration='1.3.0b1'), help="The workload profile maximum instances is used instead.")

The version value for expiration need to be a azure-cli version, you can set to 2.78.0, which will be released on Oct, refer: https://github.com/Azure/azure-cli/milestone/160

About the integration tests failed.

FAILED src/containerapp/azext_containerapp/tests/latest/test_containerapp_commands.py::ContainerappOtherPropertyTests::test_containerapp_get_customdomainverificationid_e2e
FAILED src/containerapp/azext_containerapp/tests/latest/test_containerapp_env_commands.py::ContainerappEnvIdentityTests::test_containerapp_env_msi_certificate
FAILED src/containerapp/azext_containerapp/tests/latest/test_containerapp_env_commands.py::ContainerappEnvIdentityTests::test_containerapp_env_msi_custom_domains

You can refer the CLI test doc:

Update Test development environment
Sometimes the test can pass locally in playback mode, but fail in the CI pipeline with this kind of api-version change errors:

For example:

Microsoft.DBforPostgreSQL update the api-version from 2023-03-01-preview to 2023-06-01-preview in dev branch with lastest code, but the azure-cli in local repository is not updated yet, so the test will fail with the following error:

except CannotOverwriteExistingCassetteException as ex:

  raise AssertionError(ex)

E AssertionError: Can't overwrite existing cassette ('/mnt/vss/_work/1/s/src/containerapp/azext_containerapp/tests/latest/recordings/test_containerapp_managed_service_binding_e2e.yaml') in your current record mode ('once').
E No match for the request (<Request (POST) https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus/checkNameAvailability?api-version=2023-06-01-preview>) was found.
E Found 1 similar requests with 1 different matcher(s) :
E
E 1 - (<Request (POST) https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus/checkNameAvailability?api-version=2023-03-01-preview>)..)
E Matchers succeeded : ['method', 'scheme', 'host', 'port', 'path']
E Matchers failed :
E _custom_request_query_matcher - assertion failure :
E None
To fix this error need to update the test development environment with lastest code:

Pull the lastest code from dev branch for azure-cli
In the extension virtual env, run azdev setup --cli /path/to/azure-cli --repo /path/to/azure-cli-extensions
Rerun the failed test lively with --live, it will update the recording file automatically
To comfirm the recording works fine: Rerun the failed test in playback mode without --live (In CLI CI pipeline, it will run in playback mode base on the recording files)

@Tratcher
Copy link
Contributor Author

I've reverted the test file changes, they're unrelated to this PR.

@Greedygre
Copy link
Contributor

Hi @Juliehzl
Please take a look, thanks

@zhoxing-ms zhoxing-ms merged commit 5bbdbab into Azure:main Aug 14, 2025
24 checks passed
@Tratcher Tratcher deleted the user/chrross/ingressnoscale branch August 22, 2025 05:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Auto-Assign Auto assign by bot ContainerApp

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants