Skip to content
Merged
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
1 change: 1 addition & 0 deletions src/containerapp/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ upcoming
* Add command group 'az containerapp connected-env certificate', support list/upload/delete connectedEnvironments certificate
* Add command group 'az containerapp connected-env dapr-component', support list/show/set/remove connectedEnvironments daprComponents
* Add command group 'az containerapp connected-env storage', support list/show/set/remove connectedEnvironments storage
* '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 @@ -344,6 +344,29 @@ def post_process(self, r):


class ContainerappEnvPreviewCreateDecorator(ContainerAppEnvCreateDecorator):
def get_argument_infrastructure_resource_group(self):
return self.get_param("infrastructure_resource_group")

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():
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 @@ -697,6 +697,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