Skip to content
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/containerapp/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Release History
upcoming
++++++
* 'az containerapp debug': Open an SSH-like interactive shell within a container app debug console.
* 'az containerapp env java-component': Support more flexible configuration updates with new parameters --set-configurations, --replace-configurations, --remove-configurations and --remove-all-configurations.

1.1.0b1
++++++
Expand Down
42 changes: 21 additions & 21 deletions src/containerapp/azext_containerapp/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -1258,7 +1258,7 @@
az containerapp env java-component spring-cloud-config create -g MyResourceGroup \\
-n MyJavaComponentName \\
--environment MyEnvironment \\
--configuration PropertyName1=Value1 PropertyName2=Value2
--set-configurations PropertyName1=Value1 PropertyName2=Value2

@ShichaoQiu ShichaoQiu Dec 17, 2024

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.

Should we add some examples for this parameter --replace-configurations to describe how to use it?

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.

sure, examples added

"""

helps['containerapp env java-component spring-cloud-config delete'] = """
Expand Down Expand Up @@ -1292,13 +1292,13 @@
az containerapp env java-component spring-cloud-config update -g MyResourceGroup \\
-n MyJavaComponentName \\
--environment MyEnvironment \\
--configuration
--set-configurations
- name: Update a Spring Cloud Config with custom configurations.
text: |
az containerapp env java-component spring-cloud-config update -g MyResourceGroup \\
-n MyJavaComponentName \\
--environment MyEnvironment \\
--configuration PropertyName1=Value1 PropertyName2=Value2
--set-configurations PropertyName1=Value1 PropertyName2=Value2
"""

helps['containerapp env java-component config-server-for-spring'] = """
Expand All @@ -1315,7 +1315,7 @@
az containerapp env java-component config-server-for-spring create -g MyResourceGroup \\
-n MyJavaComponentName \\
--environment MyEnvironment \\
--configuration PropertyName1=Value1 PropertyName2=Value2
--set-configurations PropertyName1=Value1 PropertyName2=Value2
- name: Create a Config Server for Spring with multiple replicas.
text: |
az containerapp env java-component config-server-for-spring create -g MyResourceGroup \\
Expand Down Expand Up @@ -1355,13 +1355,13 @@
az containerapp env java-component config-server-for-spring update -g MyResourceGroup \\
-n MyJavaComponentName \\
--environment MyEnvironment \\
--configuration
--set-configurations
- name: Update a Config Server for Spring with custom configurations.
text: |
az containerapp env java-component config-server-for-spring update -g MyResourceGroup \\
-n MyJavaComponentName \\
--environment MyEnvironment \\
--configuration PropertyName1=Value1 PropertyName2=Value2
--set-configurations PropertyName1=Value1 PropertyName2=Value2
"""

helps['containerapp env java-component spring-cloud-eureka'] = """
Expand All @@ -1384,7 +1384,7 @@
az containerapp env java-component spring-cloud-eureka create -g MyResourceGroup \\
-n MyJavaComponentName \\
--environment MyEnvironment \\
--configuration PropertyName1=Value1 PropertyName2=Value2
--set-configurations PropertyName1=Value1 PropertyName2=Value2
"""

helps['containerapp env java-component spring-cloud-eureka delete'] = """
Expand Down Expand Up @@ -1418,13 +1418,13 @@
az containerapp env java-component spring-cloud-eureka update -g MyResourceGroup \\
-n MyJavaComponentName \\
--environment MyEnvironment \\
--configuration
--set-configurations
- name: Update a Spring Cloud Eureka with custom configurations.
text: |
az containerapp env java-component spring-cloud-eureka update -g MyResourceGroup \\
-n MyJavaComponentName \\
--environment MyEnvironment \\
--configuration PropertyName1=Value1 PropertyName2=Value2
--set-configurations PropertyName1=Value1 PropertyName2=Value2
"""

helps['containerapp env java-component eureka-server-for-spring'] = """
Expand All @@ -1446,7 +1446,7 @@
az containerapp env java-component eureka-server-for-spring create -g MyResourceGroup \\
-n MyJavaComponentName \\
--environment MyEnvironment \\
--configuration PropertyName1=Value1 PropertyName2=Value2
--set-configurations PropertyName1=Value1 PropertyName2=Value2
"""

helps['containerapp env java-component eureka-server-for-spring delete'] = """
Expand Down Expand Up @@ -1480,13 +1480,13 @@
az containerapp env java-component eureka-server-for-spring update -g MyResourceGroup \\
-n MyJavaComponentName \\
--environment MyEnvironment \\
--configuration
--set-configurations

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.

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

- name: Update an Eureka Server for Spring with custom configurations.
text: |
az containerapp env java-component eureka-server-for-spring update -g MyResourceGroup \\
-n MyJavaComponentName \\
--environment MyEnvironment \\
--configuration PropertyName1=Value1 PropertyName2=Value2
--set-configurations PropertyName1=Value1 PropertyName2=Value2
"""

helps['containerapp env java-component admin-for-spring'] = """
Expand All @@ -1508,7 +1508,7 @@
az containerapp env java-component admin-for-spring create -g MyResourceGroup \\
-n MyJavaComponentName \\
--environment MyEnvironment \\
--configuration PropertyName1=Value1 PropertyName2=Value2
--set-configurations PropertyName1=Value1 PropertyName2=Value2
- name: Create an Admin for Spring with multiple replicas.
text: |
az containerapp env java-component admin-for-spring create -g MyResourceGroup \\
Expand Down Expand Up @@ -1548,13 +1548,13 @@
az containerapp env java-component admin-for-spring update -g MyResourceGroup \\
-n MyJavaComponentName \\
--environment MyEnvironment \\
--configuration
--set-configurations

@Greedygre Greedygre Dec 2, 2024

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.

