From f549964e33390f09f30bea7056e572d3f67d8a0c Mon Sep 17 00:00:00 2001 From: Pan Li Date: Tue, 11 Jan 2022 14:35:36 +0800 Subject: [PATCH] [Spring Cloud] Add buildpack-binding command for Enterprise tier. (#4302) * [Spring-Cloud] Add buildpack-binding command for Enterprise tier. * Add create, show, set, delete and list for buildpack-binding. * Add enable app insights when create Enterprise tier. Signed-off-by: Pan Li * Minor change. Signed-off-by: Pan Li * format. Signed-off-by: Pan Li * Make linter happy. Signed-off-by: Pan Li * Reset help.py. Signed-off-by: Pan Li * Re-add help.py Signed-off-by: Pan Li * Add EOF. Signed-off-by: Pan Li * Add UT for create enterprise tier with app insights. Signed-off-by: Pan Li * Add record test for buildpack bindings. Signed-off-by: Pan Li * Resolve comments. Signed-off-by: Pan Li * Resolve comments. Signed-off-by: Pan Li * Resolve comments and make static check happy. Signed-off-by: Pan Li * Make static check happy. Signed-off-by: Pan Li * Resolve comments. Signed-off-by: Pan Li * Resolve comments. Signed-off-by: Pan Li * Replace CRLF to LF. Signed-off-by: Pan Li * Minor change format. Signed-off-by: Pan Li * Make static check happy. Signed-off-by: Pan Li * Merge parmas. Signed-off-by: Pan Li --- src/spring-cloud/azext_spring_cloud/_help.py | 61 + .../azext_spring_cloud/_params.py | 46 +- .../_validators_enterprise.py | 53 +- .../azext_spring_cloud/buildpack_binding.py | 180 ++ .../azext_spring_cloud/commands.py | 14 + .../spring_cloud_instance.py | 12 + .../recordings/test_buildpack_binding.yaml | 1487 +++++++++++++++++ .../latest/test_asc_buildpack_binding.py | 75 + .../tests/latest/test_asc_create.py | 72 +- 9 files changed, 1993 insertions(+), 7 deletions(-) create mode 100644 src/spring-cloud/azext_spring_cloud/buildpack_binding.py create mode 100644 src/spring-cloud/azext_spring_cloud/tests/latest/recordings/test_buildpack_binding.yaml create mode 100644 src/spring-cloud/azext_spring_cloud/tests/latest/test_asc_buildpack_binding.py diff --git a/src/spring-cloud/azext_spring_cloud/_help.py b/src/spring-cloud/azext_spring_cloud/_help.py index 2417d943e07..b3dc59f82ea 100644 --- a/src/spring-cloud/azext_spring_cloud/_help.py +++ b/src/spring-cloud/azext_spring_cloud/_help.py @@ -846,3 +846,64 @@ type: command short-summary: Unbind a custom-domain of the API portal. """ + +helps['spring-cloud build-service'] = """ + type: group + short-summary: (Support Enterprise Tier Only) Commands to manage build service in Azure Spring Cloud. +""" + +helps['spring-cloud build-service builder'] = """ + type: group + short-summary: (Support Enterprise Tier Only) Commands to manage builder of build service. +""" + +helps['spring-cloud build-service builder buildpack-binding'] = """ + type: group + short-summary: (Support Enterprise Tier Only) Commands to manage buildpack-binding of builder. +""" + +helps['spring-cloud build-service builder buildpack-binding create'] = """ + type: command + short-summary: (Support Enterprise Tier Only) Create a buildpack binding. + examples: + - name: Create a buildpack binding without properties or secrets. + text: az spring-cloud build-service builder buildpack-binding create --name first-binding --builder-name first-builder --type ApplicationInsights --service MyCluster --resource-group MyResourceGroup + - name: Create a buildpack binding with only secrets. + text: az spring-cloud build-service builder buildpack-binding create --name first-binding --builder-name first-builder --type ApplicationInsights --secrets k1=v1 k2=v2 --service MyCluster --resource-group MyResourceGroup + - name: Create a buildpack binding with only properties. + text: az spring-cloud build-service builder buildpack-binding create --name first-binding --builder-name first-builder --type ApplicationInsights --properties a=b c=d --service MyCluster --resource-group MyResourceGroup + - name: Create a buildpack binding with properties and secrets. + text: az spring-cloud build-service builder buildpack-binding create --name first-binding --builder-name first-builder --type ApplicationInsights --properties a=b c=d --secrets k1=v1 k2=v2 --service MyCluster --resource-group MyResourceGroup +""" + +helps['spring-cloud build-service builder buildpack-binding set'] = """ + type: command + short-summary: (Support Enterprise Tier Only) Set a buildpack binding. + examples: + - name: Set a buildpack binding with properties and secrets. + text: az spring-cloud build-service builder buildpack-binding set --name first-binding --builder-name first-builder --type ApplicationInsights --properties a=b c=d --secrets k1=v1 k2=v2 --service MyCluster --resource-group MyResourceGroup +""" + +helps['spring-cloud build-service builder buildpack-binding show'] = """ + type: command + short-summary: (Support Enterprise Tier Only) Show a buildpack binding. The secrets will be masked. + examples: + - name: Show a buildpack binding. + text: az spring-cloud build-service builder buildpack-binding show --name first-binding --builder-name first-builder --service MyCluster --resource-group MyResourceGroup +""" + +helps['spring-cloud build-service builder buildpack-binding list'] = """ + type: command + short-summary: (Support Enterprise Tier Only) List all buildpack binding in a builder. The secrets will be masked. + examples: + - name: List all buildpack binding of a builder. + text: az spring-cloud build-service builder buildpack-binding list --builder-name first-builder --service MyCluster --resource-group MyResourceGroup +""" + +helps['spring-cloud build-service builder buildpack-binding delete'] = """ + type: command + short-summary: (Support Enterprise Tier Only) Delete a buildpack binding. + examples: + - name: Delete a buildpack binding. + text: az spring-cloud build-service builder buildpack-binding delete --name first-binding --builder-name first-builder --service MyCluster --resource-group MyResourceGroup +""" diff --git a/src/spring-cloud/azext_spring_cloud/_params.py b/src/spring-cloud/azext_spring_cloud/_params.py index 09b223c8bdd..50ddd0ffaae 100644 --- a/src/spring-cloud/azext_spring_cloud/_params.py +++ b/src/spring-cloud/azext_spring_cloud/_params.py @@ -14,14 +14,18 @@ validate_tracing_parameters_asc_create, validate_tracing_parameters_asc_update, validate_app_insights_parameters, validate_instance_count, validate_java_agent_parameters, validate_jar) -from ._validators_enterprise import (only_support_enterprise, - validate_git_uri, validate_acs_patterns, - validate_routes) +from ._validators_enterprise import (only_support_enterprise, validate_git_uri, validate_acs_patterns, validate_routes, + validate_buildpack_binding_exist, validate_buildpack_binding_not_exist, + validate_buildpack_binding_properties, validate_buildpack_binding_secrets) from ._app_validator import (fulfill_deployment_param, active_deployment_exist, active_deployment_exist_under_app, ensure_not_active_deployment, validate_deloy_path, validate_deloyment_create_path, validate_cpu, validate_memory) from ._utils import ApiType + +from .vendored_sdks.appplatform.v2020_07_01.models import RuntimeVersion, TestKeyType +from .vendored_sdks.appplatform.v2022_01_01_preview.models \ + import _app_platform_management_client_enums as v20220101_preview_AppPlatformEnums from .vendored_sdks.appplatform.v2022_01_01_preview.models._app_platform_management_client_enums import SupportedRuntimeValue, TestKeyType name_type = CLIArgumentType(options_list=[ @@ -500,3 +504,39 @@ def prepare_logs_argument(c): c.argument('app_name', type=str, help="The Azure Spring Cloud app name to configure the route.") c.argument('routes_json', type=str, help="The JSON array of API routes.", validator=validate_routes) c.argument('routes_file', type=str, help="The file path of JSON array of API routes.", validator=validate_routes) + + for scope in ['spring-cloud build-service builder buildpack-binding create']: + with self.argument_context(scope) as c: + c.argument('name', name_type, help='Name for buildpack binding.', validator=validate_buildpack_binding_not_exist) + + for scope in ['spring-cloud build-service builder buildpack-binding create', + 'spring-cloud build-service builder buildpack-binding set']: + with self.argument_context(scope) as c: + c.argument('type', + arg_type=get_enum_type(v20220101_preview_AppPlatformEnums.BindingType), + help='Required type for buildpack binding.') + c.argument('properties', + help='Non-sensitive properties for launchProperties. Format "key[=value]".', + nargs='*', + validator=validate_buildpack_binding_properties) + c.argument('secrets', + help='Sensitive properties for launchProperties. ' + 'Once put, it will be encrypted and never return to user. ' + 'Format "key[=value]".', + nargs='*', + validator=validate_buildpack_binding_secrets) + + for scope in ['spring-cloud build-service builder buildpack-binding set', + 'spring-cloud build-service builder buildpack-binding show', + 'spring-cloud build-service builder buildpack-binding delete']: + with self.argument_context(scope) as c: + c.argument('name', name_type, help='Name for buildpack binding.', validator=validate_buildpack_binding_exist) + + for scope in ['spring-cloud build-service builder buildpack-binding create', + 'spring-cloud build-service builder buildpack-binding set', + 'spring-cloud build-service builder buildpack-binding list', + 'spring-cloud build-service builder buildpack-binding show', + 'spring-cloud build-service builder buildpack-binding delete']: + with self.argument_context(scope) as c: + c.argument('builder_name', help='The name for builder.', default="default") + c.argument('service', service_name_type, validator=only_support_enterprise) diff --git a/src/spring-cloud/azext_spring_cloud/_validators_enterprise.py b/src/spring-cloud/azext_spring_cloud/_validators_enterprise.py index bb2c22f676f..8cbd4311945 100644 --- a/src/spring-cloud/azext_spring_cloud/_validators_enterprise.py +++ b/src/spring-cloud/azext_spring_cloud/_validators_enterprise.py @@ -6,7 +6,8 @@ # pylint: disable=too-few-public-methods, unused-argument, redefined-builtin from re import match - +from azure.cli.core.commands.validators import validate_tag +from azure.core.exceptions import ResourceNotFoundError from azure.cli.core.azclierror import (ArgumentUsageError, ClientRequestError, InvalidArgumentValueError, MutuallyExclusiveArgumentError) @@ -15,8 +16,11 @@ from ._resource_quantity import validate_cpu as validate_and_normalize_cpu from ._resource_quantity import \ validate_memory as validate_and_normalize_memory -from ._util_enterprise import is_enterprise_tier +from ._util_enterprise import ( + is_enterprise_tier, get_client +) from ._validators import validate_instance_count +from .buildpack_binding import (DEFAULT_BUILD_SERVICE_NAME) logger = get_logger(__name__) @@ -116,3 +120,48 @@ def validate_api_portal_instance_count(namespace): if namespace.api_portal_instance_count is not None: if namespace.api_portal_instance_count < 1: raise InvalidArgumentValueError("--api-portal-instance-count must be greater than 0") + + +def validate_buildpack_binding_properties(namespace): + """ Extracts multiple space-separated properties in key[=value] format """ + if isinstance(namespace.properties, list): + properties_dict = {} + for item in namespace.properties: + properties_dict.update(validate_tag(item)) + namespace.properties = properties_dict + + +def validate_buildpack_binding_secrets(namespace): + """ Extracts multiple space-separated secrets in key[=value] format """ + if isinstance(namespace.secrets, list): + secrets_dict = {} + for item in namespace.secrets: + secrets_dict.update(validate_tag(item)) + namespace.secrets = secrets_dict + + +def validate_buildpack_binding_not_exist(cmd, namespace): + client = get_client(cmd) + try: + binding_resource = client.buildpack_binding.get(namespace.resource_group, + namespace.service, + DEFAULT_BUILD_SERVICE_NAME, + namespace.builder_name, + namespace.name) + if binding_resource is not None: + raise ClientRequestError('buildpack Binding {} in builder {} already exists ' + 'in resource group {}, service {}. You can edit it by set command.' + .format(namespace.name, namespace.resource_group, namespace.service, namespace.builder_name)) + except ResourceNotFoundError: + # Excepted case + pass + + +def validate_buildpack_binding_exist(cmd, namespace): + client = get_client(cmd) + # If not exists exception will be raised + client.buildpack_binding.get(namespace.resource_group, + namespace.service, + DEFAULT_BUILD_SERVICE_NAME, + namespace.builder_name, + namespace.name) diff --git a/src/spring-cloud/azext_spring_cloud/buildpack_binding.py b/src/spring-cloud/azext_spring_cloud/buildpack_binding.py new file mode 100644 index 00000000000..8033ea7915c --- /dev/null +++ b/src/spring-cloud/azext_spring_cloud/buildpack_binding.py @@ -0,0 +1,180 @@ +# -------------------------------------------------------------------------------------------- +# 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 .vendored_sdks.appplatform.v2022_01_01_preview import models +from azure.cli.core.util import sdk_no_wait +from ._utils import get_portal_uri +from msrestazure.tools import parse_resource_id, is_valid_resource_id +from azure.cli.core.commands.client_factory import get_mgmt_service_client +from azure.cli.core.azclierror import InvalidArgumentValueError +from azure.mgmt.applicationinsights import ApplicationInsightsManagementClient +from azure.core.exceptions import ResourceNotFoundError +from knack.log import get_logger + +logger = get_logger(__name__) + +DEFAULT_BUILDER_NAME = "default" +DEFAULT_BINDING_NAME = "default" +DEFAULT_BUILD_SERVICE_NAME = "default" + + +def create_or_update_buildpack_binding(cmd, client, resource_group, service, + name, type, builder_name=None, properties=None, secrets=None): + if not builder_name: + builder_name = DEFAULT_BUILDER_NAME + logger.warning('Option --builder-name is not provided, will use default builder name "{}".'.format(builder_name)) + + logger.warning('[1/1] Creating or updating to buildpack binding for builder "{}", (this operation can take a while to complete).'.format(builder_name)) + + binding_resource = _build_buildpack_binding_resource(type, properties, secrets) + return sdk_no_wait(False, client.buildpack_binding.begin_create_or_update, resource_group, + service, DEFAULT_BUILD_SERVICE_NAME, builder_name, name, binding_resource) + + +def buildpack_binding_show(cmd, client, resource_group, service, name, builder_name=None): + if not builder_name: + builder_name = DEFAULT_BUILDER_NAME + logger.warning('Option --builder-name is not provided, will use default builder name "{}".'.format(builder_name)) + + return client.buildpack_binding.get(resource_group, service, DEFAULT_BUILD_SERVICE_NAME, + builder_name, name) + + +def buildpack_binding_list(cmd, client, resource_group, service, builder_name=None): + if not builder_name: + builder_name = DEFAULT_BUILDER_NAME + logger.warning('Option --builder-name is not provided, will use default builder name "{}".'.format(builder_name)) + + return client.buildpack_binding.list(resource_group, service, DEFAULT_BUILD_SERVICE_NAME, builder_name) + + +def buildpack_binding_delete(cmd, client, resource_group, service, name, builder_name=None): + if not builder_name: + builder_name = DEFAULT_BUILDER_NAME + logger.warning('Option --builder-name is not provided, will use default builder name "{}".'.format(builder_name)) + + logger.warning('[1/1] Deleting buildpack binding for builder "{}", (this operation can take a while to complete).'.format(builder_name)) + + return sdk_no_wait(False, client.buildpack_binding.begin_delete, resource_group, + service, DEFAULT_BUILD_SERVICE_NAME, builder_name, name) + + +def create_default_buildpack_binding_for_application_insights(cmd, client, resource_group, name, location, + app_insights_key, app_insights, sampling_rate): + logger.warning("Start configure Application Insights") + binding_resource = models.BuildpackBindingResource() + binding_resource.properties = _get_buildpack_binding_properties(cmd, resource_group, name, location, app_insights_key, app_insights, sampling_rate) + + if binding_resource.properties: + return client.buildpack_binding.begin_create_or_update(resource_group, name, DEFAULT_BUILD_SERVICE_NAME, + DEFAULT_BUILDER_NAME, DEFAULT_BINDING_NAME, binding_resource) + + +def _build_buildpack_binding_resource(binding_type, properties_dict, secrets_dict): + launch_properties = models.BuildpackBindingLaunchProperties(properties=properties_dict, + secrets=secrets_dict) + binding_properties = models.BuildpackBindingProperties(binding_type=binding_type, + launch_properties=launch_properties) + return models.BuildpackBindingResource(properties=binding_properties) + + +def _get_buildpack_binding_properties(cmd, resource_group, service_name, location, + app_insights_key, app_insights, sampling_rate): + + sampling_rate = sampling_rate or 10 + connection_string = app_insights_key or \ + _get_connection_string_from_app_insights(cmd, resource_group, app_insights) or \ + _create_app_insights_and_get_connection_string(cmd, resource_group, service_name, location) + + if not connection_string: + raise InvalidArgumentValueError('Error while trying to get the ConnectionString of Application Insights for the Azure Spring Cloud. ' + 'Please use the Azure Portal to create and configure the Application Insights, if needed.') + + launch_properties = models.BuildpackBindingLaunchProperties(properties={ + "connection-string": connection_string, + "sampling-percentage": sampling_rate, + }) + + return models.BuildpackBindingProperties(binding_type="ApplicationInsights", launch_properties=launch_properties) + + +def _create_app_insights_and_get_connection_string(cmd, resource_group, service_name, location): + + try: + created_app_insights = _try_create_application_insights(cmd, resource_group, service_name, location) + if created_app_insights: + return created_app_insights.connection_string + except Exception: # pylint: disable=broad-except + logger.warning( + 'Error while trying to create and configure an Application Insights for the Azure Spring Cloud. ' + 'Please use the Azure Portal to create and configure the Application Insights, if needed.') + return None + + +def _get_connection_string_from_app_insights(cmd, resource_group, app_insights): + """Get connection string from: + 1) application insights name + 2) application insights resource id + """ + + if not app_insights: + return None + + if is_valid_resource_id(app_insights): + resource_id_dict = parse_resource_id(app_insights) + connection_string = _get_app_insights_connection_string( + cmd.cli_ctx, resource_id_dict['resource_group'], resource_id_dict['resource_name']) + else: + connection_string = _get_app_insights_connection_string(cmd.cli_ctx, resource_group, app_insights) + + if not connection_string: + logger.warning( + "Cannot find Connection string from application insights:{}".format(app_insights)) + + return connection_string + + +def _get_app_insights_connection_string(cli_ctx, resource_group, name): + appinsights_client = get_mgmt_service_client(cli_ctx, ApplicationInsightsManagementClient) + appinsights = appinsights_client.components.get(resource_group, name) + + if not appinsights or not appinsights.connection_string: + raise ResourceNotFoundError("App Insights {} under resource group {} was not found.".format(name, resource_group)) + + return appinsights.connection_string + + +def _try_create_application_insights(cmd, resource_group, name, location): + creation_failed_warn = 'Unable to create the Application Insights for the Azure Spring Cloud. ' \ + 'Please use the Azure Portal to manually create and configure the Application Insights, ' \ + 'if needed.' + + ai_resource_group_name = resource_group + ai_name = name + ai_location = location + ai_properties = { + "name": ai_name, + "location": ai_location, + "kind": "web", + "properties": { + "Application_Type": "web" + } + } + + app_insights_client = get_mgmt_service_client(cmd.cli_ctx, ApplicationInsightsManagementClient) + appinsights = app_insights_client.components.create_or_update(ai_resource_group_name, ai_name, ai_properties) + + if not appinsights or not appinsights.connection_string: + logger.warning(creation_failed_warn) + return None + + portal_url = get_portal_uri(cmd.cli_ctx) + # We make this success message as a warning to no interfere with regular JSON output in stdout + logger.warning('Application Insights \"%s\" was created for this Azure Spring Cloud. ' + 'You can visit %s/#resource%s/overview to view your ' + 'Application Insights component', appinsights.name, portal_url, appinsights.id) + + return appinsights diff --git a/src/spring-cloud/azext_spring_cloud/commands.py b/src/spring-cloud/azext_spring_cloud/commands.py index 0d45c91013f..fc934631362 100644 --- a/src/spring-cloud/azext_spring_cloud/commands.py +++ b/src/spring-cloud/azext_spring_cloud/commands.py @@ -39,6 +39,11 @@ def load_command_table(self, _): client_factory=cf_spring_cloud_20220101preview ) + buildpack_binding_cmd_group = CliCommandType( + operations_tmpl="azext_spring_cloud.buildpack_binding#{}", + client_factory=cf_spring_cloud_20220101preview + ) + application_configuration_service_cmd_group = CliCommandType( operations_tmpl='azext_spring_cloud.application_configuration_service#{}', client_factory=cf_spring_cloud_20220101preview @@ -274,3 +279,12 @@ def load_command_table(self, _): with self.command_group('spring-cloud', exception_handler=handle_asc_exception): pass + + with self.command_group('spring-cloud build-service builder buildpack-binding', + custom_command_type=buildpack_binding_cmd_group, + exception_handler=handle_asc_exception, is_preview=True) as g: + g.custom_command('create', 'create_or_update_buildpack_binding') + g.custom_command('set', 'create_or_update_buildpack_binding') + g.custom_show_command('show', 'buildpack_binding_show') + g.custom_command('list', 'buildpack_binding_list') + g.custom_command('delete', 'buildpack_binding_delete', confirmation=True) diff --git a/src/spring-cloud/azext_spring_cloud/spring_cloud_instance.py b/src/spring-cloud/azext_spring_cloud/spring_cloud_instance.py index 10a067b5d92..aa54338df01 100644 --- a/src/spring-cloud/azext_spring_cloud/spring_cloud_instance.py +++ b/src/spring-cloud/azext_spring_cloud/spring_cloud_instance.py @@ -9,6 +9,7 @@ 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 .buildpack_binding import create_default_buildpack_binding_for_application_insights from ._validators import (_parse_sku_name) from knack.log import get_logger @@ -78,6 +79,7 @@ def before_create(self, **_): def after_create(self, no_wait=None, **kwargs): pollers = [ # create sub components like Service registry, ACS, build service, etc. + _enable_app_insights(self.cmd, self.client, self.resource_group, self.name, self.location, **kwargs) ] pollers = [x for x in pollers if x] if not no_wait: @@ -131,3 +133,13 @@ def spring_cloud_create(cmd, client, resource_group, name, spring_cloud_factory = _get_factory(cmd, client, resource_group, name, location=location, sku=sku) return spring_cloud_factory.create(**kwargs) + + +def _enable_app_insights(cmd, client, resource_group, name, location, app_insights_key, app_insights, + sampling_rate, disable_app_insights, **_): + if disable_app_insights: + return + + return create_default_buildpack_binding_for_application_insights(cmd, client, resource_group, name, + location, app_insights_key, app_insights, + sampling_rate) diff --git a/src/spring-cloud/azext_spring_cloud/tests/latest/recordings/test_buildpack_binding.yaml b/src/spring-cloud/azext_spring_cloud/tests/latest/recordings/test_buildpack_binding.yaml new file mode 100644 index 00000000000..66d79c7644c --- /dev/null +++ b/src/spring-cloud/azext_spring_cloud/tests/latest/recordings/test_buildpack_binding.yaml @@ -0,0 +1,1487 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - spring-cloud build-service builder buildpack-binding create + Connection: + - keep-alive + ParameterSetName: + - --name --type --properties --secrets -g -s + User-Agent: + - AZURECLI/2.32.0 azsdk-python-mgmt-appplatform/6.1.0 Python/3.9.9 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/enterprise-test/providers/Microsoft.AppPlatform/Spring/test-buildpack-binding?api-version=2022-01-01-preview + response: + body: + string: '{"properties":{"provisioningState":"Succeeded","zoneRedundant":false,"version":3,"serviceId":"ed7caa979562408889414f01aa59e5de","networkProfile":{"outboundIPs":{"publicIPs":["20.120.66.58","20.120.66.69"]}},"powerState":"Running","fqdn":"test-buildpack-binding.asc-test.net"},"type":"Microsoft.AppPlatform/Spring","sku":{"name":"E0","tier":"Enterprise"},"location":"eastus","tags":null,"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/enterprise-test/providers/Microsoft.AppPlatform/Spring/test-buildpack-binding","name":"test-buildpack-binding","systemData":{"createdBy":"panli@microsoft.com","createdByType":"User","createdAt":"2022-01-07T11:10:06.9913584Z","lastModifiedBy":"panli@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2022-01-07T11:10:06.9913584Z"}}' + headers: + cache-control: + - no-cache + content-length: + - '800' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 07 Jan 2022 11:54:43 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:ccd65fc4-7cd4-497e-8dc8-9a76e9a43ae2 + server: + - nginx/1.17.7 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '11999' + x-rp-server-mvid: + - 8aeaf7a0-9097-4412-a5ee-7737152dd344 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - spring-cloud build-service builder buildpack-binding create + Connection: + - keep-alive + ParameterSetName: + - --name --type --properties --secrets -g -s + User-Agent: + - AZURECLI/2.32.0 azsdk-python-mgmt-appplatform/6.1.0 Python/3.9.9 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/enterprise-test/providers/Microsoft.AppPlatform/Spring/test-buildpack-binding/buildServices/default/builders/default/buildpackBindings/test-binding-name?api-version=2022-01-01-preview + response: + body: + string: '{"error":{"code":"NotFound","message":"KPack buildpacksBinding does + not exist","target":"default/test-binding-name","details":null}}' + headers: + cache-control: + - no-cache + content-length: + - '132' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 07 Jan 2022 11:54:45 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:ccd65fc4-7cd4-497e-8dc8-9a76e9a43ae2 + server: + - nginx/1.17.7 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-rp-server-mvid: + - 8aeaf7a0-9097-4412-a5ee-7737152dd344 + status: + code: 404 + message: Not Found +- request: + body: '{"properties": {"bindingType": "ApplicationInsights", "launchProperties": + {"properties": {"a": "b", "b": "c"}, "secrets": {"x": "y", "y": "z"}}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - spring-cloud build-service builder buildpack-binding create + Connection: + - keep-alive + Content-Length: + - '145' + Content-Type: + - application/json + ParameterSetName: + - --name --type --properties --secrets -g -s + User-Agent: + - AZURECLI/2.32.0 azsdk-python-mgmt-appplatform/6.1.0 Python/3.9.9 (Windows-10-10.0.19044-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/enterprise-test/providers/Microsoft.AppPlatform/Spring/test-buildpack-binding/buildServices/default/builders/default/buildpackBindings/test-binding-name?api-version=2022-01-01-preview + response: + body: + string: '{"properties":{"provisioningState":"Creating","bindingType":"ApplicationInsights","launchProperties":{"properties":{"a":"b","b":"c"},"secrets":{"x":"*","y":"*"}}},"type":"Microsoft.AppPlatform/Spring/buildServices/builders/buildpackBindings","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/enterprise-test/providers/Microsoft.AppPlatform/Spring/test-buildpack-binding/buildServices/default/builders/default/buildpackBindings/test-binding-name","name":"test-binding-name","systemData":{"createdBy":"panli@microsoft.com","createdByType":"User","createdAt":"2022-01-07T11:54:46.3402505Z","lastModifiedBy":"panli@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2022-01-07T11:54:46.3402505Z"}}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/enterprise-test/providers/Microsoft.AppPlatform/locations/eastus/operationStatus/test-buildpack-binding/operationId/a0d1278d-55bc-47d2-9ace-7142e6bf8d78?api-version=2022-01-01-preview + cache-control: + - no-cache + content-length: + - '726' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 07 Jan 2022 11:54:49 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/enterprise-test/providers/Microsoft.AppPlatform/locations/eastus/operationResults/a0d1278d-55bc-47d2-9ace-7142e6bf8d78/Spring/test-buildpack-binding?api-version=2022-01-01-preview + pragma: + - no-cache + request-context: + - appId=cid-v1:ccd65fc4-7cd4-497e-8dc8-9a76e9a43ae2 + server: + - nginx/1.17.7 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + x-rp-server-mvid: + - 8aeaf7a0-9097-4412-a5ee-7737152dd344 + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - spring-cloud build-service builder buildpack-binding create + Connection: + - keep-alive + ParameterSetName: + - --name --type --properties --secrets -g -s + User-Agent: + - AZURECLI/2.32.0 azsdk-python-mgmt-appplatform/6.1.0 Python/3.9.9 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/enterprise-test/providers/Microsoft.AppPlatform/locations/eastus/operationStatus/test-buildpack-binding/operationId/a0d1278d-55bc-47d2-9ace-7142e6bf8d78?api-version=2022-01-01-preview + response: + body: + string: '{"id":"subscriptions/0753feba-86f1-4242-aff1-27938fb04531/resourceGroups/enterprise-test/providers/Microsoft.AppPlatform/locations/eastus/operationStatus/test-buildpack-binding/operationId/a0d1278d-55bc-47d2-9ace-7142e6bf8d78","name":"a0d1278d-55bc-47d2-9ace-7142e6bf8d78","status":"Succeeded","startTime":"2022-01-07T11:54:50.4769869Z","endTime":"2022-01-07T11:54:57.4899293Z"}' + headers: + cache-control: + - no-cache + content-length: + - '378' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 07 Jan 2022 11:55:21 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:ccd65fc4-7cd4-497e-8dc8-9a76e9a43ae2 + server: + - nginx/1.17.7 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-rp-server-mvid: + - 8aeaf7a0-9097-4412-a5ee-7737152dd344 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - spring-cloud build-service builder buildpack-binding create + Connection: + - keep-alive + ParameterSetName: + - --name --type --properties --secrets -g -s + User-Agent: + - AZURECLI/2.32.0 azsdk-python-mgmt-appplatform/6.1.0 Python/3.9.9 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/enterprise-test/providers/Microsoft.AppPlatform/Spring/test-buildpack-binding/buildServices/default/builders/default/buildpackBindings/test-binding-name?api-version=2022-01-01-preview + response: + body: + string: '{"properties":{"provisioningState":"Succeeded","bindingType":"ApplicationInsights","launchProperties":{"properties":{"a":"b","b":"c"},"secrets":{"x":"*","y":"*"}}},"type":"Microsoft.AppPlatform/Spring/buildServices/builders/buildpackBindings","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/enterprise-test/providers/Microsoft.AppPlatform/Spring/test-buildpack-binding/buildServices/default/builders/default/buildpackBindings/test-binding-name","name":"test-binding-name","systemData":{"createdBy":"panli@microsoft.com","createdByType":"User","createdAt":"2022-01-07T11:54:46.3402505Z","lastModifiedBy":"panli@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2022-01-07T11:54:46.3402505Z"}}' + headers: + cache-control: + - no-cache + content-length: + - '727' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 07 Jan 2022 11:55:23 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:ccd65fc4-7cd4-497e-8dc8-9a76e9a43ae2 + server: + - nginx/1.17.7 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-rp-server-mvid: + - 8aeaf7a0-9097-4412-a5ee-7737152dd344 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - spring-cloud build-service builder buildpack-binding show + Connection: + - keep-alive + ParameterSetName: + - --name -g -s + User-Agent: + - AZURECLI/2.32.0 azsdk-python-mgmt-appplatform/6.1.0 Python/3.9.9 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/enterprise-test/providers/Microsoft.AppPlatform/Spring/test-buildpack-binding?api-version=2022-01-01-preview + response: + body: + string: '{"properties":{"provisioningState":"Succeeded","zoneRedundant":false,"version":3,"serviceId":"ed7caa979562408889414f01aa59e5de","networkProfile":{"outboundIPs":{"publicIPs":["20.120.66.58","20.120.66.69"]}},"powerState":"Running","fqdn":"test-buildpack-binding.asc-test.net"},"type":"Microsoft.AppPlatform/Spring","sku":{"name":"E0","tier":"Enterprise"},"location":"eastus","tags":null,"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/enterprise-test/providers/Microsoft.AppPlatform/Spring/test-buildpack-binding","name":"test-buildpack-binding","systemData":{"createdBy":"panli@microsoft.com","createdByType":"User","createdAt":"2022-01-07T11:10:06.9913584Z","lastModifiedBy":"panli@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2022-01-07T11:10:06.9913584Z"}}' + headers: + cache-control: + - no-cache + content-length: + - '800' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 07 Jan 2022 11:55:25 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:ccd65fc4-7cd4-497e-8dc8-9a76e9a43ae2 + server: + - nginx/1.17.7 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '11998' + x-rp-server-mvid: + - 8aeaf7a0-9097-4412-a5ee-7737152dd344 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - spring-cloud build-service builder buildpack-binding show + Connection: + - keep-alive + ParameterSetName: + - --name -g -s + User-Agent: + - AZURECLI/2.32.0 azsdk-python-mgmt-appplatform/6.1.0 Python/3.9.9 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/enterprise-test/providers/Microsoft.AppPlatform/Spring/test-buildpack-binding/buildServices/default/builders/default/buildpackBindings/test-binding-name?api-version=2022-01-01-preview + response: + body: + string: '{"properties":{"provisioningState":"Succeeded","bindingType":"ApplicationInsights","launchProperties":{"properties":{"a":"b","b":"c"},"secrets":{"x":"*","y":"*"}}},"type":"Microsoft.AppPlatform/Spring/buildServices/builders/buildpackBindings","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/enterprise-test/providers/Microsoft.AppPlatform/Spring/test-buildpack-binding/buildServices/default/builders/default/buildpackBindings/test-binding-name","name":"test-binding-name","systemData":{"createdBy":"panli@microsoft.com","createdByType":"User","createdAt":"2022-01-07T11:54:46.3402505Z","lastModifiedBy":"panli@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2022-01-07T11:54:46.3402505Z"}}' + headers: + cache-control: + - no-cache + content-length: + - '727' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 07 Jan 2022 11:55:28 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:ccd65fc4-7cd4-497e-8dc8-9a76e9a43ae2 + server: + - nginx/1.17.7 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-rp-server-mvid: + - 8aeaf7a0-9097-4412-a5ee-7737152dd344 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - spring-cloud build-service builder buildpack-binding show + Connection: + - keep-alive + ParameterSetName: + - --name -g -s + User-Agent: + - AZURECLI/2.32.0 azsdk-python-mgmt-appplatform/6.1.0 Python/3.9.9 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/enterprise-test/providers/Microsoft.AppPlatform/Spring/test-buildpack-binding/buildServices/default/builders/default/buildpackBindings/test-binding-name?api-version=2022-01-01-preview + response: + body: + string: '{"properties":{"provisioningState":"Succeeded","bindingType":"ApplicationInsights","launchProperties":{"properties":{"a":"b","b":"c"},"secrets":{"x":"*","y":"*"}}},"type":"Microsoft.AppPlatform/Spring/buildServices/builders/buildpackBindings","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/enterprise-test/providers/Microsoft.AppPlatform/Spring/test-buildpack-binding/buildServices/default/builders/default/buildpackBindings/test-binding-name","name":"test-binding-name","systemData":{"createdBy":"panli@microsoft.com","createdByType":"User","createdAt":"2022-01-07T11:54:46.3402505Z","lastModifiedBy":"panli@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2022-01-07T11:54:46.3402505Z"}}' + headers: + cache-control: + - no-cache + content-length: + - '727' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 07 Jan 2022 11:55:30 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:ccd65fc4-7cd4-497e-8dc8-9a76e9a43ae2 + server: + - nginx/1.17.7 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-rp-server-mvid: + - 8aeaf7a0-9097-4412-a5ee-7737152dd344 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - spring-cloud build-service builder buildpack-binding set + Connection: + - keep-alive + ParameterSetName: + - --name --type --properties --secrets -g -s + User-Agent: + - AZURECLI/2.32.0 azsdk-python-mgmt-appplatform/6.1.0 Python/3.9.9 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/enterprise-test/providers/Microsoft.AppPlatform/Spring/test-buildpack-binding?api-version=2022-01-01-preview + response: + body: + string: '{"properties":{"provisioningState":"Succeeded","zoneRedundant":false,"version":3,"serviceId":"ed7caa979562408889414f01aa59e5de","networkProfile":{"outboundIPs":{"publicIPs":["20.120.66.58","20.120.66.69"]}},"powerState":"Running","fqdn":"test-buildpack-binding.asc-test.net"},"type":"Microsoft.AppPlatform/Spring","sku":{"name":"E0","tier":"Enterprise"},"location":"eastus","tags":null,"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/enterprise-test/providers/Microsoft.AppPlatform/Spring/test-buildpack-binding","name":"test-buildpack-binding","systemData":{"createdBy":"panli@microsoft.com","createdByType":"User","createdAt":"2022-01-07T11:10:06.9913584Z","lastModifiedBy":"panli@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2022-01-07T11:10:06.9913584Z"}}' + headers: + cache-control: + - no-cache + content-length: + - '800' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 07 Jan 2022 11:55:32 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:ccd65fc4-7cd4-497e-8dc8-9a76e9a43ae2 + server: + - nginx/1.17.7 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '11997' + x-rp-server-mvid: + - 8aeaf7a0-9097-4412-a5ee-7737152dd344 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - spring-cloud build-service builder buildpack-binding set + Connection: + - keep-alive + ParameterSetName: + - --name --type --properties --secrets -g -s + User-Agent: + - AZURECLI/2.32.0 azsdk-python-mgmt-appplatform/6.1.0 Python/3.9.9 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/enterprise-test/providers/Microsoft.AppPlatform/Spring/test-buildpack-binding/buildServices/default/builders/default/buildpackBindings/test-binding-name?api-version=2022-01-01-preview + response: + body: + string: '{"properties":{"provisioningState":"Succeeded","bindingType":"ApplicationInsights","launchProperties":{"properties":{"a":"b","b":"c"},"secrets":{"x":"*","y":"*"}}},"type":"Microsoft.AppPlatform/Spring/buildServices/builders/buildpackBindings","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/enterprise-test/providers/Microsoft.AppPlatform/Spring/test-buildpack-binding/buildServices/default/builders/default/buildpackBindings/test-binding-name","name":"test-binding-name","systemData":{"createdBy":"panli@microsoft.com","createdByType":"User","createdAt":"2022-01-07T11:54:46.3402505Z","lastModifiedBy":"panli@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2022-01-07T11:54:46.3402505Z"}}' + headers: + cache-control: + - no-cache + content-length: + - '727' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 07 Jan 2022 11:55:34 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:ccd65fc4-7cd4-497e-8dc8-9a76e9a43ae2 + server: + - nginx/1.17.7 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-rp-server-mvid: + - 8aeaf7a0-9097-4412-a5ee-7737152dd344 + status: + code: 200 + message: OK +- request: + body: '{"properties": {"bindingType": "NewRelic", "launchProperties": {"properties": + {"a": "b"}, "secrets": {"c": "d"}}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - spring-cloud build-service builder buildpack-binding set + Connection: + - keep-alive + Content-Length: + - '114' + Content-Type: + - application/json + ParameterSetName: + - --name --type --properties --secrets -g -s + User-Agent: + - AZURECLI/2.32.0 azsdk-python-mgmt-appplatform/6.1.0 Python/3.9.9 (Windows-10-10.0.19044-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/enterprise-test/providers/Microsoft.AppPlatform/Spring/test-buildpack-binding/buildServices/default/builders/default/buildpackBindings/test-binding-name?api-version=2022-01-01-preview + response: + body: + string: '{"properties":{"provisioningState":"Updating","bindingType":"NewRelic","launchProperties":{"properties":{"a":"b"},"secrets":{"c":"*"}}},"type":"Microsoft.AppPlatform/Spring/buildServices/builders/buildpackBindings","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/enterprise-test/providers/Microsoft.AppPlatform/Spring/test-buildpack-binding/buildServices/default/builders/default/buildpackBindings/test-binding-name","name":"test-binding-name","systemData":{"createdBy":"panli@microsoft.com","createdByType":"User","createdAt":"2022-01-07T11:54:46.3402505Z","lastModifiedBy":"panli@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2022-01-07T11:55:36.0622673Z"}}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/enterprise-test/providers/Microsoft.AppPlatform/locations/eastus/operationStatus/test-buildpack-binding/operationId/a6bdf74b-39a8-425e-9cdc-11c4ba49143b?api-version=2022-01-01-preview + cache-control: + - no-cache + content-length: + - '699' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 07 Jan 2022 11:55:40 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/enterprise-test/providers/Microsoft.AppPlatform/locations/eastus/operationResults/a6bdf74b-39a8-425e-9cdc-11c4ba49143b/Spring/test-buildpack-binding?api-version=2022-01-01-preview + pragma: + - no-cache + request-context: + - appId=cid-v1:ccd65fc4-7cd4-497e-8dc8-9a76e9a43ae2 + server: + - nginx/1.17.7 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + x-rp-server-mvid: + - 8aeaf7a0-9097-4412-a5ee-7737152dd344 + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - spring-cloud build-service builder buildpack-binding set + Connection: + - keep-alive + ParameterSetName: + - --name --type --properties --secrets -g -s + User-Agent: + - AZURECLI/2.32.0 azsdk-python-mgmt-appplatform/6.1.0 Python/3.9.9 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/enterprise-test/providers/Microsoft.AppPlatform/locations/eastus/operationStatus/test-buildpack-binding/operationId/a6bdf74b-39a8-425e-9cdc-11c4ba49143b?api-version=2022-01-01-preview + response: + body: + string: '{"id":"subscriptions/0753feba-86f1-4242-aff1-27938fb04531/resourceGroups/enterprise-test/providers/Microsoft.AppPlatform/locations/eastus/operationStatus/test-buildpack-binding/operationId/a6bdf74b-39a8-425e-9cdc-11c4ba49143b","name":"a6bdf74b-39a8-425e-9cdc-11c4ba49143b","status":"Succeeded","startTime":"2022-01-07T11:55:40.4735174Z","endTime":"2022-01-07T11:55:50.4056357Z"}' + headers: + cache-control: + - no-cache + content-length: + - '378' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 07 Jan 2022 11:56:11 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:ccd65fc4-7cd4-497e-8dc8-9a76e9a43ae2 + server: + - nginx/1.17.7 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-rp-server-mvid: + - 8aeaf7a0-9097-4412-a5ee-7737152dd344 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - spring-cloud build-service builder buildpack-binding set + Connection: + - keep-alive + ParameterSetName: + - --name --type --properties --secrets -g -s + User-Agent: + - AZURECLI/2.32.0 azsdk-python-mgmt-appplatform/6.1.0 Python/3.9.9 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/enterprise-test/providers/Microsoft.AppPlatform/Spring/test-buildpack-binding/buildServices/default/builders/default/buildpackBindings/test-binding-name?api-version=2022-01-01-preview + response: + body: + string: '{"properties":{"provisioningState":"Succeeded","bindingType":"NewRelic","launchProperties":{"properties":{"a":"b"},"secrets":{"c":"*"}}},"type":"Microsoft.AppPlatform/Spring/buildServices/builders/buildpackBindings","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/enterprise-test/providers/Microsoft.AppPlatform/Spring/test-buildpack-binding/buildServices/default/builders/default/buildpackBindings/test-binding-name","name":"test-binding-name","systemData":{"createdBy":"panli@microsoft.com","createdByType":"User","createdAt":"2022-01-07T11:54:46.3402505Z","lastModifiedBy":"panli@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2022-01-07T11:55:36.0622673Z"}}' + headers: + cache-control: + - no-cache + content-length: + - '700' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 07 Jan 2022 11:56:15 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:ccd65fc4-7cd4-497e-8dc8-9a76e9a43ae2 + server: + - nginx/1.17.7 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-rp-server-mvid: + - 8aeaf7a0-9097-4412-a5ee-7737152dd344 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - spring-cloud build-service builder buildpack-binding delete + Connection: + - keep-alive + ParameterSetName: + - --name -g -s + User-Agent: + - AZURECLI/2.32.0 azsdk-python-mgmt-appplatform/6.1.0 Python/3.9.9 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/enterprise-test/providers/Microsoft.AppPlatform/Spring/test-buildpack-binding?api-version=2022-01-01-preview + response: + body: + string: '{"properties":{"provisioningState":"Succeeded","zoneRedundant":false,"version":3,"serviceId":"ed7caa979562408889414f01aa59e5de","networkProfile":{"outboundIPs":{"publicIPs":["20.120.66.58","20.120.66.69"]}},"powerState":"Running","fqdn":"test-buildpack-binding.asc-test.net"},"type":"Microsoft.AppPlatform/Spring","sku":{"name":"E0","tier":"Enterprise"},"location":"eastus","tags":null,"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/enterprise-test/providers/Microsoft.AppPlatform/Spring/test-buildpack-binding","name":"test-buildpack-binding","systemData":{"createdBy":"panli@microsoft.com","createdByType":"User","createdAt":"2022-01-07T11:10:06.9913584Z","lastModifiedBy":"panli@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2022-01-07T11:10:06.9913584Z"}}' + headers: + cache-control: + - no-cache + content-length: + - '800' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 07 Jan 2022 11:56:17 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:ccd65fc4-7cd4-497e-8dc8-9a76e9a43ae2 + server: + - nginx/1.17.7 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '11997' + x-rp-server-mvid: + - 8aeaf7a0-9097-4412-a5ee-7737152dd344 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - spring-cloud build-service builder buildpack-binding delete + Connection: + - keep-alive + ParameterSetName: + - --name -g -s + User-Agent: + - AZURECLI/2.32.0 azsdk-python-mgmt-appplatform/6.1.0 Python/3.9.9 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/enterprise-test/providers/Microsoft.AppPlatform/Spring/test-buildpack-binding/buildServices/default/builders/default/buildpackBindings/test-binding-name?api-version=2022-01-01-preview + response: + body: + string: '{"properties":{"provisioningState":"Succeeded","bindingType":"NewRelic","launchProperties":{"properties":{"a":"b"},"secrets":{"c":"*"}}},"type":"Microsoft.AppPlatform/Spring/buildServices/builders/buildpackBindings","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/enterprise-test/providers/Microsoft.AppPlatform/Spring/test-buildpack-binding/buildServices/default/builders/default/buildpackBindings/test-binding-name","name":"test-binding-name","systemData":{"createdBy":"panli@microsoft.com","createdByType":"User","createdAt":"2022-01-07T11:54:46.3402505Z","lastModifiedBy":"panli@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2022-01-07T11:55:36.0622673Z"}}' + headers: + cache-control: + - no-cache + content-length: + - '700' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 07 Jan 2022 11:56:19 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:ccd65fc4-7cd4-497e-8dc8-9a76e9a43ae2 + server: + - nginx/1.17.7 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-rp-server-mvid: + - 8aeaf7a0-9097-4412-a5ee-7737152dd344 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - spring-cloud build-service builder buildpack-binding delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - --name -g -s + User-Agent: + - AZURECLI/2.32.0 azsdk-python-mgmt-appplatform/6.1.0 Python/3.9.9 (Windows-10-10.0.19044-SP0) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/enterprise-test/providers/Microsoft.AppPlatform/Spring/test-buildpack-binding/buildServices/default/builders/default/buildpackBindings/test-binding-name?api-version=2022-01-01-preview + response: + body: + string: '' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/enterprise-test/providers/Microsoft.AppPlatform/locations/eastus/operationStatus/test-buildpack-binding/operationId/8cc21ac2-d90c-4a5c-a985-18bfe7faccba?api-version=2022-01-01-preview + cache-control: + - no-cache + content-length: + - '0' + date: + - Fri, 07 Jan 2022 11:56:23 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/enterprise-test/providers/Microsoft.AppPlatform/locations/eastus/operationResults/8cc21ac2-d90c-4a5c-a985-18bfe7faccba/Spring/test-buildpack-binding?api-version=2022-01-01-preview + pragma: + - no-cache + request-context: + - appId=cid-v1:ccd65fc4-7cd4-497e-8dc8-9a76e9a43ae2 + server: + - nginx/1.17.7 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + x-rp-server-mvid: + - 8aeaf7a0-9097-4412-a5ee-7737152dd344 + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - spring-cloud build-service builder buildpack-binding delete + Connection: + - keep-alive + ParameterSetName: + - --name -g -s + User-Agent: + - AZURECLI/2.32.0 azsdk-python-mgmt-appplatform/6.1.0 Python/3.9.9 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/enterprise-test/providers/Microsoft.AppPlatform/locations/eastus/operationStatus/test-buildpack-binding/operationId/8cc21ac2-d90c-4a5c-a985-18bfe7faccba?api-version=2022-01-01-preview + response: + body: + string: '{"id":"subscriptions/0753feba-86f1-4242-aff1-27938fb04531/resourceGroups/enterprise-test/providers/Microsoft.AppPlatform/locations/eastus/operationStatus/test-buildpack-binding/operationId/8cc21ac2-d90c-4a5c-a985-18bfe7faccba","name":"8cc21ac2-d90c-4a5c-a985-18bfe7faccba","status":"Succeeded","startTime":"2022-01-07T11:56:23.4616931Z","endTime":"2022-01-07T11:56:30.3724245Z"}' + headers: + cache-control: + - no-cache + content-length: + - '378' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 07 Jan 2022 11:56:53 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:ccd65fc4-7cd4-497e-8dc8-9a76e9a43ae2 + server: + - nginx/1.17.7 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-rp-server-mvid: + - 8aeaf7a0-9097-4412-a5ee-7737152dd344 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - spring-cloud build-service builder buildpack-binding create + Connection: + - keep-alive + ParameterSetName: + - --name --type --properties --secrets -g -s + User-Agent: + - AZURECLI/2.32.0 azsdk-python-mgmt-appplatform/6.1.0 Python/3.9.9 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/enterprise-test/providers/Microsoft.AppPlatform/Spring/test-buildpack-binding?api-version=2022-01-01-preview + response: + body: + string: '{"properties":{"provisioningState":"Succeeded","zoneRedundant":false,"version":3,"serviceId":"ed7caa979562408889414f01aa59e5de","networkProfile":{"outboundIPs":{"publicIPs":["20.120.66.58","20.120.66.69"]}},"powerState":"Running","fqdn":"test-buildpack-binding.asc-test.net"},"type":"Microsoft.AppPlatform/Spring","sku":{"name":"E0","tier":"Enterprise"},"location":"eastus","tags":null,"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/enterprise-test/providers/Microsoft.AppPlatform/Spring/test-buildpack-binding","name":"test-buildpack-binding","systemData":{"createdBy":"panli@microsoft.com","createdByType":"User","createdAt":"2022-01-07T11:10:06.9913584Z","lastModifiedBy":"panli@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2022-01-07T11:10:06.9913584Z"}}' + headers: + cache-control: + - no-cache + content-length: + - '800' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 07 Jan 2022 11:56:54 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:ccd65fc4-7cd4-497e-8dc8-9a76e9a43ae2 + server: + - nginx/1.17.7 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '11997' + x-rp-server-mvid: + - 8aeaf7a0-9097-4412-a5ee-7737152dd344 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - spring-cloud build-service builder buildpack-binding create + Connection: + - keep-alive + ParameterSetName: + - --name --type --properties --secrets -g -s + User-Agent: + - AZURECLI/2.32.0 azsdk-python-mgmt-appplatform/6.1.0 Python/3.9.9 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/enterprise-test/providers/Microsoft.AppPlatform/Spring/test-buildpack-binding/buildServices/default/builders/default/buildpackBindings/test-binding-name-0?api-version=2022-01-01-preview + response: + body: + string: '{"error":{"code":"NotFound","message":"KPack buildpacksBinding does + not exist","target":"default/test-binding-name-0","details":null}}' + headers: + cache-control: + - no-cache + content-length: + - '134' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 07 Jan 2022 11:56:58 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:ccd65fc4-7cd4-497e-8dc8-9a76e9a43ae2 + server: + - nginx/1.17.7 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-rp-server-mvid: + - 8aeaf7a0-9097-4412-a5ee-7737152dd344 + status: + code: 404 + message: Not Found +- request: + body: '{"properties": {"bindingType": "ApplicationInsights", "launchProperties": + {"properties": {"a": "b", "b": "c"}, "secrets": {"x": "y", "y": "z"}}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - spring-cloud build-service builder buildpack-binding create + Connection: + - keep-alive + Content-Length: + - '145' + Content-Type: + - application/json + ParameterSetName: + - --name --type --properties --secrets -g -s + User-Agent: + - AZURECLI/2.32.0 azsdk-python-mgmt-appplatform/6.1.0 Python/3.9.9 (Windows-10-10.0.19044-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/enterprise-test/providers/Microsoft.AppPlatform/Spring/test-buildpack-binding/buildServices/default/builders/default/buildpackBindings/test-binding-name-0?api-version=2022-01-01-preview + response: + body: + string: '{"properties":{"provisioningState":"Creating","bindingType":"ApplicationInsights","launchProperties":{"properties":{"a":"b","b":"c"},"secrets":{"x":"*","y":"*"}}},"type":"Microsoft.AppPlatform/Spring/buildServices/builders/buildpackBindings","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/enterprise-test/providers/Microsoft.AppPlatform/Spring/test-buildpack-binding/buildServices/default/builders/default/buildpackBindings/test-binding-name-0","name":"test-binding-name-0","systemData":{"createdBy":"panli@microsoft.com","createdByType":"User","createdAt":"2022-01-07T11:56:58.77283Z","lastModifiedBy":"panli@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2022-01-07T11:56:58.77283Z"}}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/enterprise-test/providers/Microsoft.AppPlatform/locations/eastus/operationStatus/test-buildpack-binding/operationId/af0e6ea7-6203-49b0-a78e-7ba9e78ccdbf?api-version=2022-01-01-preview + cache-control: + - no-cache + content-length: + - '726' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 07 Jan 2022 11:57:01 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/enterprise-test/providers/Microsoft.AppPlatform/locations/eastus/operationResults/af0e6ea7-6203-49b0-a78e-7ba9e78ccdbf/Spring/test-buildpack-binding?api-version=2022-01-01-preview + pragma: + - no-cache + request-context: + - appId=cid-v1:ccd65fc4-7cd4-497e-8dc8-9a76e9a43ae2 + server: + - nginx/1.17.7 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + x-rp-server-mvid: + - 8aeaf7a0-9097-4412-a5ee-7737152dd344 + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - spring-cloud build-service builder buildpack-binding create + Connection: + - keep-alive + ParameterSetName: + - --name --type --properties --secrets -g -s + User-Agent: + - AZURECLI/2.32.0 azsdk-python-mgmt-appplatform/6.1.0 Python/3.9.9 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/enterprise-test/providers/Microsoft.AppPlatform/locations/eastus/operationStatus/test-buildpack-binding/operationId/af0e6ea7-6203-49b0-a78e-7ba9e78ccdbf?api-version=2022-01-01-preview + response: + body: + string: '{"id":"subscriptions/0753feba-86f1-4242-aff1-27938fb04531/resourceGroups/enterprise-test/providers/Microsoft.AppPlatform/locations/eastus/operationStatus/test-buildpack-binding/operationId/af0e6ea7-6203-49b0-a78e-7ba9e78ccdbf","name":"af0e6ea7-6203-49b0-a78e-7ba9e78ccdbf","status":"Succeeded","startTime":"2022-01-07T11:57:01.45146Z","endTime":"2022-01-07T11:57:09.5464218Z"}' + headers: + cache-control: + - no-cache + content-length: + - '376' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 07 Jan 2022 11:57:31 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:ccd65fc4-7cd4-497e-8dc8-9a76e9a43ae2 + server: + - nginx/1.17.7 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-rp-server-mvid: + - 8aeaf7a0-9097-4412-a5ee-7737152dd344 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - spring-cloud build-service builder buildpack-binding create + Connection: + - keep-alive + ParameterSetName: + - --name --type --properties --secrets -g -s + User-Agent: + - AZURECLI/2.32.0 azsdk-python-mgmt-appplatform/6.1.0 Python/3.9.9 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/enterprise-test/providers/Microsoft.AppPlatform/Spring/test-buildpack-binding/buildServices/default/builders/default/buildpackBindings/test-binding-name-0?api-version=2022-01-01-preview + response: + body: + string: '{"properties":{"provisioningState":"Succeeded","bindingType":"ApplicationInsights","launchProperties":{"properties":{"a":"b","b":"c"},"secrets":{"x":"*","y":"*"}}},"type":"Microsoft.AppPlatform/Spring/buildServices/builders/buildpackBindings","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/enterprise-test/providers/Microsoft.AppPlatform/Spring/test-buildpack-binding/buildServices/default/builders/default/buildpackBindings/test-binding-name-0","name":"test-binding-name-0","systemData":{"createdBy":"panli@microsoft.com","createdByType":"User","createdAt":"2022-01-07T11:56:58.77283Z","lastModifiedBy":"panli@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2022-01-07T11:56:58.77283Z"}}' + headers: + cache-control: + - no-cache + content-length: + - '727' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 07 Jan 2022 11:57:34 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:ccd65fc4-7cd4-497e-8dc8-9a76e9a43ae2 + server: + - nginx/1.17.7 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-rp-server-mvid: + - 8aeaf7a0-9097-4412-a5ee-7737152dd344 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - spring-cloud build-service builder buildpack-binding create + Connection: + - keep-alive + ParameterSetName: + - --name --type --properties --secrets -g -s + User-Agent: + - AZURECLI/2.32.0 azsdk-python-mgmt-appplatform/6.1.0 Python/3.9.9 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/enterprise-test/providers/Microsoft.AppPlatform/Spring/test-buildpack-binding?api-version=2022-01-01-preview + response: + body: + string: '{"properties":{"provisioningState":"Succeeded","zoneRedundant":false,"version":3,"serviceId":"ed7caa979562408889414f01aa59e5de","networkProfile":{"outboundIPs":{"publicIPs":["20.120.66.58","20.120.66.69"]}},"powerState":"Running","fqdn":"test-buildpack-binding.asc-test.net"},"type":"Microsoft.AppPlatform/Spring","sku":{"name":"E0","tier":"Enterprise"},"location":"eastus","tags":null,"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/enterprise-test/providers/Microsoft.AppPlatform/Spring/test-buildpack-binding","name":"test-buildpack-binding","systemData":{"createdBy":"panli@microsoft.com","createdByType":"User","createdAt":"2022-01-07T11:10:06.9913584Z","lastModifiedBy":"panli@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2022-01-07T11:10:06.9913584Z"}}' + headers: + cache-control: + - no-cache + content-length: + - '800' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 07 Jan 2022 11:57:36 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:ccd65fc4-7cd4-497e-8dc8-9a76e9a43ae2 + server: + - nginx/1.17.7 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '11999' + x-rp-server-mvid: + - 8aeaf7a0-9097-4412-a5ee-7737152dd344 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - spring-cloud build-service builder buildpack-binding create + Connection: + - keep-alive + ParameterSetName: + - --name --type --properties --secrets -g -s + User-Agent: + - AZURECLI/2.32.0 azsdk-python-mgmt-appplatform/6.1.0 Python/3.9.9 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/enterprise-test/providers/Microsoft.AppPlatform/Spring/test-buildpack-binding/buildServices/default/builders/default/buildpackBindings/test-binding-name-1?api-version=2022-01-01-preview + response: + body: + string: '{"error":{"code":"NotFound","message":"KPack buildpacksBinding does + not exist","target":"default/test-binding-name-1","details":null}}' + headers: + cache-control: + - no-cache + content-length: + - '134' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 07 Jan 2022 11:57:38 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:ccd65fc4-7cd4-497e-8dc8-9a76e9a43ae2 + server: + - nginx/1.17.7 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-rp-server-mvid: + - 8aeaf7a0-9097-4412-a5ee-7737152dd344 + status: + code: 404 + message: Not Found +- request: + body: '{"properties": {"bindingType": "NewRelic", "launchProperties": {"properties": + {"a": "b", "b": "c"}, "secrets": {"x": "y", "y": "z"}}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - spring-cloud build-service builder buildpack-binding create + Connection: + - keep-alive + Content-Length: + - '134' + Content-Type: + - application/json + ParameterSetName: + - --name --type --properties --secrets -g -s + User-Agent: + - AZURECLI/2.32.0 azsdk-python-mgmt-appplatform/6.1.0 Python/3.9.9 (Windows-10-10.0.19044-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/enterprise-test/providers/Microsoft.AppPlatform/Spring/test-buildpack-binding/buildServices/default/builders/default/buildpackBindings/test-binding-name-1?api-version=2022-01-01-preview + response: + body: + string: '{"properties":{"provisioningState":"Creating","bindingType":"NewRelic","launchProperties":{"properties":{"a":"b","b":"c"},"secrets":{"x":"*","y":"*"}}},"type":"Microsoft.AppPlatform/Spring/buildServices/builders/buildpackBindings","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/enterprise-test/providers/Microsoft.AppPlatform/Spring/test-buildpack-binding/buildServices/default/builders/default/buildpackBindings/test-binding-name-1","name":"test-binding-name-1","systemData":{"createdBy":"panli@microsoft.com","createdByType":"User","createdAt":"2022-01-07T11:57:39.2402412Z","lastModifiedBy":"panli@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2022-01-07T11:57:39.2402412Z"}}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/enterprise-test/providers/Microsoft.AppPlatform/locations/eastus/operationStatus/test-buildpack-binding/operationId/72f81f61-7e9d-446e-aef4-79a5f07d6546?api-version=2022-01-01-preview + cache-control: + - no-cache + content-length: + - '719' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 07 Jan 2022 11:57:43 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/enterprise-test/providers/Microsoft.AppPlatform/locations/eastus/operationResults/72f81f61-7e9d-446e-aef4-79a5f07d6546/Spring/test-buildpack-binding?api-version=2022-01-01-preview + pragma: + - no-cache + request-context: + - appId=cid-v1:ccd65fc4-7cd4-497e-8dc8-9a76e9a43ae2 + server: + - nginx/1.17.7 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1197' + x-rp-server-mvid: + - 8aeaf7a0-9097-4412-a5ee-7737152dd344 + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - spring-cloud build-service builder buildpack-binding create + Connection: + - keep-alive + ParameterSetName: + - --name --type --properties --secrets -g -s + User-Agent: + - AZURECLI/2.32.0 azsdk-python-mgmt-appplatform/6.1.0 Python/3.9.9 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/enterprise-test/providers/Microsoft.AppPlatform/locations/eastus/operationStatus/test-buildpack-binding/operationId/72f81f61-7e9d-446e-aef4-79a5f07d6546?api-version=2022-01-01-preview + response: + body: + string: '{"id":"subscriptions/0753feba-86f1-4242-aff1-27938fb04531/resourceGroups/enterprise-test/providers/Microsoft.AppPlatform/locations/eastus/operationStatus/test-buildpack-binding/operationId/72f81f61-7e9d-446e-aef4-79a5f07d6546","name":"72f81f61-7e9d-446e-aef4-79a5f07d6546","status":"Succeeded","startTime":"2022-01-07T11:57:43.2250279Z","endTime":"2022-01-07T11:57:50.9028007Z"}' + headers: + cache-control: + - no-cache + content-length: + - '378' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 07 Jan 2022 11:58:13 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:ccd65fc4-7cd4-497e-8dc8-9a76e9a43ae2 + server: + - nginx/1.17.7 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-rp-server-mvid: + - 8aeaf7a0-9097-4412-a5ee-7737152dd344 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - spring-cloud build-service builder buildpack-binding create + Connection: + - keep-alive + ParameterSetName: + - --name --type --properties --secrets -g -s + User-Agent: + - AZURECLI/2.32.0 azsdk-python-mgmt-appplatform/6.1.0 Python/3.9.9 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/enterprise-test/providers/Microsoft.AppPlatform/Spring/test-buildpack-binding/buildServices/default/builders/default/buildpackBindings/test-binding-name-1?api-version=2022-01-01-preview + response: + body: + string: '{"properties":{"provisioningState":"Succeeded","bindingType":"NewRelic","launchProperties":{"properties":{"a":"b","b":"c"},"secrets":{"x":"*","y":"*"}}},"type":"Microsoft.AppPlatform/Spring/buildServices/builders/buildpackBindings","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/enterprise-test/providers/Microsoft.AppPlatform/Spring/test-buildpack-binding/buildServices/default/builders/default/buildpackBindings/test-binding-name-1","name":"test-binding-name-1","systemData":{"createdBy":"panli@microsoft.com","createdByType":"User","createdAt":"2022-01-07T11:57:39.2402412Z","lastModifiedBy":"panli@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2022-01-07T11:57:39.2402412Z"}}' + headers: + cache-control: + - no-cache + content-length: + - '720' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 07 Jan 2022 11:58:15 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:ccd65fc4-7cd4-497e-8dc8-9a76e9a43ae2 + server: + - nginx/1.17.7 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-rp-server-mvid: + - 8aeaf7a0-9097-4412-a5ee-7737152dd344 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - spring-cloud build-service builder buildpack-binding list + Connection: + - keep-alive + ParameterSetName: + - -g -s + User-Agent: + - AZURECLI/2.32.0 azsdk-python-mgmt-appplatform/6.1.0 Python/3.9.9 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/enterprise-test/providers/Microsoft.AppPlatform/Spring/test-buildpack-binding?api-version=2022-01-01-preview + response: + body: + string: '{"properties":{"provisioningState":"Succeeded","zoneRedundant":false,"version":3,"serviceId":"ed7caa979562408889414f01aa59e5de","networkProfile":{"outboundIPs":{"publicIPs":["20.120.66.58","20.120.66.69"]}},"powerState":"Running","fqdn":"test-buildpack-binding.asc-test.net"},"type":"Microsoft.AppPlatform/Spring","sku":{"name":"E0","tier":"Enterprise"},"location":"eastus","tags":null,"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/enterprise-test/providers/Microsoft.AppPlatform/Spring/test-buildpack-binding","name":"test-buildpack-binding","systemData":{"createdBy":"panli@microsoft.com","createdByType":"User","createdAt":"2022-01-07T11:10:06.9913584Z","lastModifiedBy":"panli@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2022-01-07T11:10:06.9913584Z"}}' + headers: + cache-control: + - no-cache + content-length: + - '800' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 07 Jan 2022 11:58:17 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:ccd65fc4-7cd4-497e-8dc8-9a76e9a43ae2 + server: + - nginx/1.17.7 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '11996' + x-rp-server-mvid: + - 8aeaf7a0-9097-4412-a5ee-7737152dd344 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - spring-cloud build-service builder buildpack-binding list + Connection: + - keep-alive + ParameterSetName: + - -g -s + User-Agent: + - AZURECLI/2.32.0 azsdk-python-mgmt-appplatform/6.1.0 Python/3.9.9 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/enterprise-test/providers/Microsoft.AppPlatform/Spring/test-buildpack-binding/buildServices/default/builders/default/buildpackBindings?api-version=2022-01-01-preview + response: + body: + string: '{"value":[{"properties":{"provisioningState":"Succeeded","bindingType":"ApplicationInsights","launchProperties":{"properties":{"a":"b","b":"c"},"secrets":{"x":"*","y":"*"}}},"type":"Microsoft.AppPlatform/Spring/buildServices/builders/buildpackBindings","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/enterprise-test/providers/Microsoft.AppPlatform/Spring/test-buildpack-binding/buildServices/default/builders/default/buildpackBindings/test-binding-name-0","name":"test-binding-name-0","systemData":{"createdBy":"panli@microsoft.com","createdByType":"User","createdAt":"2022-01-07T11:56:58.77283Z","lastModifiedBy":"panli@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2022-01-07T11:56:58.77283Z"}},{"properties":{"provisioningState":"Succeeded","bindingType":"NewRelic","launchProperties":{"properties":{"a":"b","b":"c"},"secrets":{"x":"*","y":"*"}}},"type":"Microsoft.AppPlatform/Spring/buildServices/builders/buildpackBindings","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/enterprise-test/providers/Microsoft.AppPlatform/Spring/test-buildpack-binding/buildServices/default/builders/default/buildpackBindings/test-binding-name-1","name":"test-binding-name-1","systemData":{"createdBy":"panli@microsoft.com","createdByType":"User","createdAt":"2022-01-07T11:57:39.2402412Z","lastModifiedBy":"panli@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2022-01-07T11:57:39.2402412Z"}}]}' + headers: + cache-control: + - no-cache + content-length: + - '1460' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 07 Jan 2022 11:58:20 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:ccd65fc4-7cd4-497e-8dc8-9a76e9a43ae2 + server: + - nginx/1.17.7 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-rp-server-mvid: + - 8aeaf7a0-9097-4412-a5ee-7737152dd344 + status: + code: 200 + message: OK +version: 1 diff --git a/src/spring-cloud/azext_spring_cloud/tests/latest/test_asc_buildpack_binding.py b/src/spring-cloud/azext_spring_cloud/tests/latest/test_asc_buildpack_binding.py new file mode 100644 index 00000000000..808255952b0 --- /dev/null +++ b/src/spring-cloud/azext_spring_cloud/tests/latest/test_asc_buildpack_binding.py @@ -0,0 +1,75 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +import os +import json +from azure.cli.testsdk import (ScenarioTest, record_only) +from knack.log import get_logger + +# pylint: disable=line-too-long +# pylint: disable=too-many-lines + +@record_only() +class BuildpackBindingTest(ScenarioTest): + + def test_buildpack_binding(self): + py_path = os.path.abspath(os.path.dirname(__file__)) + + self.kwargs.update({ + 'serviceName': 'test-buildpack-binding', + 'rg': 'enterprise-test', + 'bindingName': "test-binding-name", + 'bindingType': "ApplicationInsights", + 'properties': "a=b b=c", + 'secrets': "x=y y=z", + 'builderName': "test-builder-name", + }) + + self.cmd('spring-cloud build-service builder buildpack-binding create --name {bindingName} --type {bindingType} \ + --properties {properties} --secrets {secrets} -g {rg} -s {serviceName}', + checks=[ + self.check('properties.provisioningState', 'Succeeded'), + self.check('properties.bindingType', 'ApplicationInsights'), + self.check('properties.launchProperties.properties', {'a': 'b', 'b': 'c'}), + self.check('properties.launchProperties.secrets', {'x': '*', 'y': '*'}), + ]) + + self.cmd('spring-cloud build-service builder buildpack-binding show --name {bindingName} -g {rg} -s {serviceName}', + checks=[ + self.check('properties.provisioningState', 'Succeeded'), + self.check('properties.bindingType', 'ApplicationInsights'), + ]) + + self.cmd('spring-cloud build-service builder buildpack-binding set --name {bindingName} --type NewRelic \ + --properties a=b --secrets c=d -g {rg} -s {serviceName}', + checks=[ + self.check('properties.provisioningState', 'Succeeded'), + self.check('properties.bindingType', 'NewRelic'), + self.check('properties.launchProperties.properties', {'a': 'b'}), + self.check('properties.launchProperties.secrets', {'c': '*'}), + ]) + + self.cmd('spring-cloud build-service builder buildpack-binding delete --name {bindingName} -g {rg} -s {serviceName} --yes') + + self.cmd('spring-cloud build-service builder buildpack-binding create --name {bindingName}-0 --type ApplicationInsights \ + --properties {properties} --secrets {secrets} -g {rg} -s {serviceName}', + checks=[ + self.check('properties.provisioningState', 'Succeeded'), + self.check('properties.bindingType', 'ApplicationInsights'), + self.check('properties.launchProperties.properties', {'a': 'b', 'b': 'c'}), + self.check('properties.launchProperties.secrets', {'x': '*', 'y': '*'}), + ]) + + self.cmd('spring-cloud build-service builder buildpack-binding create --name {bindingName}-1 --type NewRelic \ + --properties {properties} --secrets {secrets} -g {rg} -s {serviceName}', + checks=[ + self.check('properties.provisioningState', 'Succeeded'), + self.check('properties.bindingType', 'NewRelic'), + self.check('properties.launchProperties.properties', {'a': 'b', 'b': 'c'}), + self.check('properties.launchProperties.secrets', {'x': '*', 'y': '*'}), + ]) + + results = self.cmd('spring-cloud build-service builder buildpack-binding list -g {rg} -s {serviceName}').get_output_in_json() + self.assertEqual(2, len(results)) 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 index 53fcf2a0dd4..76f9c3dbc65 100644 --- 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 @@ -74,7 +74,7 @@ def _execute(self, resource_group, name, **kwargs): class TestSpringCloudCreateEnerprise(BasicTest): def test_asc_create_enterprise(self): - self._execute('rg', 'asc', sku=self._get_sku('Enterprise')) + self._execute('rg', 'asc', sku=self._get_sku('Enterprise'), disable_app_insights=True) resource = self.created_resource self.assertEqual('E0', resource.sku.name) self.assertEqual('Enterprise', resource.sku.tier) @@ -101,6 +101,7 @@ def _execute(self, resource_group, name, **kwargs): 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']) @@ -132,4 +133,71 @@ def test_asc_create_with_AI_name(self): 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 + self.assertEqual(True, self.monitoring_settings_resource.properties.trace_enabled) + + +class TestSpringCloudCreateEnerpriseWithApplicationInsights(BasicTest): + def _get_application_insights_client(ctx, type): + application_insights_create_resource = mock.MagicMock() + application_insights_create_resource.connection_string = 'fake-create-connection-string' + + application_insights_get_resource = mock.MagicMock() + application_insights_get_resource.connection_string = 'fake-get-connection-string' + + free_mock_client.components.create_or_update.return_value = application_insights_create_resource + free_mock_client.components.get.return_value = application_insights_get_resource + + return free_mock_client + + def __init__(self, methodName: str = ...): + super().__init__(methodName=methodName) + self.buildpack_binding_resource = None + + @mock.patch('azext_spring_cloud.buildpack_binding.get_mgmt_service_client', _get_application_insights_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 = client.buildpack_binding.begin_create_or_update.call_args_list + + self.assertEqual(1, len(call_args)) + self.assertEqual(2, len(call_args[0])) + self.assertEqual(resource_group, call_args[0][0][0]) + self.assertEqual(name, call_args[0][0][1]) + self.assertEqual("default", call_args[0][0][2]) + self.assertEqual("default", call_args[0][0][3]) + self.assertEqual("default", call_args[0][0][4]) + self.buildpack_binding_resource = call_args[0][0][5] + + def test_asc_create_with_application_insights_default(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('ApplicationInsights', self.buildpack_binding_resource.properties.binding_type) + self.assertEqual('fake-create-connection-string', + self.buildpack_binding_resource.properties.launch_properties.properties['connection-string']) + self.assertEqual(10, + self.buildpack_binding_resource.properties.launch_properties.properties['sampling-percentage']) + + def test_asc_create_with_application_insights_key(self): + self._execute('rg', 'asc', sku=self._get_sku('Enterprise'), app_insights_key='test-application-insights-key', sampling_rate=23) + resource = self.created_resource + self.assertEqual('E0', resource.sku.name) + self.assertEqual('Enterprise', resource.sku.tier) + self.assertEqual('ApplicationInsights', self.buildpack_binding_resource.properties.binding_type) + self.assertEqual('test-application-insights-key', + self.buildpack_binding_resource.properties.launch_properties.properties['connection-string']) + self.assertEqual(23, + self.buildpack_binding_resource.properties.launch_properties.properties['sampling-percentage']) + + def test_asc_create_with_application_insights_name(self): + self._execute('rg', 'asc', sku=self._get_sku('Enterprise'), app_insights='test-application-insights', sampling_rate=53) + resource = self.created_resource + self.assertEqual('E0', resource.sku.name) + self.assertEqual('Enterprise', resource.sku.tier) + self.assertEqual('ApplicationInsights', self.buildpack_binding_resource.properties.binding_type) + self.assertEqual('fake-get-connection-string', + self.buildpack_binding_resource.properties.launch_properties.properties['connection-string']) + self.assertEqual(53, + self.buildpack_binding_resource.properties.launch_properties.properties['sampling-percentage'])