Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add AZ (zone redundancy) support for managed envs [WIP] #100

Closed
Show file tree
Hide file tree
Changes from all 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
2 changes: 2 additions & 0 deletions src/containerapp/azext_containerapp/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ def load_arguments(self, _):
c.argument('platform_reserved_cidr', options_list=['--platform-reserved-cidr'], help='IP range in CIDR notation that can be reserved for environment infrastructure IP addresses. It must not overlap with any other Subnet IP ranges')
c.argument('platform_reserved_dns_ip', options_list=['--platform-reserved-dns-ip'], help='An IP address from the IP range defined by Platform Reserved CIDR that will be reserved for the internal DNS server.')
c.argument('internal_only', arg_type=get_three_state_flag(), options_list=['--internal-only'], help='Boolean indicating the environment only has an internal load balancer. These environments do not have a public static IP resource, therefore must provide infrastructureSubnetResourceId if enabling this property')
with self.argument_context('containerapp env create') as c:
c.argument('zone_redundant', options_list=["--zone-redundant", "-z"], help="Enable zone redundancy on the environment. Cannot be used without --infrastructure-subnet-resource-id")

with self.argument_context('containerapp env update') as c:
c.argument('name', name_type, help='Name of the Container Apps environment.')
Expand Down
4 changes: 4 additions & 0 deletions src/containerapp/azext_containerapp/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -753,7 +753,10 @@ def create_managed_environment(cmd,
internal_only=False,
tags=None,
disable_warnings=False,
zone_redundant=False,
no_wait=False):
if zone_redundant and not infrastructure_subnet_resource_id:
raise RequiredArgumentMissingError("Cannot use --zone-redundant without --infrastructure-subnet-resource-id")

location = location or _get_location_from_resource_group(cmd.cli_ctx, resource_group_name)

Expand All @@ -776,6 +779,7 @@ def create_managed_environment(cmd,
managed_env_def["properties"]["internalLoadBalancerEnabled"] = False
managed_env_def["properties"]["appLogsConfiguration"] = app_logs_config_def
managed_env_def["tags"] = tags
managed_env_def["properties"]["zoneRedundant"] = zone_redundant

if instrumentation_key is not None:
managed_env_def["properties"]["daprAIInstrumentationKey"] = instrumentation_key
Expand Down