Does this (Delete all configurations of the Admin for Spring) work with --set-configuration?

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.

Base on the _params, they are conflict:

Add or update Java component configuration(s). Other existing configurations are not modified. Configurations must be in format "=" "="..."

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.

The help message is wrong, --set-configurations could not delete configration, has updated to --remove-all-configurations

- name: Update an Admin for Spring with custom configurations.
text: |
az containerapp env java-component admin-for-spring update -g MyResourceGroup \\
-n MyJavaComponentName \\
--environment MyEnvironment \\
--configuration PropertyName1=Value1 PropertyName2=Value2
--set-configurations PropertyName1=Value1 PropertyName2=Value2
"""

helps['containerapp env java-component nacos'] = """
Expand All @@ -1576,7 +1576,7 @@
az containerapp env java-component nacos create -g MyResourceGroup \\
-n MyJavaComponentName \\
--environment MyEnvironment \\
--configuration PropertyName1=Value1 PropertyName2=Value2
--set-configurations PropertyName1=Value1 PropertyName2=Value2
"""

helps['containerapp env java-component nacos delete'] = """
Expand Down Expand Up @@ -1610,13 +1610,13 @@
az containerapp env java-component nacos update -g MyResourceGroup \\
-n MyJavaComponentName \\
--environment MyEnvironment \\
--configuration
--set-configurations

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.

Same as above

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

- name: Update an Nacos with custom configurations.
text: |
az containerapp env java-component nacos update -g MyResourceGroup \\
-n MyJavaComponentName \\
--environment MyEnvironment \\
--configuration PropertyName1=Value1 PropertyName2=Value2
--set-configurations PropertyName1=Value1 PropertyName2=Value2
"""

helps['containerapp env java-component gateway-for-spring'] = """
Expand All @@ -1640,7 +1640,7 @@
-n MyJavaComponentName \\
--environment MyEnvironment \\
--route-yaml MyRouteYamlFilePath \\
--configuration PropertyName1=Value1 PropertyName2=Value2
--set-configurations PropertyName1=Value1 PropertyName2=Value2
- name: Create a Gateway for Spring with multiple replicas.
text: |
az containerapp env java-component gateway-for-spring create -g MyResourceGroup \\
Expand Down Expand Up @@ -1687,13 +1687,13 @@
az containerapp env java-component gateway-for-spring update -g MyResourceGroup \\
-n MyJavaComponentName \\
--environment MyEnvironment \\
--configuration
--set-configurations

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.

Same as above

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

- name: Update a Gateway for Spring with custom configurations.
text: |
az containerapp env java-component gateway-for-spring update -g MyResourceGroup \\
-n MyJavaComponentName \\
--environment MyEnvironment \\
--configuration PropertyName1=Value1 PropertyName2=Value2
--set-configurations PropertyName1=Value1 PropertyName2=Value2
"""

# Container Apps Telemetry Commands
Expand Down
6 changes: 5 additions & 1 deletion src/containerapp/azext_containerapp/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,11 @@ def load_arguments(self, _):
c.argument('resource_group_name', arg_type=resource_group_name_type, id_part=None)
c.argument('service_bindings', nargs='*', options_list=['--bind'], help="Space separated list of services, bindings or other Java components to be connected to this Java Component. e.g. SVC_NAME1[:BIND_NAME1] SVC_NAME2[:BIND_NAME2]...")
c.argument('unbind_service_bindings', nargs='*', options_list=['--unbind'], help="Space separated list of services, bindings or Java components to be removed from this Java Component. e.g. BIND_NAME1...")
c.argument('configuration', nargs="*", help="Java component configuration. Configuration must be in format \"<propertyName>=<value>\" \"<propertyName>=<value>\"...")
c.argument('configuration', nargs="*", help="Java component configuration. Configuration must be in format \"<propertyName>=<value>\" \"<propertyName>=<value>\"...", deprecate_info=c.deprecate(target="--configuration", redirect='--[set|replace|remove|remove-all]-configurations', hide=True))
c.argument('set_configurations', nargs="*", options_list=['--set-configurations', '--set-configs'], help="Add or update Java component configuration(s). Other existing configurations are not modified. Configurations must be in format \"<propertyName>=<value>\" \"<propertyName>=<value>\"...")
c.argument('replace_configurations', nargs="*", options_list=['--replace-configurations', '--replace-configs'], help="Replace Java component configuration(s), Other existing configurations are removed. Configurations must be in format \"<propertyName>=<value>\" \"<propertyName>=<value>\"...")
c.argument('remove_configurations', nargs="*", options_list=['--remove-configurations', '--remove-configs'], help="Remove Java component configuration(s). Specify configuration names separated by space, in format \"<propertyName>\" \"<propertyName>\"...")
c.argument('remove_all_configurations', arg_type=get_three_state_flag(), options_list=['--remove-all-configurations', '--remove-all-configs'], help="Remove all Java component configuration(s).")
Comment on lines +377 to +378

@zhoxing-ms zhoxing-ms Jan 7, 2025

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.

remove_configurations
remove_all_configurations

Because these two parameters are similar, can they be merged into one parameter? For example, when --remove-configurations does not specify a specific value, the all the configurations are deleted

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.

Since az containerapp includes parameters like [--remove-all-env-vars] and [--remove-env-vars], I think we should align with that.

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.

OK, got it~

c.argument('min_replicas', type=int, help="Minimum number of replicas to run for the Java component.")
c.argument('max_replicas', type=int, help="Maximum number of replicas to run for the Java component.")
c.argument('route_yaml', options_list=['--route-yaml', '--yaml'], help="Path to a .yaml file with the configuration of a Spring Cloud Gateway route. For an example, see https://aka.ms/gateway-for-spring-routes-yaml")
Expand Down
Loading