diff --git a/src/spring-cloud/azext_spring_cloud/_enterprise.py b/src/spring-cloud/azext_spring_cloud/_enterprise.py deleted file mode 100644 index c75b4c26bab..00000000000 --- a/src/spring-cloud/azext_spring_cloud/_enterprise.py +++ /dev/null @@ -1,35 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- - -# pylint: disable=wrong-import-order - -from knack.log import get_logger -from .custom import (_create_service) - - -logger = get_logger(__name__) - - -def spring_cloud_create(cmd, client, resource_group, name, location=None, - vnet=None, service_runtime_subnet=None, app_subnet=None, reserved_cidr_range=None, - service_runtime_network_resource_group=None, app_network_resource_group=None, - app_insights_key=None, app_insights=None, sampling_rate=None, - disable_app_insights=None, enable_java_agent=None, - sku=None, tags=None, zone_redundant=False, no_wait=False): - """ - This method creates Azure Spring Cloud enterprise tier instance, it also creates sub-component under the instance if - user enable these component. - """ - poller = _create_service(cmd, client, resource_group, name, - location=location, - service_runtime_subnet=service_runtime_subnet, - app_subnet=app_subnet, - reserved_cidr_range=reserved_cidr_range, - service_runtime_network_resource_group=service_runtime_network_resource_group, - app_network_resource_group=app_network_resource_group, - zone_redundant=zone_redundant, - sku=sku, - tags=tags) - return poller diff --git a/src/spring-cloud/azext_spring_cloud/_params.py b/src/spring-cloud/azext_spring_cloud/_params.py index c7b21564ff4..733e0942250 100644 --- a/src/spring-cloud/azext_spring_cloud/_params.py +++ b/src/spring-cloud/azext_spring_cloud/_params.py @@ -50,31 +50,36 @@ def load_arguments(self, _): with self.argument_context('spring-cloud create') as c: c.argument('location', arg_type=get_location_type(self.cli_ctx), validator=validate_location) c.argument('sku', arg_type=sku_type, default='Standard') - c.argument('reserved_cidr_range', help='Comma-separated list of IP address ranges in CIDR format. The IP ranges are reserved to host underlying Azure Spring Cloud infrastructure, which should be 3 at least /16 unused IP ranges, must not overlap with any Subnet IP ranges.', validator=validate_vnet_required_parameters) - c.argument('vnet', help='The name or ID of an existing Virtual Network into which to deploy the Spring Cloud instance.', validator=validate_vnet_required_parameters) - c.argument('app_subnet', help='The name or ID of an existing subnet in "vnet" into which to deploy the Spring Cloud app. Required when deploying into a Virtual Network. Smaller subnet sizes are supported, please refer: https://aka.ms/azure-spring-cloud-smaller-subnet-vnet-docs', validator=validate_vnet_required_parameters) - c.argument('service_runtime_subnet', options_list=['--service-runtime-subnet', '--svc-subnet'], help='The name or ID of an existing subnet in "vnet" into which to deploy the Spring Cloud service runtime. Required when deploying into a Virtual Network.', validator=validate_vnet) - c.argument('service_runtime_network_resource_group', options_list=['--service-runtime-network-resource-group', '--svc-nrg'], help='The resource group where all network resources for Azure Spring Cloud service runtime will be created in.', validator=validate_node_resource_group) - c.argument('app_network_resource_group', options_list=['--app-network-resource-group', '--app-nrg'], help='The resource group where all network resources for apps will be created in.', validator=validate_node_resource_group) + c.argument('reserved_cidr_range', arg_group='VNet Injection', help='Comma-separated list of IP address ranges in CIDR format. The IP ranges are reserved to host underlying Azure Spring Cloud infrastructure, which should be 3 at least /16 unused IP ranges, must not overlap with any Subnet IP ranges.', validator=validate_vnet_required_parameters) + c.argument('vnet', arg_group='VNet Injection', help='The name or ID of an existing Virtual Network into which to deploy the Spring Cloud instance.', validator=validate_vnet_required_parameters) + c.argument('app_subnet', arg_group='VNet Injection', help='The name or ID of an existing subnet in "vnet" into which to deploy the Spring Cloud app. Required when deploying into a Virtual Network. Smaller subnet sizes are supported, please refer: https://aka.ms/azure-spring-cloud-smaller-subnet-vnet-docs', validator=validate_vnet_required_parameters) + c.argument('service_runtime_subnet', arg_group='VNet Injection', options_list=['--service-runtime-subnet', '--svc-subnet'], help='The name or ID of an existing subnet in "vnet" into which to deploy the Spring Cloud service runtime. Required when deploying into a Virtual Network.', validator=validate_vnet) + c.argument('service_runtime_network_resource_group', arg_group='VNet Injection', options_list=['--service-runtime-network-resource-group', '--svc-nrg'], help='The resource group where all network resources for Azure Spring Cloud service runtime will be created in.', validator=validate_node_resource_group) + c.argument('app_network_resource_group', arg_group='VNet Injection', options_list=['--app-network-resource-group', '--app-nrg'], help='The resource group where all network resources for apps will be created in.', validator=validate_node_resource_group) c.argument('enable_java_agent', + arg_group='Application Insights', arg_type=get_three_state_flag(), help="Java in process agent is now GA-ed and used by default when Application Insights enabled. " "This parameter is no longer needed and will be removed in future release.", validator=validate_java_agent_parameters, deprecate_info=c.deprecate(target='--enable-java-agent', hide=True)) c.argument('app_insights_key', + arg_group='Application Insights', help="Connection string (recommended) or Instrumentation key of the existing Application Insights.", validator=validate_tracing_parameters_asc_create) c.argument('app_insights', + arg_group='Application Insights', help="Name of the existing Application Insights in the same Resource Group. " "Or Resource ID of the existing Application Insights in a different Resource Group.", validator=validate_tracing_parameters_asc_create) c.argument('sampling_rate', type=float, + arg_group='Application Insights', help="Sampling Rate of application insights. Minimum is 0, maximum is 100.", validator=validate_tracing_parameters_asc_create) c.argument('disable_app_insights', arg_type=get_three_state_flag(), + arg_group='Application Insights', help="Disable Application Insights, " "if not disabled and no existing Application Insights specified with " "--app-insights-key or --app-insights, " @@ -83,7 +88,7 @@ def load_arguments(self, _): c.argument('zone_redundant', arg_type=get_three_state_flag(), help="Create your Azure Spring Cloud service in an Azure availability zone or not, " - "this could only be supported in several regions at the moment ", + "this could only be supported in several regions at the moment.", default=False, is_preview=True) with self.argument_context('spring-cloud update') as c: diff --git a/src/spring-cloud/azext_spring_cloud/commands.py b/src/spring-cloud/azext_spring_cloud/commands.py index fd1542427e9..9608643d05b 100644 --- a/src/spring-cloud/azext_spring_cloud/commands.py +++ b/src/spring-cloud/azext_spring_cloud/commands.py @@ -21,7 +21,7 @@ # pylint: disable=too-many-statements def load_command_table(self, _): spring_cloud_routing_util = CliCommandType( - operations_tmpl='azext_spring_cloud.tier_routing_spring_cloud#{}', + operations_tmpl='azext_spring_cloud.spring_cloud_instance#{}', client_factory=cf_spring_cloud_20220101preview ) diff --git a/src/spring-cloud/azext_spring_cloud/custom.py b/src/spring-cloud/azext_spring_cloud/custom.py index 0c40a825a57..ba8e9e27acb 100644 --- a/src/spring-cloud/azext_spring_cloud/custom.py +++ b/src/spring-cloud/azext_spring_cloud/custom.py @@ -18,8 +18,7 @@ from ._stream_utils import stream_logs from azure.mgmt.core.tools import (parse_resource_id, is_valid_resource_id) from ._utils import (_get_upload_local_file, _get_persistent_disk_size, - get_portal_uri, get_azure_files_info, - wait_till_end) + get_portal_uri, get_azure_files_info) from knack.util import CLIError from .vendored_sdks.appplatform.v2020_07_01 import models from .vendored_sdks.appplatform.v2020_11_01_preview import models as models_20201101preview @@ -60,78 +59,22 @@ LOG_RUNNING_PROMPT = "This command usually takes minutes to run. Add '--verbose' parameter if needed." -def spring_cloud_create(cmd, client, resource_group, name, location=None, - vnet=None, service_runtime_subnet=None, app_subnet=None, reserved_cidr_range=None, - service_runtime_network_resource_group=None, app_network_resource_group=None, - app_insights_key=None, app_insights=None, sampling_rate=None, - disable_app_insights=None, enable_java_agent=None, - sku=None, tags=None, zone_redundant=False, no_wait=False): - """ - Note: This is the command for create Spring-Cloud Standard and Basic tier. Refer tier_routing_spring_cloud.py for - the command definition. And _enteprise.py for Spring-Cloud Enterprise tier creation. - - If app_insights_key, app_insights and disable_app_insights are all None, - will still create an application insights and enable application insights. - :param enable_java_agent: (TODO) In deprecation process, ignore the value now. Will delete this. - :param app_insights: application insights name or its resource id - :param app_insights_key: Connection string or Instrumentation key - """ - # TODO (jiec) Deco this method when we deco parameter "--enable-java-agent" - _warn_enable_java_agent(enable_java_agent) - - poller = _create_service(cmd, client, resource_group, name, - location=location, - service_runtime_subnet=service_runtime_subnet, - app_subnet=app_subnet, - reserved_cidr_range=reserved_cidr_range, - service_runtime_network_resource_group=service_runtime_network_resource_group, - app_network_resource_group=app_network_resource_group, - zone_redundant=zone_redundant, - sku=sku, - tags=tags) - _update_application_insights_asc_create(cmd, resource_group, name, location, - app_insights_key, app_insights, sampling_rate, - disable_app_insights, no_wait) - return poller - - -def _create_service(cmd, client, resource_group, name, location=None, - service_runtime_subnet=None, app_subnet=None, reserved_cidr_range=None, - service_runtime_network_resource_group=None, app_network_resource_group=None, - zone_redundant=False, - sku=None, tags=None): - if location is None: - location = _get_rg_location(cmd.cli_ctx, resource_group) - properties = models_20220101preview.ClusterResourceProperties() - - if service_runtime_subnet or app_subnet or reserved_cidr_range: - properties.network_profile = models_20220101preview.NetworkProfile( - service_runtime_subnet_id=service_runtime_subnet, - app_subnet_id=app_subnet, - service_cidr=reserved_cidr_range, - app_network_resource_group=app_network_resource_group, - service_runtime_network_resource_group=service_runtime_network_resource_group - ) - - properties.zone_redundant = zone_redundant - resource = models_20220101preview.ServiceResource(location=location, sku=sku, properties=properties, tags=tags) - - poller = client.services.begin_create_or_update( - resource_group, name, resource) - logger.warning(" - Creating Service ..") - wait_till_end(cmd, poller) - return poller - - -def _warn_enable_java_agent(enable_java_agent): +def _warn_enable_java_agent(enable_java_agent, **_): if enable_java_agent is not None: logger.warn("Java in process agent is now GA-ed and used by default when Application Insights enabled. " "The parameter '--enable-java-agent' is no longer needed and will be removed in future release.") -def _update_application_insights_asc_create(cmd, resource_group, name, location, - app_insights_key, app_insights, sampling_rate, - disable_app_insights, no_wait): +def _update_application_insights_asc_create(cmd, + resource_group, + name, + location, + app_insights_key=None, + app_insights=None, + sampling_rate=None, + disable_app_insights=None, + no_wait=None, + **_): monitoring_setting_resource = models.MonitoringSettingResource() if disable_app_insights is not True: client_preview = get_mgmt_service_client(cmd.cli_ctx, AppPlatformManagementClient_20201101preview) diff --git a/src/spring-cloud/azext_spring_cloud/spring_cloud_instance.py b/src/spring-cloud/azext_spring_cloud/spring_cloud_instance.py new file mode 100644 index 00000000000..10a067b5d92 --- /dev/null +++ b/src/spring-cloud/azext_spring_cloud/spring_cloud_instance.py @@ -0,0 +1,133 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +# pylint: disable=wrong-import-order +# pylint: disable=unused-argument, logging-format-interpolation, protected-access, wrong-import-order, too-many-lines +from ._utils import (wait_till_end, _get_rg_location) +from .vendored_sdks.appplatform.v2022_01_01_preview import models +from knack.log import get_logger +from .custom import (_warn_enable_java_agent, _update_application_insights_asc_create) + +from ._validators import (_parse_sku_name) +from knack.log import get_logger + +logger = get_logger(__name__) + + +class DefaultSpringCloud: + def __init__(self, cmd, client, resource_group, name, location=None, **_): + self.cmd = cmd + self.client = client + self.resource_group = resource_group + self.name = name + self.location = location or _get_rg_location(cmd.cli_ctx, resource_group) + + def create(self, **kwargs): + self.before_create(**kwargs) + resource = self.create_service(**kwargs) + self.after_create(**kwargs) + return resource + + def before_create(self, **kwargs): + _warn_enable_java_agent(**kwargs) + + def after_create(self, **kwargs): + _update_application_insights_asc_create(self.cmd, + self.resource_group, + self.name, + self.location, + **kwargs) + + def create_service(self, + service_runtime_subnet=None, + app_subnet=None, + reserved_cidr_range=None, + service_runtime_network_resource_group=None, + app_network_resource_group=None, + zone_redundant=False, + sku=None, + tags=None, + **_): + properties = models.ClusterResourceProperties( + zone_redundant=zone_redundant + ) + + if service_runtime_subnet or app_subnet or reserved_cidr_range: + properties.network_profile = models.NetworkProfile( + service_runtime_subnet_id=service_runtime_subnet, + app_subnet_id=app_subnet, + service_cidr=reserved_cidr_range, + app_network_resource_group=app_network_resource_group, + service_runtime_network_resource_group=service_runtime_network_resource_group + ) + + resource = models.ServiceResource(location=self.location, sku=sku, properties=properties, tags=tags) + poller = self.client.services.begin_create_or_update( + self.resource_group, self.name, resource) + logger.warning(" - Creating Service ..") + wait_till_end(self.cmd, poller) + return poller + + +class EnterpriseSpringCloud(DefaultSpringCloud): + def before_create(self, **_): + pass + + def after_create(self, no_wait=None, **kwargs): + pollers = [ + # create sub components like Service registry, ACS, build service, etc. + ] + pollers = [x for x in pollers if x] + if not no_wait: + wait_till_end(self.cmd, *pollers) + + +def _get_factory(cmd, client, resource_group, name, location=None, sku=None): + if _parse_sku_name(sku) == 'enterprise': + return EnterpriseSpringCloud(cmd, client, resource_group, name, location) + return DefaultSpringCloud(cmd, client, resource_group, name, location) + + +def spring_cloud_create(cmd, client, resource_group, name, + location=None, + vnet=None, + service_runtime_subnet=None, + app_subnet=None, + reserved_cidr_range=None, + service_runtime_network_resource_group=None, + app_network_resource_group=None, + app_insights_key=None, + app_insights=None, + sampling_rate=None, + disable_app_insights=None, + enable_java_agent=None, + sku=None, + tags=None, + zone_redundant=False, + no_wait=False): + """ + Because Standard/Basic tier vs. Enterprise tier creation are very different. Here routes the command to different + implementation according to --sku parameters. + """ + kwargs = { + 'vnet': vnet, + 'service_runtime_subnet': service_runtime_subnet, + 'app_subnet': app_subnet, + 'reserved_cidr_range': reserved_cidr_range, + 'service_runtime_network_resource_group': service_runtime_network_resource_group, + 'app_network_resource_group': app_network_resource_group, + 'app_insights_key': app_insights_key, + 'app_insights': app_insights, + 'sampling_rate': sampling_rate, + 'disable_app_insights': disable_app_insights, + 'enable_java_agent': enable_java_agent, + 'sku': sku, + 'tags': tags, + 'zone_redundant': zone_redundant, + 'no_wait': no_wait + } + + spring_cloud_factory = _get_factory(cmd, client, resource_group, name, location=location, sku=sku) + return spring_cloud_factory.create(**kwargs) diff --git a/src/spring-cloud/azext_spring_cloud/tests/latest/test_asc_create.py b/src/spring-cloud/azext_spring_cloud/tests/latest/test_asc_create.py new file mode 100644 index 00000000000..53fcf2a0dd4 --- /dev/null +++ b/src/spring-cloud/azext_spring_cloud/tests/latest/test_asc_create.py @@ -0,0 +1,135 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- +import unittest +from azure.cli.core.azclierror import ResourceNotFoundError +from knack.util import CLIError +from msrestazure.tools import resource_id +from ...vendored_sdks.appplatform.v2022_01_01_preview import models +from ...spring_cloud_instance import (spring_cloud_create) +from ..._utils import (_get_sku_name) +try: + import unittest.mock as mock +except ImportError: + from unittest import mock + +from azure.cli.core.mock import DummyCli +from azure.cli.core import AzCommandsLoader +from azure.cli.core.commands import AzCliCommand + +from knack.log import get_logger + +logger = get_logger(__name__) +free_mock_client = mock.MagicMock() + +def _get_test_cmd(): + cli_ctx = DummyCli() + cli_ctx.data['subscription_id'] = '00000000-0000-0000-0000-000000000000' + loader = AzCommandsLoader(cli_ctx, resource_type='Microsoft.AppPlatform') + cmd = AzCliCommand(loader, 'test', None) + cmd.command_kwargs = {'resource_type': 'Microsoft.AppPlatform'} + cmd.cli_ctx = cli_ctx + return cmd + + +def _cf_resource_group(cli_ctx, subscription_id=None): + client = mock.MagicMock() + rg = mock.MagicMock() + rg.location = 'east us' + client.resource_groups.get.return_value = rg + return client + + +def _get_basic_mock_client(*_): + return mock.MagicMock() + + +class BasicTest(unittest.TestCase): + def __init__(self, methodName: str = ...): + super().__init__(methodName=methodName) + self.created_resource = None + + def setUp(self): + resp = super().setUp() + free_mock_client.reset_mock() + return resp + + def _get_sku(self, tier='Standard'): + return models.Sku( + tier=tier, + name=_get_sku_name(tier) + ) + + @mock.patch('azext_spring_cloud._utils.cf_resource_groups', _cf_resource_group) + def _execute(self, resource_group, name, **kwargs): + client = kwargs.pop('client', None) or _get_basic_mock_client() + spring_cloud_create(_get_test_cmd(), client, resource_group, name, **kwargs) + call_args = client.services.begin_create_or_update.call_args_list + self.assertEqual(1, len(call_args)) + self.assertEqual(3, len(call_args[0][0])) + self.assertEqual((resource_group, name), call_args[0][0][0:2]) + self.created_resource = call_args[0][0][2] + + +class TestSpringCloudCreateEnerprise(BasicTest): + def test_asc_create_enterprise(self): + self._execute('rg', 'asc', sku=self._get_sku('Enterprise')) + resource = self.created_resource + self.assertEqual('E0', resource.sku.name) + self.assertEqual('Enterprise', resource.sku.tier) + self.assertEqual(False, resource.properties.zone_redundant) + + +class TestSpringCloudCreateWithAI(BasicTest): + def _get_ai_client(ctx, type): + ai_create_resource = mock.MagicMock() + ai_create_resource.connection_string = 'fake-connection' + free_mock_client.components.create_or_update.return_value = ai_create_resource + ai_get_resource = mock.MagicMock() + ai_get_resource.connection_string = 'get-connection' + free_mock_client.components.get.return_value = ai_get_resource + return free_mock_client + + def __init__(self, methodName: str = ...): + super().__init__(methodName=methodName) + self.monitoring_settings_resource = None + + @mock.patch('azext_spring_cloud.custom.get_mgmt_service_client', _get_ai_client) + def _execute(self, resource_group, name, **kwargs): + client = kwargs.pop('client', None) or _get_basic_mock_client() + super()._execute(resource_group, name, client=client, **kwargs) + + call_args = free_mock_client.monitoring_settings.begin_update_put.call_args_list + self.assertEqual(1, len(call_args)) + self.assertEqual(3, len(call_args[0][1])) + self.assertEqual(resource_group, call_args[0][1]['resource_group_name']) + self.assertEqual(name, call_args[0][1]['service_name']) + self.monitoring_settings_resource = call_args[0][1]['monitoring_setting_resource'] + + def test_asc_create_with_AI_happy_path(self): + self._execute('rg', 'asc', sku=self._get_sku()) + resource = self.created_resource + self.assertEqual('S0', resource.sku.name) + self.assertEqual('Standard', resource.sku.tier) + self.assertEqual(False, resource.properties.zone_redundant) + self.assertEqual('fake-connection', self.monitoring_settings_resource.properties.app_insights_instrumentation_key) + self.assertEqual(True, self.monitoring_settings_resource.properties.trace_enabled) + + def test_asc_create_with_AI_key(self): + self._execute('rg', 'asc', sku=self._get_sku(), app_insights_key='my-key') + resource = self.created_resource + self.assertEqual('S0', resource.sku.name) + self.assertEqual('Standard', resource.sku.tier) + self.assertEqual(False, resource.properties.zone_redundant) + self.assertEqual('my-key', self.monitoring_settings_resource.properties.app_insights_instrumentation_key) + self.assertEqual(True, self.monitoring_settings_resource.properties.trace_enabled) + + def test_asc_create_with_AI_name(self): + self._execute('rg', 'asc', sku=self._get_sku(), app_insights='my-key') + resource = self.created_resource + self.assertEqual('S0', resource.sku.name) + self.assertEqual('Standard', resource.sku.tier) + self.assertEqual(False, resource.properties.zone_redundant) + self.assertEqual('get-connection', self.monitoring_settings_resource.properties.app_insights_instrumentation_key) + self.assertEqual(True, self.monitoring_settings_resource.properties.trace_enabled) \ No newline at end of file diff --git a/src/spring-cloud/azext_spring_cloud/tier_routing_spring_cloud.py b/src/spring-cloud/azext_spring_cloud/tier_routing_spring_cloud.py deleted file mode 100644 index 94295be3002..00000000000 --- a/src/spring-cloud/azext_spring_cloud/tier_routing_spring_cloud.py +++ /dev/null @@ -1,71 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- - -# pylint: disable=wrong-import-order -from ._validators import (_parse_sku_name) -from ._enterprise import (spring_cloud_create as create_enterprise) -from .custom import (spring_cloud_create as create_standard) -from knack.log import get_logger - -logger = get_logger(__name__) - - -def spring_cloud_create(cmd, client, resource_group, name, - location=None, - vnet=None, - service_runtime_subnet=None, - app_subnet=None, - reserved_cidr_range=None, - service_runtime_network_resource_group=None, - app_network_resource_group=None, - app_insights_key=None, - app_insights=None, - sampling_rate=None, - disable_app_insights=None, - enable_java_agent=None, - sku=None, - tags=None, - zone_redundant=False, - no_wait=False): - """ - Because Standard/Basic tier vs. Enterprise tier creation are very different. Here routes the command to different - implementation according to --sku parameters. - """ - if _parse_sku_name(sku) == 'enterprise': - return create_enterprise(cmd, client, resource_group, name, - location=location, - vnet=vnet, - service_runtime_subnet=service_runtime_subnet, - app_subnet=app_subnet, - reserved_cidr_range=reserved_cidr_range, - service_runtime_network_resource_group=service_runtime_network_resource_group, - app_network_resource_group=app_network_resource_group, - app_insights_key=app_insights_key, - app_insights=app_insights, - sampling_rate=sampling_rate, - disable_app_insights=disable_app_insights, - enable_java_agent=enable_java_agent, - sku=sku, - tags=tags, - zone_redundant=zone_redundant, - no_wait=no_wait) - else: - return create_standard(cmd, client, resource_group, name, - location=location, - vnet=vnet, - service_runtime_subnet=service_runtime_subnet, - app_subnet=app_subnet, - reserved_cidr_range=reserved_cidr_range, - service_runtime_network_resource_group=service_runtime_network_resource_group, - app_network_resource_group=app_network_resource_group, - app_insights_key=app_insights_key, - app_insights=app_insights, - sampling_rate=sampling_rate, - disable_app_insights=disable_app_insights, - enable_java_agent=enable_java_agent, - sku=sku, - tags=tags, - zone_redundant=zone_redundant, - no_wait=no_wait)