Skip to content
Merged
1 change: 1 addition & 0 deletions src/containerapp/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ upcoming
* 'az containerapp show-custom-domain-verification-id': show verfication id used for binding custom domain
* 'az containerapp list-usages': list usages in subscription
* 'az containerapp env list-usages': list usages in environment
* 'az containerapp update': --yaml support property additionalPortMappings for api-version 2023-05-02-preview

0.3.37
++++++
Expand Down
23 changes: 23 additions & 0 deletions src/containerapp/azext_containerapp/_client_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,29 @@ def handle_non_404_exception(e):
raise e


def handle_non_404_status_code_exception(e):
import json

if hasattr(e, 'status_code') and e.status_code == 404:
return e

string_err = str(e)
if "{" in string_err and "}" in string_err:
json_error = string_err[string_err.index("{"):string_err.rindex("}") + 1]
json_error = json.loads(json_error)
if 'error' in json_error:
json_error = json_error['error']
if 'code' in json_error and 'message' in json_error:
return json_error
elif "Message" in json_error:
message = json_error["Message"]
raise CLIInternalError(message)
elif "message" in json_error:
message = json_error["message"]
raise CLIInternalError(message)
raise e


def providers_client_factory(cli_ctx, subscription_id=None):
return get_mgmt_service_client(cli_ctx, ResourceType.MGMT_RESOURCE_RESOURCES, subscription_id=subscription_id).providers

Expand Down
8 changes: 0 additions & 8 deletions src/containerapp/azext_containerapp/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -613,14 +613,6 @@ def _update_revision_env_secretrefs(containers, name):
var["secretRef"] = var["secretRef"].replace("{}-".format(name), "")


def _update_revision_env_secretrefs(containers, name):
for container in containers:
if "env" in container:
for var in container["env"]:
if "secretRef" in var:
var["secretRef"] = var["secretRef"].replace("{}-".format(name), "")


def store_as_secret_and_return_secret_ref(secrets_list, registry_user, registry_server, registry_pass, update_existing_secret=False, disable_warnings=False):
if registry_pass.startswith("secretref:"):
# If user passed in registry password using a secret
Expand Down
706 changes: 643 additions & 63 deletions src/containerapp/azext_containerapp/containerapp_decorator.py

Large diffs are not rendered by default.

443 changes: 15 additions & 428 deletions src/containerapp/azext_containerapp/custom.py

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -1247,6 +1247,32 @@ def test_containerapp_preview_create_with_yaml(self, resource_group):
JMESPathCheck("properties.template.scale.rules[0].http.auth[0].secretRef", "secretref"),
])

# test managedEnvironmentId
containerapp_yaml_text = f"""
properties:
configuration:
activeRevisionsMode: Multiple
ingress:
external: false
additionalPortMappings:
- external: false
targetPort: 321
- external: false
targetPort: 8080
exposedPort: 1234
"""

write_test_file(containerapp_file_name, containerapp_yaml_text)

self.cmd(f'containerapp update -n {app} -g {resource_group} --yaml {containerapp_file_name}', checks=[
JMESPathCheck("properties.provisioningState", "Succeeded"),
JMESPathCheck("properties.configuration.ingress.external", False),
JMESPathCheck("properties.configuration.ingress.additionalPortMappings[0].external", False),
JMESPathCheck("properties.configuration.ingress.additionalPortMappings[0].targetPort", 321),
JMESPathCheck("properties.configuration.ingress.additionalPortMappings[1].external", False),
JMESPathCheck("properties.configuration.ingress.additionalPortMappings[1].targetPort", 8080),
JMESPathCheck("properties.configuration.ingress.additionalPortMappings[1].exposedPort", 1234),
])
clean_up_test_file(containerapp_file_name)

@AllowLargeResponse(8192)
Expand Down