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

[ContainerApp] Fix #501: az containerapp create --allow-insecure: Add Flag to Allow Container App Insecure Ingress #6555

Merged
merged 13 commits into from
Aug 9, 2023
1 change: 1 addition & 0 deletions src/containerapp/azext_containerapp/_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@
"targetPort": None,
"transport": None, # 'auto', 'http', 'http2', 'tcp'
"exposedPort": None,
"allowInsecure": False,
"traffic": None, # TrafficWeight
"customDomains": None, # [CustomDomain]
"ipSecurityRestrictions": None, # [IPSecurityRestrictions]
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 @@ -115,6 +115,7 @@ def load_arguments(self, _):
c.argument('target_port', type=int, validator=validate_target_port, help="The application port used for ingress traffic.")
c.argument('transport', arg_type=get_enum_type(['auto', 'http', 'http2', 'tcp']), help="The transport protocol used for ingress traffic.")
c.argument('exposed_port', type=int, help="Additional exposed port. Only supported by tcp transport protocol. Must be unique per environment if the app ingress is external.")
c.argument('allow_insecure', arg_type=get_three_state_flag(), help='Allow insecure connections for ingress traffic.')

with self.argument_context('containerapp create') as c:
c.argument('traffic_weights', nargs='*', options_list=['--traffic-weight'], help="A list of revision weight(s) for the container app. Space-separated values in 'revision_name=weight' format. For latest revision, use 'latest=weight'")
Expand Down
4 changes: 4 additions & 0 deletions src/containerapp/azext_containerapp/containerapp_decorator.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,9 @@ def get_argument_transport(self):
def get_argument_ingress(self):
return self.get_param("ingress")

def get_argument_allow_insecure(self):
return self.get_param("allow_insecure")

def get_argument_revisions_mode(self):
return self.get_param("revisions_mode")

Expand Down Expand Up @@ -388,6 +391,7 @@ def construct_containerapp(self):
ingress_def["targetPort"] = self.get_argument_target_port()
ingress_def["transport"] = self.get_argument_transport()
ingress_def["exposedPort"] = self.get_argument_exposed_port() if self.get_argument_transport() == "tcp" else None
ingress_def["allowInsecure"] = self.get_argument_allow_insecure()

secrets_def = None
if self.get_argument_secrets() is not None:
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 @@ -420,6 +420,7 @@ def create_containerapp(cmd,
exposed_port=None,
transport="auto",
ingress=None,
allow_insecure=False,
revisions_mode="single",
secrets=None,
env_vars=None,
Expand Down