diff --git a/src/containerapp/azext_containerapp/custom.py b/src/containerapp/azext_containerapp/custom.py index b2f121d167c..6649e0f5483 100644 --- a/src/containerapp/azext_containerapp/custom.py +++ b/src/containerapp/azext_containerapp/custom.py @@ -301,7 +301,13 @@ def create_dapr_component_resiliency(cmd, name, resource_group_name, dapr_compon in_http_retry_delay_in_milliseconds=None, out_http_retry_delay_in_milliseconds=None, in_http_retry_interval_in_milliseconds=None, - out_http_retry_interval_in_milliseconds=None): + out_http_retry_interval_in_milliseconds=None, + in_circuit_breaker_consecutive_errors=None, + out_circuit_breaker_consecutive_errors=None, + in_circuit_breaker_interval=None, + out_circuit_breaker_interval=None, + in_circuit_breaker_timeout=None, + out_circuit_breaker_timeout=None): raw_parameters = locals() component_resiliency_create_decorator = DaprComponentResiliencyPreviewCreateDecorator( cmd=cmd, @@ -325,7 +331,13 @@ def update_dapr_component_resiliency(cmd, name, resource_group_name, dapr_compon in_http_retry_delay_in_milliseconds=None, out_http_retry_delay_in_milliseconds=None, in_http_retry_interval_in_milliseconds=None, - out_http_retry_interval_in_milliseconds=None): + out_http_retry_interval_in_milliseconds=None, + in_circuit_breaker_consecutive_errors=None, + out_circuit_breaker_consecutive_errors=None, + in_circuit_breaker_interval=None, + out_circuit_breaker_interval=None, + in_circuit_breaker_timeout=None, + out_circuit_breaker_timeout=None): raw_parameters = locals() component_resiliency_update_decorator = DaprComponentResiliencyPreviewUpdateDecorator( diff --git a/src/containerapp/azext_containerapp/tests/latest/common.py b/src/containerapp/azext_containerapp/tests/latest/common.py index eff7a4abe67..818bdeb981a 100644 --- a/src/containerapp/azext_containerapp/tests/latest/common.py +++ b/src/containerapp/azext_containerapp/tests/latest/common.py @@ -7,7 +7,7 @@ from azure.cli.testsdk import (ScenarioTest) TEST_DIR = os.path.abspath(os.path.join(os.path.abspath(__file__), '..')) -STAGE_LOCATION = os.getenv("CLIStageLocation") if os.getenv("CLIStageLocation") else "northcentralusstage" +STAGE_LOCATION = "northcentralusstage" TEST_LOCATION = os.getenv("CLITestLocation") if os.getenv("CLITestLocation") else STAGE_LOCATION diff --git a/src/containerapp/azext_containerapp/tests/latest/utils.py b/src/containerapp/azext_containerapp/tests/latest/utils.py index c30e108c48f..30b76211082 100644 --- a/src/containerapp/azext_containerapp/tests/latest/utils.py +++ b/src/containerapp/azext_containerapp/tests/latest/utils.py @@ -2,7 +2,7 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- - +import sys import time import requests from azure.cli.command_modules.containerapp._utils import format_location @@ -27,7 +27,7 @@ def prepare_containerapp_env_for_app_e2e_tests(test_cls, location=TEST_LOCATION) rg_location = location if format_location(rg_location) == format_location(STAGE_LOCATION): rg_location = "eastus" - test_cls.cmd(f'group create -n {rg_name} -l {location}') + test_cls.cmd(f'group create -n {rg_name} -l {rg_location}') test_cls.cmd(f'containerapp env create -g {rg_name} -n {env_name} --logs-destination none') managed_env = test_cls.cmd('containerapp env show -g {} -n {}'.format(rg_name, env_name)).get_output_in_json() @@ -37,15 +37,21 @@ def prepare_containerapp_env_for_app_e2e_tests(test_cls, location=TEST_LOCATION) return managed_env["id"] -def create_containerapp_env(test_cls, env_name, resource_group, location=TEST_LOCATION): +def create_containerapp_env(test_cls, env_name, resource_group, location=None, subnetId=None): logs_workspace_name = test_cls.create_random_name(prefix='containerapp-env', length=24) logs_workspace_location = location - if format_location(logs_workspace_location) == format_location(STAGE_LOCATION): + if logs_workspace_location is None or format_location(logs_workspace_location) == format_location(STAGE_LOCATION): logs_workspace_location = "eastus" logs_workspace_id = test_cls.cmd('monitor log-analytics workspace create -g {} -n {} -l {}'.format(resource_group, logs_workspace_name, logs_workspace_location)).get_output_in_json()["customerId"] logs_workspace_key = test_cls.cmd('monitor log-analytics workspace get-shared-keys -g {} -n {}'.format(resource_group, logs_workspace_name)).get_output_in_json()["primarySharedKey"] - test_cls.cmd(f'containerapp env create -g {resource_group} -n {env_name} --logs-workspace-id {logs_workspace_id} --logs-workspace-key {logs_workspace_key} -l {location}') + env_command = f'containerapp env create -g {resource_group} -n {env_name} --logs-workspace-id {logs_workspace_id} --logs-workspace-key {logs_workspace_key}' + if location: + env_command = f'{env_command} -l {location}' + + if subnetId: + env_command = f'{env_command} --infrastructure-subnet-resource-id {subnetId}' + test_cls.cmd(env_command) containerapp_env = test_cls.cmd('containerapp env show -g {} -n {}'.format(resource_group, env_name)).get_output_in_json()