Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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 @@ -8,6 +8,7 @@ upcoming
* Add command group 'az containerapp connected-env', support show/list/delete/create connected environment
* 'az containerapp create': support --source and --repo properties
* 'az containerapp update': support --source property
* 'az containerapp env': --infrastructure-resource-group, supports custom rg name for byovnet env creations in WP enabled envs

0.3.39
++++++
Expand Down
3 changes: 2 additions & 1 deletion src/containerapp/azext_containerapp/_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
"vnetConfiguration": None, # VnetConfiguration
"appLogsConfiguration": None,
"customDomainConfiguration": None, # CustomDomainConfiguration,
"workloadProfiles": None
"workloadProfiles": None,
"InfrastructureResourceGroup": None
}
}

Expand Down
1 change: 1 addition & 0 deletions src/containerapp/azext_containerapp/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ 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')
c.argument('infrastructure_resource_group', options_list=['--infrastructure-resource-group', '-i'], help='Name for resource group that will contain infrastructure resources. If not provided, a resource group name will be generated.', is_preview=True)
with self.argument_context('containerapp env', arg_group='Custom Domain') as c:
c.argument('hostname', options_list=['--custom-domain-dns-suffix', '--dns-suffix'], help='The DNS suffix for the environment\'s custom domain.')
c.argument('certificate_file', options_list=['--custom-domain-certificate-file', '--certificate-file'], help='The filepath of the certificate file (.pfx or .pem) for the environment\'s custom domain. To manage certificates for container apps, use `az containerapp env certificate`.')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@ def get_argument_min_nodes(self):
def get_argument_max_nodes(self):
return self.get_param("max_nodes")

def get_argument_infrastructure_resource_group(self):
return self.get_param("infrastructure_resource_group")
Comment thread
Juancpani marked this conversation as resolved.
Outdated


class ContainerAppEnvCreateDecorator(ContainerAppEnvDecorator):
def __init__(self, cmd: AzCliCommand, client: Any, raw_parameters: Dict, models: str):
Expand Down Expand Up @@ -345,6 +348,27 @@ def post_process(self, r):

class ContainerappEnvPreviewCreateDecorator(ContainerAppEnvCreateDecorator):

def construct_payload(self):
super().construct_payload()

self.set_up_infrastructure_resource_group()

def validate_arguments(self):
super().validate_arguments()

# Infrastructure Resource Group
if self.get_argument_infrastructure_resource_group() is not None:
if not self.get_argument_infrastructure_subnet_resource_id():
raise RequiredArgumentMissingError("Cannot use --infrastructure-resource-group/-i without "
"--infrastructure-subnet-resource-id/-s")
if not self.get_argument_enable_workload_profiles():
raise RequiredArgumentMissingError("Cannot use --infrastructure-resource-group/-i without "
"--enable-workload-profiles/-w")

def set_up_infrastructure_resource_group(self):
if self.get_argument_enable_workload_profiles() and self.get_argument_infrastructure_subnet_resource_id() is not None:
self.managed_env_def["properties"]["InfrastructureResourceGroup"] = self.get_argument_infrastructure_resource_group()
Comment thread
Juancpani marked this conversation as resolved.

def set_up_workload_profiles(self):
if self.get_argument_enable_workload_profiles():
self.managed_env_def["properties"]["workloadProfiles"] = get_default_workload_profiles(self.cmd, self.get_argument_location())
Expand Down
1 change: 1 addition & 0 deletions src/containerapp/azext_containerapp/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -709,6 +709,7 @@ def create_managed_environment(cmd,
location=None,
instrumentation_key=None,
infrastructure_subnet_resource_id=None,
infrastructure_resource_group=None,
docker_bridge_cidr=None,
platform_reserved_cidr=None,
platform_reserved_dns_ip=None,
Expand Down
Loading