Skip to content

Commit a8bf5ef

Browse files
TratcherGreedygre
andauthored
[Containerapp] az containerapp env http-route-config/premium-ingress: Remove GA commands which exist in azure-cli version 2.79.0 (#9265)
* Remove GA ingress, routing * Remove unused reference * Style * Update HISTORY.rst with upcoming changes Updated the HISTORY.rst to reflect changes in CLI commands and dependencies. * Update minimum CLI core version to 2.79.0 * Update HISTORY.rst with recent command changes --------- Co-authored-by: Greedygre <[email protected]>
1 parent 4ba36d5 commit a8bf5ef

14 files changed

+20
-26687
lines changed

src/containerapp/HISTORY.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ upcoming
66
++++++
77
* 'az containerapp env premium-ingress add/update': remove `--min-replicas` and `--max-replicas`
88
* 'az containerapp sessionpool create': Add `Shell` container type
9+
* Update azure cli dependency version >= "2.79.0"
10+
* 'az containerapp env http-route-config/premium-ingress': Remove GA commands which exist in azure-cli version 2.79.0
911

1012
1.2.0b4
1113
++++++

src/containerapp/azext_containerapp/_help.py

Lines changed: 0 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -2341,102 +2341,3 @@
23412341
text: |
23422342
az containerapp label-history show -n my-containerapp -g MyResourceGroup --label LabelName
23432343
"""
2344-
2345-
helps['containerapp env http-route-config'] = """
2346-
type: group
2347-
short-summary: Commands to manage environment level http routing.
2348-
"""
2349-
2350-
helps['containerapp env http-route-config list'] = """
2351-
type: command
2352-
short-summary: List the http route configs in the environment.
2353-
examples:
2354-
- name: List the http route configs in the environment.
2355-
text: |
2356-
az containerapp env http-route-config list -g MyResourceGroup -n MyEnvironment
2357-
"""
2358-
2359-
helps['containerapp env http-route-config create'] = """
2360-
type: command
2361-
short-summary: Create a new http route config.
2362-
examples:
2363-
- name: Create a new route from a yaml file.
2364-
text: |
2365-
az containerapp env http-route-config create -g MyResourceGroup -n MyEnvironment -r configname --yaml config.yaml
2366-
"""
2367-
2368-
helps['containerapp env http-route-config update'] = """
2369-
type: command
2370-
short-summary: Update a http route config.
2371-
examples:
2372-
- name: Update a route in the environment from a yaml file.
2373-
text: |
2374-
az containerapp env http-route-config update -g MyResourceGroup -n MyEnvironment -r configname --yaml config.yaml
2375-
"""
2376-
2377-
helps['containerapp env http-route-config show'] = """
2378-
type: command
2379-
short-summary: Show a http route config.
2380-
examples:
2381-
- name: Show a route in the environment.
2382-
text: |
2383-
az containerapp env http-route-config show -g MyResourceGroup -n MyEnvironment -r configname
2384-
"""
2385-
2386-
helps['containerapp env http-route-config delete'] = """
2387-
type: command
2388-
short-summary: Delete a http route config.
2389-
examples:
2390-
- name: Delete a route from the environment.
2391-
text: |
2392-
az containerapp env http-route-config delete -g MyResourceGroup -n MyEnvironment -r configname
2393-
"""
2394-
2395-
helps['containerapp env premium-ingress show'] = """
2396-
type: command
2397-
short-summary: Show the premium ingress settings for the environment.
2398-
examples:
2399-
- name: Show the premium ingress settings for the environment.
2400-
text: |
2401-
az containerapp env premium-ingress show -g MyResourceGroup -n MyEnvironment
2402-
"""
2403-
2404-
helps['containerapp env premium-ingress'] = """
2405-
type: group
2406-
short-summary: Configure premium ingress settings for the environment.
2407-
long-summary: |
2408-
Premium ingress settings apply to all applications in the environment. They allow moving the ingress instances to a workload profile and scaling them beyond the system defaults to enable high traffic workloads. Other settings include request idle timeouts, header count limits, and the termination grace period.
2409-
examples:
2410-
- name: Enable premium ingress for the environment.
2411-
text: |
2412-
az containerapp env premium-ingress add -g MyResourceGroup -n MyEnvironment -w WorkloadProfileName
2413-
"""
2414-
2415-
helps['containerapp env premium-ingress add'] = """
2416-
type: command
2417-
short-summary: Enable the premium ingress settings for the environment.
2418-
long-summary: |
2419-
Unspecified optional parameters will be cleared from any existing configuration.
2420-
examples:
2421-
- name: Add the premium ingress settings for the environment.
2422-
text: |
2423-
az containerapp env premium-ingress add -g MyResourceGroup -n MyEnvironment -w WorkloadProfileName
2424-
"""
2425-
2426-
helps['containerapp env premium-ingress update'] = """
2427-
type: command
2428-
short-summary: Update the premium ingress settings for the environment.
2429-
examples:
2430-
- name: Update the workload profile used for premium ingress.
2431-
text: |
2432-
az containerapp env premium-ingress update -g MyResourceGroup -n MyEnvironment -w WorkloadProfileName
2433-
"""
2434-
2435-
helps['containerapp env premium-ingress remove'] = """
2436-
type: command
2437-
short-summary: Remove the ingress settings and restores the system to default values.
2438-
examples:
2439-
- name: Reset the ingress settings for the environment to its default values
2440-
text: |
2441-
az containerapp env premium-ingress remove -g MyResourceGroup -n MyEnvironment
2442-
"""

src/containerapp/azext_containerapp/_params.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -92,12 +92,6 @@ def load_arguments(self, _):
9292
c.argument('logs_dynamic_json_columns', options_list=['--logs-dynamic-json-columns', '-j'], arg_type=get_three_state_flag(),
9393
help='Boolean indicating whether to parse json string log into dynamic json columns. Only work for destination log-analytics.', is_preview=True)
9494

95-
# HttpRouteConfig
96-
with self.argument_context('containerapp env http-route-config') as c:
97-
c.argument('http_route_config_name', options_list=['--http-route-config-name', '-r'], help="The name of the http route configuration.")
98-
c.argument('yaml', help="The path to the YAML input file.")
99-
c.argument('name', id_part=None)
100-
10195
# Telemetry
10296
with self.argument_context('containerapp env telemetry') as c:
10397
c.argument('name', id_part=None)
@@ -526,11 +520,3 @@ def load_arguments(self, _):
526520
with self.argument_context('containerapp revision set-mode') as c:
527521
c.argument('mode', arg_type=get_enum_type(['single', 'multiple', 'labels']), help="The active revisions mode for the container app.")
528522
c.argument('target_label', help="The label to apply to new revisions. Required for revision mode 'labels'.", is_preview=True)
529-
530-
with self.argument_context('containerapp env premium-ingress') as c:
531-
c.argument('resource_group_name', arg_type=resource_group_name_type, id_part=None)
532-
c.argument('name', options_list=['--name', '-n'], help="The name of the managed environment.")
533-
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.")
534-
c.argument('termination_grace_period', options_list=['--termination-grace-period', '-t'], type=int, help="Time in seconds to drain requests during ingress shutdown. Default 500, minimum 0, maximum 3600.")
535-
c.argument('request_idle_timeout', options_list=['--request-idle-timeout'], type=int, help="Timeout in minutes for idle requests. Default 4, minimum 4, maximum 30.")
536-
c.argument('header_count_limit', options_list=['--header-count-limit'], type=int, help="Limit of http headers per request. Default 100, minimum 1.")
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"azext.isPreview": true,
3-
"azext.minCliCoreVersion": "2.62.0"
4-
}
3+
"azext.minCliCoreVersion": "2.79.0"
4+
}

src/containerapp/azext_containerapp/commands.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,6 @@ def load_command_table(self, args):
3939
g.custom_command('delete', 'delete_managed_environment', supports_no_wait=True, confirmation=True, exception_handler=ex_handler_factory())
4040
g.custom_command('update', 'update_managed_environment', supports_no_wait=True, exception_handler=ex_handler_factory())
4141

42-
with self.command_group('containerapp env http-route-config', is_preview=True) as g:
43-
g.custom_show_command('show', 'show_http_route_config')
44-
g.custom_command('list', 'list_http_route_configs')
45-
g.custom_command('create', 'create_http_route_config', exception_handler=ex_handler_factory())
46-
g.custom_command('update', 'update_http_route_config', exception_handler=ex_handler_factory())
47-
g.custom_command('delete', 'delete_http_route_config', confirmation=True, exception_handler=ex_handler_factory())
48-
4942
with self.command_group('containerapp job') as g:
5043
g.custom_show_command('show', 'show_containerappsjob')
5144
g.custom_command('list', 'list_containerappsjob')
@@ -294,9 +287,3 @@ def load_command_table(self, args):
294287
with self.command_group('containerapp revision label') as g:
295288
g.custom_command('add', 'add_revision_label')
296289
g.custom_command('remove', 'remove_revision_label')
297-
298-
with self.command_group('containerapp env premium-ingress', is_preview=True) as g:
299-
g.custom_show_command('show', 'show_environment_premium_ingress')
300-
g.custom_command('add', 'add_environment_premium_ingress')
301-
g.custom_command('update', 'update_environment_premium_ingress')
302-
g.custom_command('remove', 'remove_environment_premium_ingress', confirmation=True)

src/containerapp/azext_containerapp/custom.py

Lines changed: 0 additions & 158 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@
115115
SessionCustomContainerPreviewClient,
116116
DotNetComponentPreviewClient,
117117
MaintenanceConfigPreviewClient,
118-
HttpRouteConfigPreviewClient,
119118
LabelHistoryPreviewClient
120119
)
121120
from ._dev_service_utils import DevServiceUtils
@@ -3634,60 +3633,6 @@ def containerapp_debug(cmd, resource_group_name, name, container=None, revision=
36343633
conn.send(SSH_CTRL_C_MSG)
36353634

36363635

3637-
def create_http_route_config(cmd, resource_group_name, name, http_route_config_name, yaml):
3638-
_validate_subscription_registered(cmd, CONTAINER_APPS_RP)
3639-
yaml_http_route_config = load_yaml_file(yaml)
3640-
# check if the type is dict
3641-
if not isinstance(yaml_http_route_config, dict):
3642-
raise ValidationError('Invalid YAML provided. Please see https://aka.ms/azure-container-apps-yaml for a valid YAML spec.')
3643-
3644-
http_route_config_envelope = {"properties": yaml_http_route_config}
3645-
3646-
try:
3647-
return HttpRouteConfigPreviewClient.create(cmd, resource_group_name, name, http_route_config_name, http_route_config_envelope)
3648-
except Exception as e:
3649-
handle_raw_exception(e)
3650-
3651-
3652-
def update_http_route_config(cmd, resource_group_name, name, http_route_config_name, yaml):
3653-
_validate_subscription_registered(cmd, CONTAINER_APPS_RP)
3654-
yaml_http_route_config = load_yaml_file(yaml)
3655-
# check if the type is dict
3656-
if not isinstance(yaml_http_route_config, dict):
3657-
raise ValidationError('Invalid YAML provided. Please see https://aka.ms/azure-container-apps-yaml for a valid YAML spec.')
3658-
3659-
http_route_config_envelope = {"properties": yaml_http_route_config}
3660-
3661-
try:
3662-
return HttpRouteConfigPreviewClient.update(cmd, resource_group_name, name, http_route_config_name, http_route_config_envelope)
3663-
except Exception as e:
3664-
handle_raw_exception(e)
3665-
3666-
3667-
def list_http_route_configs(cmd, resource_group_name, name):
3668-
_validate_subscription_registered(cmd, CONTAINER_APPS_RP)
3669-
try:
3670-
return HttpRouteConfigPreviewClient.list(cmd, resource_group_name, name)
3671-
except Exception as e:
3672-
handle_raw_exception(e)
3673-
3674-
3675-
def show_http_route_config(cmd, resource_group_name, name, http_route_config_name):
3676-
_validate_subscription_registered(cmd, CONTAINER_APPS_RP)
3677-
try:
3678-
return HttpRouteConfigPreviewClient.show(cmd, resource_group_name, name, http_route_config_name)
3679-
except Exception as e:
3680-
handle_raw_exception(e)
3681-
3682-
3683-
def delete_http_route_config(cmd, resource_group_name, name, http_route_config_name):
3684-
_validate_subscription_registered(cmd, CONTAINER_APPS_RP)
3685-
try:
3686-
return HttpRouteConfigPreviewClient.delete(cmd, resource_group_name, name, http_route_config_name)
3687-
except Exception as e:
3688-
handle_raw_exception(e)
3689-
3690-
36913636
def list_label_history(cmd, resource_group_name, name):
36923637
_validate_subscription_registered(cmd, CONTAINER_APPS_RP)
36933638
try:
@@ -3857,106 +3802,3 @@ def remove_revision_label(cmd, resource_group_name, name, label, no_wait=False):
38573802
return r['properties']['configuration']['ingress']['traffic']
38583803
except Exception as e:
38593804
handle_raw_exception(e)
3860-
3861-
3862-
def show_environment_premium_ingress(cmd, name, resource_group_name):
3863-
_validate_subscription_registered(cmd, CONTAINER_APPS_RP)
3864-
3865-
try:
3866-
env = ManagedEnvironmentPreviewClient.show(cmd, resource_group_name, name)
3867-
ingress_config = safe_get(env, "properties", "ingressConfiguration")
3868-
if not ingress_config:
3869-
return {"message": "No premium ingress configuration found for this environment, using default values."}
3870-
3871-
return ingress_config
3872-
except Exception as e:
3873-
handle_raw_exception(e)
3874-
3875-
3876-
def add_environment_premium_ingress(cmd, name, resource_group_name, workload_profile_name, termination_grace_period=None, request_idle_timeout=None, header_count_limit=None, no_wait=False):
3877-
_validate_subscription_registered(cmd, CONTAINER_APPS_RP)
3878-
3879-
try:
3880-
ManagedEnvironmentPreviewClient.show(cmd, resource_group_name, name)
3881-
env_patch = {}
3882-
ingress_config = {}
3883-
safe_set(env_patch, "properties", "ingressConfiguration", value=ingress_config)
3884-
3885-
# Required
3886-
ingress_config["workloadProfileName"] = workload_profile_name
3887-
# Optional, remove if None
3888-
ingress_config["terminationGracePeriodSeconds"] = termination_grace_period
3889-
ingress_config["requestIdleTimeout"] = request_idle_timeout
3890-
ingress_config["headerCountLimit"] = header_count_limit
3891-
3892-
result = ManagedEnvironmentPreviewClient.update(
3893-
cmd=cmd,
3894-
resource_group_name=resource_group_name,
3895-
name=name,
3896-
managed_environment_envelope=env_patch,
3897-
no_wait=no_wait
3898-
)
3899-
3900-
return safe_get(result, "properties", "ingressConfiguration")
3901-
3902-
except Exception as e:
3903-
handle_raw_exception(e)
3904-
3905-
3906-
def update_environment_premium_ingress(cmd, name, resource_group_name, workload_profile_name=None, termination_grace_period=None, request_idle_timeout=None, header_count_limit=None, no_wait=False):
3907-
_validate_subscription_registered(cmd, CONTAINER_APPS_RP)
3908-
3909-
try:
3910-
ManagedEnvironmentPreviewClient.show(cmd, resource_group_name, name)
3911-
env_patch = {}
3912-
ingress_config = {}
3913-
3914-
if workload_profile_name is not None:
3915-
ingress_config["workloadProfileName"] = workload_profile_name
3916-
if termination_grace_period is not None:
3917-
ingress_config["terminationGracePeriodSeconds"] = termination_grace_period
3918-
if request_idle_timeout is not None:
3919-
ingress_config["requestIdleTimeout"] = request_idle_timeout
3920-
if header_count_limit is not None:
3921-
ingress_config["headerCountLimit"] = header_count_limit
3922-
3923-
# Only add ingressConfiguration to the patch if any values were specified
3924-
if ingress_config:
3925-
safe_set(env_patch, "properties", "ingressConfiguration", value=ingress_config)
3926-
else:
3927-
return {"message": "No changes specified for premium ingress configuration"}
3928-
3929-
# Update the environment with the patched ingress configuration
3930-
result = ManagedEnvironmentPreviewClient.update(
3931-
cmd=cmd,
3932-
resource_group_name=resource_group_name,
3933-
name=name,
3934-
managed_environment_envelope=env_patch,
3935-
no_wait=no_wait
3936-
)
3937-
3938-
return safe_get(result, "properties", "ingressConfiguration")
3939-
3940-
except Exception as e:
3941-
handle_raw_exception(e)
3942-
3943-
3944-
def remove_environment_premium_ingress(cmd, name, resource_group_name, no_wait=False):
3945-
_validate_subscription_registered(cmd, CONTAINER_APPS_RP)
3946-
3947-
try:
3948-
ManagedEnvironmentPreviewClient.show(cmd, resource_group_name, name)
3949-
env_patch = {}
3950-
# Remove the whole section to restore defaults
3951-
safe_set(env_patch, "properties", "ingressConfiguration", value=None)
3952-
3953-
ManagedEnvironmentPreviewClient.update(
3954-
cmd=cmd,
3955-
resource_group_name=resource_group_name,
3956-
name=name,
3957-
managed_environment_envelope=env_patch,
3958-
no_wait=no_wait
3959-
)
3960-
3961-
except Exception as e:
3962-
handle_raw_exception(e)

0 commit comments

Comments
 (0)