diff --git a/src/command_modules/azure-cli-appservice/HISTORY.rst b/src/command_modules/azure-cli-appservice/HISTORY.rst index 8d7fd43d5d1..ead92f753e8 100644 --- a/src/command_modules/azure-cli-appservice/HISTORY.rst +++ b/src/command_modules/azure-cli-appservice/HISTORY.rst @@ -12,6 +12,7 @@ Release History * webapp, functionapp: Updating to use the new Python SDK version * appservice: adminSiteName property of SKU object is deprecated * functionapp: add ability to switch a plan underneath a function app using `az functionapp update --plan` +* functionapp: add support for azure functions premium plan scale out settings 0.2.16 ++++++ diff --git a/src/command_modules/azure-cli-appservice/azure/cli/command_modules/appservice/_help.py b/src/command_modules/azure-cli-appservice/azure/cli/command_modules/appservice/_help.py index 650d2348d91..9f0d734026b 100644 --- a/src/command_modules/azure-cli-appservice/azure/cli/command_modules/appservice/_help.py +++ b/src/command_modules/azure-cli-appservice/azure/cli/command_modules/appservice/_help.py @@ -152,12 +152,12 @@ helps['functionapp config set'] = """ type: command -short-summary: Set the web app's configuration. +short-summary: Set the function app's configuration. """ helps['functionapp config show'] = """ type: command -short-summary: Get the details of a web app's configuration. +short-summary: Get the details of a function app's configuration. """ helps['functionapp config ssl'] = """ @@ -416,14 +416,46 @@ helps['functionapp plan create'] = """ type: command -short-summary: Create an App Service Plan for an Azure Function +short-summary: Create an App Service Plan for an Azure Function. examples: + - name: Create an elastic premium app service plan with burst out capability up to 10 instances. + text: > + az functionapp plan create -g MyResourceGroup -n MyPlan --min-instances 1 --max-burst 10 --sku EP1 - name: Create a basic app service plan. text: > az functionapp plan create -g MyResourceGroup -n MyPlan --sku B1 - - name: Create a standard app service plan with with four workers. +""" + +helps['functionapp plan update'] = """ +type: command +short-summary: Update an App Service plan for an Azure Function. +examples: + - name: Update an app service plan to EP2 sku with twenty maximum workers. + text: > + az functionapp plan update -g MyResourceGroup -n MyPlan --max-burst 20 --sku EP2 +""" + +helps['functionapp plan delete'] = """ +type: command +short-summary: Delete an App Service Plan. +""" + +helps['functionapp plan list'] = """ +type: command +short-summary: List App Service Plans. +examples: + - name: List all Elastic Premium 1 tier App Service plans. text: > - az functionapp plan create -g MyResourceGroup -n MyPlan --number-of-workers 4 --sku S1 + az functionapp plan list --query "[?sku.tier=='EP1']" +""" + +helps['functionapp plan show'] = """ +type: command +short-summary: Get the App Service Plans for a resource group or a set of resource groups. +examples: + - name: Get the app service plans for a resource group or a set of resource groups. (autogenerated) + text: az functionapp plan show --name MyAppServicePlan --resource-group MyResourceGroup + crafted: true """ helps['functionapp restart'] = """ diff --git a/src/command_modules/azure-cli-appservice/azure/cli/command_modules/appservice/_params.py b/src/command_modules/azure-cli-appservice/azure/cli/command_modules/appservice/_params.py index ce86f9ad65d..0faa6d93ca7 100644 --- a/src/command_modules/azure-cli-appservice/azure/cli/command_modules/appservice/_params.py +++ b/src/command_modules/azure-cli-appservice/azure/cli/command_modules/appservice/_params.py @@ -70,6 +70,7 @@ def load_arguments(self, _): configured_default='appserviceplan', id_part='name') c.argument('number_of_workers', help='Number of workers to be allocated.', type=int, default=1) c.argument('admin_site_name', help='The name of the admin web app.', deprecate_info=c.deprecate(expiration='0.2.17')) + c.ignore('max_burst') with self.argument_context('appservice plan create') as c: c.argument('name', options_list=['--name', '-n'], help="Name of the new app service plan", completer=None) @@ -205,6 +206,9 @@ def load_arguments(self, _): c.argument('windows_fx_version', help="(Preview) a docker image name used for your windows container web app, e.g., microsoft/nanoserver:ltsc2016") if scope == 'functionapp': c.ignore('windows_fx_version') + c.argument('reserved_instance_count', options_list=['--prewarmed-instance-count'], help="Number of pre-warmed instances a function app has") + if scope == 'webapp': + c.ignore('reserved_instance_count') c.argument('java_version', help="The version used to run your web app if using Java, e.g., '1.7' for Java 7, '1.8' for Java 8") c.argument('java_container', help="The java container, e.g., Tomcat, Jetty") c.argument('java_container_version', help="The version of the java container, e.g., '8.0.23' for Tomcat") @@ -392,14 +396,22 @@ def load_arguments(self, _): c.argument('name', arg_type=name_arg_type, help='The name of the app service plan', completer=get_resource_name_completion_list('Microsoft.Web/serverFarms'), configured_default='appserviceplan', id_part='name') - c.argument('sku', required=True, help='The SKU of the app service plan.') - c.argument('number_of_workers', help='The number of workers for the app service plan.') c.argument('is_linux', arg_type=get_three_state_flag(return_label=True), required=False, help='host function app on Linux worker') + c.argument('number_of_workers', options_list=['--number-of-workers', '--min-instances'], + help='The number of workers for the app service plan.') + c.argument('max_burst', + help='The maximum number of elastic workers for the plan.') c.argument('tags', arg_type=tags_type) with self.argument_context('functionapp update') as c: c.argument('plan', required=False, help='The name or resource id of the plan to update the functionapp with.') + with self.argument_context('functionapp plan create') as c: + c.argument('sku', required=True, help='The SKU of the app service plan.') + + with self.argument_context('functionapp plan update') as c: + c.argument('sku', required=False, help='The SKU of the app service plan.') + with self.argument_context('functionapp devops-build create') as c: c.argument('functionapp_name', help="Name of the Azure Function App that you want to use", required=False) c.argument('organization_name', help="Name of the Azure DevOps organization that you want to use", required=False) diff --git a/src/command_modules/azure-cli-appservice/azure/cli/command_modules/appservice/commands.py b/src/command_modules/azure-cli-appservice/azure/cli/command_modules/appservice/commands.py index 23a77bb14cd..b014854c4bd 100644 --- a/src/command_modules/azure-cli-appservice/azure/cli/command_modules/appservice/commands.py +++ b/src/command_modules/azure-cli-appservice/azure/cli/command_modules/appservice/commands.py @@ -269,8 +269,13 @@ def load_command_table(self, _): g.custom_command('remove', 'remove_cors') g.custom_command('show', 'show_cors') - with self.command_group('functionapp plan') as g: + with self.command_group('functionapp plan', appservice_plan_sdk) as g: g.custom_command('create', 'create_functionapp_app_service_plan') + g.generic_update_command('update', custom_func_name='update_functionapp_app_service_plan', + setter_arg_name='app_service_plan') + g.command('delete', 'delete', confirmation=True) + g.custom_command('list', 'list_app_service_plans') + g.show_command('show', 'get') with self.command_group('functionapp deployment container') as g: g.custom_command('config', 'enable_cd') diff --git a/src/command_modules/azure-cli-appservice/azure/cli/command_modules/appservice/custom.py b/src/command_modules/azure-cli-appservice/azure/cli/command_modules/appservice/custom.py index cda2f5ebbd5..640ca6cbce8 100644 --- a/src/command_modules/azure-cli-appservice/azure/cli/command_modules/appservice/custom.py +++ b/src/command_modules/azure-cli-appservice/azure/cli/command_modules/appservice/custom.py @@ -390,9 +390,9 @@ def validate_plan_switch_compatibility(client, src_functionapp_instance, dest_pl src_parse_result['name']) if src_plan_info is None: raise CLIError('Could not determine the current plan of the functionapp') - elif not (is_plan_consumption(src_plan_info) or is_plan_Elastic_Premium(src_plan_info)): + elif not (is_plan_consumption(src_plan_info) or is_plan_elastic_premium(src_plan_info)): raise CLIError('Your functionapp is not using a Consumption or an Elastic Premium plan. ' + general_switch_msg) - if not (is_plan_consumption(dest_plan_instance) or is_plan_Elastic_Premium(dest_plan_instance)): + if not (is_plan_consumption(dest_plan_instance) or is_plan_elastic_premium(dest_plan_instance)): raise CLIError('You are trying to move to a plan that is not a Consumption or an Elastic Premium plan. ' + general_switch_msg) @@ -669,8 +669,8 @@ def _get_linux_multicontainer_encoded_config_from_file(file_name): # for any modifications to the non-optional parameters, adjust the reflection logic accordingly # in the method def update_site_configs(cmd, resource_group_name, name, slot=None, - linux_fx_version=None, windows_fx_version=None, php_version=None, python_version=None, # pylint: disable=unused-argument - net_framework_version=None, # pylint: disable=unused-argument + linux_fx_version=None, windows_fx_version=None, reserved_instance_count=None, php_version=None, # pylint: disable=unused-argument + python_version=None, net_framework_version=None, # pylint: disable=unused-argument java_version=None, java_container=None, java_container_version=None, # pylint: disable=unused-argument remote_debugging_enabled=None, web_sockets_enabled=None, # pylint: disable=unused-argument always_on=None, auto_heal_enabled=None, # pylint: disable=unused-argument @@ -687,14 +687,21 @@ def update_site_configs(cmd, resource_group_name, name, slot=None, else: delete_app_settings(cmd, resource_group_name, name, ["WEBSITES_ENABLE_APP_SERVICE_STORAGE"]) + if reserved_instance_count is not None: + reserved_instance_count = validate_range_of_int_flag('--prewarmed-instance-count', reserved_instance_count, + min_val=0, max_val=20) import inspect frame = inspect.currentframe() bool_flags = ['remote_debugging_enabled', 'web_sockets_enabled', 'always_on', 'auto_heal_enabled', 'use32_bit_worker_process', 'http20_enabled'] + int_flags = ['reserved_instance_count'] # note: getargvalues is used already in azure.cli.core.commands. # and no simple functional replacement for this deprecating method for 3.5 args, _, _, values = inspect.getargvalues(frame) # pylint: disable=deprecated-method + for arg in args[3:]: + if arg in int_flags and values[arg] is not None: + values[arg] = validate_and_convert_to_int(arg, values[arg]) if arg != 'generic_configurations' and values.get(arg, None): setattr(configs, arg, values[arg] if arg not in bool_flags else values[arg] == 'true') @@ -1192,6 +1199,19 @@ def update_app_service_plan(instance, sku=None, number_of_workers=None): return instance +def update_functionapp_app_service_plan(instance, sku=None, number_of_workers=None, max_burst=None): + instance = update_app_service_plan(instance, sku, number_of_workers) + if max_burst is not None: + if not is_plan_elastic_premium(instance): + raise CLIError("Usage error: --max-burst is only supported for Elastic Premium (EP) plans") + max_burst = validate_range_of_int_flag('--max-burst', max_burst, min_val=0, max_val=20) + instance.maximum_elastic_worker_count = max_burst + if number_of_workers is not None: + number_of_workers = validate_range_of_int_flag('--number-of-workers / --min-instances', + number_of_workers, min_val=0, max_val=20) + return update_app_service_plan(instance, sku, number_of_workers) + + def show_backup_configuration(cmd, resource_group_name, webapp_name, slot=None): try: return _generic_site_operation(cmd.cli_ctx, resource_group_name, webapp_name, @@ -1925,10 +1945,24 @@ def get_app_insights_key(cli_ctx, resource_group, name): def create_functionapp_app_service_plan(cmd, resource_group_name, name, is_linux, sku, - number_of_workers=None, location=None, tags=None): - # This command merely shadows 'az appservice plan create' except with a few parameters - return create_app_service_plan(cmd, resource_group_name, name, is_linux, hyper_v=None, - sku=sku, number_of_workers=number_of_workers, location=location, tags=tags) + number_of_workers=None, max_burst=None, location=None, tags=None): + sku = _normalize_sku(sku) + tier = get_sku_name(sku) + if max_burst is not None: + if tier.lower() != "elasticpremium": + raise CLIError("Usage error: --max-burst is only supported for Elastic Premium (EP) plans") + max_burst = validate_range_of_int_flag('--max-burst', max_burst, min_val=0, max_val=20) + if number_of_workers is not None: + number_of_workers = validate_range_of_int_flag('--number-of-workers / --min-elastic-worker-count', + number_of_workers, min_val=0, max_val=20) + client = web_client_factory(cmd.cli_ctx) + if location is None: + location = _get_location_from_resource_group(cmd.cli_ctx, resource_group_name) + sku_def = SkuDescription(tier=tier, name=sku, capacity=number_of_workers) + plan_def = AppServicePlan(location=location, tags=tags, sku=sku_def, + reserved=(is_linux or None), maximum_elastic_worker_count=max_burst, + hyper_v=None, name=name) + return client.app_service_plans.create_or_update(resource_group_name, name, plan_def) def is_plan_consumption(plan_info): @@ -1938,13 +1972,28 @@ def is_plan_consumption(plan_info): return False -def is_plan_Elastic_Premium(plan_info): +def is_plan_elastic_premium(plan_info): if isinstance(plan_info, AppServicePlan): if isinstance(plan_info.sku, SkuDescription): return plan_info.sku.tier == 'ElasticPremium' return False +def validate_and_convert_to_int(flag, val): + try: + return int(val) + except ValueError: + raise CLIError("Usage error: {} is expected to have an int value.".format(flag)) + + +def validate_range_of_int_flag(flag_name, value, min_val, max_val): + value = validate_and_convert_to_int(flag_name, value) + if min_val > value or value > max_val: + raise CLIError("Usage error: {} is expected to be between {} and {} (inclusive)".format(flag_name, min_val, + max_val)) + return value + + def create_function(cmd, resource_group_name, name, storage_account, plan=None, os_type=None, runtime=None, consumption_plan_location=None, app_insights=None, app_insights_key=None, deployment_source_url=None, @@ -2030,7 +2079,7 @@ def create_function(cmd, resource_group_name, name, storage_account, plan=None, site_config.app_settings.append(NameValuePair(name='AzureWebJobsDashboard', value=con_string)) site_config.app_settings.append(NameValuePair(name='WEBSITE_NODE_DEFAULT_VERSION', value='8.11.1')) - if consumption_plan_location is None and not is_plan_Elastic_Premium(plan_info): + if consumption_plan_location is None and not is_plan_elastic_premium(plan_info): site_config.always_on = True else: site_config.app_settings.append(NameValuePair(name='WEBSITE_CONTENTAZUREFILECONNECTIONSTRING', diff --git a/src/command_modules/azure-cli-appservice/azure/cli/command_modules/appservice/tests/latest/recordings/test_functionapp_elastic_plan.yaml b/src/command_modules/azure-cli-appservice/azure/cli/command_modules/appservice/tests/latest/recordings/test_functionapp_elastic_plan.yaml new file mode 100644 index 00000000000..3225645d80d --- /dev/null +++ b/src/command_modules/azure-cli-appservice/azure/cli/command_modules/appservice/tests/latest/recordings/test_functionapp_elastic_plan.yaml @@ -0,0 +1,251 @@ +interactions: +- request: + body: '{"location": "centralus", "tags": {"product": "azurecli", "cause": "automation", + "date": "2019-04-03T23:49:01Z"}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [group create] + Connection: [keep-alive] + Content-Length: ['113'] + Content-Type: [application/json; charset=utf-8] + ParameterSetName: [--location --name --tag] + User-Agent: [python/3.6.6 (Windows-10-10.0.17763-SP0) msrest/0.6.2 msrest_azure/0.4.34 + resourcemanagementclient/2.0.0 Azure-SDK-For-Python AZURECLI/2.0.61] + accept-language: [en-US] + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001?api-version=2018-05-01 + response: + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","name":"clitest.rg000001","location":"centralus","tags":{"product":"azurecli","cause":"automation","date":"2019-04-03T23:49:01Z"},"properties":{"provisioningState":"Succeeded"}}'} + headers: + cache-control: [no-cache] + content-length: ['387'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 03 Apr 2019 23:49:03 GMT'] + expires: ['-1'] + pragma: [no-cache] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-subscription-writes: ['1199'] + status: {code: 201, message: Created} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [functionapp plan create] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + ParameterSetName: [-g -n --sku --min-instances --max-burst] + User-Agent: [python/3.6.6 (Windows-10-10.0.17763-SP0) msrest/0.6.2 msrest_azure/0.4.34 + resourcemanagementclient/2.0.0 Azure-SDK-For-Python AZURECLI/2.0.61] + accept-language: [en-US] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001?api-version=2018-05-01 + response: + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","name":"clitest.rg000001","location":"centralus","tags":{"product":"azurecli","cause":"automation","date":"2019-04-03T23:49:01Z"},"properties":{"provisioningState":"Succeeded"}}'} + headers: + cache-control: [no-cache] + content-length: ['387'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 03 Apr 2019 23:49:06 GMT'] + expires: ['-1'] + pragma: [no-cache] + strict-transport-security: [max-age=31536000; includeSubDomains] + vary: [Accept-Encoding] + x-content-type-options: [nosniff] + status: {code: 200, message: OK} +- request: + body: '{"location": "centralus", "properties": {"perSiteScaling": false, "maximumElasticWorkerCount": + 12, "isXenon": false}, "sku": {"name": "EP1", "tier": "ElasticPremium", "capacity": + 4}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [functionapp plan create] + Connection: [keep-alive] + Content-Length: ['182'] + Content-Type: [application/json; charset=utf-8] + ParameterSetName: [-g -n --sku --min-instances --max-burst] + User-Agent: [python/3.6.6 (Windows-10-10.0.17763-SP0) msrest/0.6.2 msrest_azure/0.4.34 + azure-mgmt-web/0.41.0 Azure-SDK-For-Python AZURECLI/2.0.61] + accept-language: [en-US] + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Web/serverfarms/funcappplan000002?api-version=2018-02-01 + response: + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Web/serverfarms/funcappplan000002","name":"funcappplan000002","type":"Microsoft.Web/serverfarms","kind":"elastic","location":"Central + US","properties":{"serverFarmId":14062,"name":"funcappplan000002","workerSize":"D1","workerSizeId":3,"workerTierName":null,"numberOfWorkers":4,"currentWorkerSize":"D1","currentWorkerSizeId":3,"currentNumberOfWorkers":4,"status":"Ready","webSpace":"clitest.rg000001-CentralUSwebspace","subscription":"0043ac27-403a-4a41-85b6-c4751acd3610","adminSiteName":null,"hostingEnvironment":null,"hostingEnvironmentProfile":null,"maximumNumberOfWorkers":20,"planName":"VirtualDedicatedPlan","adminRuntimeSiteName":null,"computeMode":"Dedicated","siteMode":null,"geoRegion":"Central + US","perSiteScaling":false,"maximumElasticWorkerCount":12,"numberOfSites":0,"hostingEnvironmentId":null,"isSpot":false,"spotExpirationTime":null,"freeOfferExpirationTime":null,"tags":null,"kind":"elastic","resourceGroup":"clitest.rg000001","reserved":false,"isXenon":false,"hyperV":false,"mdmId":"waws-prod-dm1-119_14062","targetWorkerCount":0,"targetWorkerSizeId":0,"provisioningState":"Succeeded","webSiteId":null},"sku":{"name":"EP1","tier":"ElasticPremium","size":"EP1","family":"EP","capacity":4}}'} + headers: + cache-control: [no-cache] + content-length: ['1516'] + content-type: [application/json] + date: ['Wed, 03 Apr 2019 23:49:17 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/10.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-subscription-writes: ['1199'] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [functionapp plan update] + Connection: [keep-alive] + ParameterSetName: [-g -n --min-instances --max-burst] + User-Agent: [python/3.6.6 (Windows-10-10.0.17763-SP0) msrest/0.6.2 msrest_azure/0.4.34 + azure-mgmt-web/0.41.0 Azure-SDK-For-Python AZURECLI/2.0.61] + accept-language: [en-US] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Web/serverfarms/funcappplan000002?api-version=2018-02-01 + response: + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Web/serverfarms/funcappplan000002","name":"funcappplan000002","type":"Microsoft.Web/serverfarms","kind":"elastic","location":"Central + US","properties":{"serverFarmId":14062,"name":"funcappplan000002","workerSize":"D1","workerSizeId":3,"workerTierName":null,"numberOfWorkers":4,"currentWorkerSize":"D1","currentWorkerSizeId":3,"currentNumberOfWorkers":4,"status":"Ready","webSpace":"clitest.rg000001-CentralUSwebspace","subscription":"0043ac27-403a-4a41-85b6-c4751acd3610","adminSiteName":null,"hostingEnvironment":null,"hostingEnvironmentProfile":null,"maximumNumberOfWorkers":20,"planName":"VirtualDedicatedPlan","adminRuntimeSiteName":null,"computeMode":"Dedicated","siteMode":null,"geoRegion":"Central + US","perSiteScaling":false,"maximumElasticWorkerCount":12,"numberOfSites":0,"hostingEnvironmentId":null,"isSpot":false,"spotExpirationTime":null,"freeOfferExpirationTime":null,"tags":null,"kind":"elastic","resourceGroup":"clitest.rg000001","reserved":false,"isXenon":false,"hyperV":false,"mdmId":"waws-prod-dm1-119_14062","targetWorkerCount":0,"targetWorkerSizeId":0,"provisioningState":"Succeeded","webSiteId":null},"sku":{"name":"EP1","tier":"ElasticPremium","size":"EP1","family":"EP","capacity":4}}'} + headers: + cache-control: [no-cache] + content-length: ['1516'] + content-type: [application/json] + date: ['Wed, 03 Apr 2019 23:49:18 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/10.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: '{"kind": "elastic", "location": "Central US", "properties": {"perSiteScaling": + false, "maximumElasticWorkerCount": 11, "isSpot": false, "reserved": false, + "isXenon": false, "hyperV": false, "targetWorkerCount": 0, "targetWorkerSizeId": + 0}, "sku": {"name": "EP1", "tier": "ElasticPremium", "size": "EP1", "family": + "EP", "capacity": 5}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [functionapp plan update] + Connection: [keep-alive] + Content-Length: ['335'] + Content-Type: [application/json; charset=utf-8] + ParameterSetName: [-g -n --min-instances --max-burst] + User-Agent: [python/3.6.6 (Windows-10-10.0.17763-SP0) msrest/0.6.2 msrest_azure/0.4.34 + azure-mgmt-web/0.41.0 Azure-SDK-For-Python AZURECLI/2.0.61] + accept-language: [en-US] + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Web/serverfarms/funcappplan000002?api-version=2018-02-01 + response: + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Web/serverfarms/funcappplan000002","name":"funcappplan000002","type":"Microsoft.Web/serverfarms","kind":"elastic","location":"Central + US","properties":{"serverFarmId":14062,"name":"funcappplan000002","sku":{"name":"EP1","tier":"ElasticPremium","size":"EP1","capacity":5},"workerSize":"D1","workerSizeId":3,"workerTierName":null,"numberOfWorkers":5,"currentWorkerSize":"D1","currentWorkerSizeId":3,"currentNumberOfWorkers":5,"status":"Ready","webSpace":"clitest.rg000001-CentralUSwebspace","subscription":"0043ac27-403a-4a41-85b6-c4751acd3610","adminSiteName":null,"hostingEnvironment":null,"hostingEnvironmentProfile":null,"maximumNumberOfWorkers":20,"planName":"VirtualDedicatedPlan","adminRuntimeSiteName":null,"computeMode":"Dedicated","siteMode":null,"geoRegion":"Central + US","perSiteScaling":false,"maximumElasticWorkerCount":11,"numberOfSites":0,"hostingEnvironmentId":null,"isSpot":false,"spotExpirationTime":null,"freeOfferExpirationTime":null,"tags":null,"kind":"elastic","resourceGroup":"clitest.rg000001","reserved":false,"isXenon":false,"hyperV":false,"mdmId":"waws-prod-dm1-119_14062","targetWorkerCount":0,"targetWorkerSizeId":0,"provisioningState":null,"webSiteId":null},"sku":{"name":"EP1","tier":"ElasticPremium","size":"EP1","capacity":5}}'} + headers: + cache-control: [no-cache] + content-length: ['1566'] + content-type: [application/json] + date: ['Wed, 03 Apr 2019 23:49:22 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/10.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-subscription-writes: ['1199'] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [functionapp plan show] + Connection: [keep-alive] + ParameterSetName: [-g -n] + User-Agent: [python/3.6.6 (Windows-10-10.0.17763-SP0) msrest/0.6.2 msrest_azure/0.4.34 + azure-mgmt-web/0.41.0 Azure-SDK-For-Python AZURECLI/2.0.61] + accept-language: [en-US] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Web/serverfarms/funcappplan000002?api-version=2018-02-01 + response: + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Web/serverfarms/funcappplan000002","name":"funcappplan000002","type":"Microsoft.Web/serverfarms","kind":"elastic","location":"Central + US","properties":{"serverFarmId":14062,"name":"funcappplan000002","workerSize":"D1","workerSizeId":3,"workerTierName":null,"numberOfWorkers":5,"currentWorkerSize":"D1","currentWorkerSizeId":3,"currentNumberOfWorkers":5,"status":"Ready","webSpace":"clitest.rg000001-CentralUSwebspace","subscription":"0043ac27-403a-4a41-85b6-c4751acd3610","adminSiteName":null,"hostingEnvironment":null,"hostingEnvironmentProfile":null,"maximumNumberOfWorkers":20,"planName":"VirtualDedicatedPlan","adminRuntimeSiteName":null,"computeMode":"Dedicated","siteMode":null,"geoRegion":"Central + US","perSiteScaling":false,"maximumElasticWorkerCount":11,"numberOfSites":0,"hostingEnvironmentId":null,"isSpot":false,"spotExpirationTime":null,"freeOfferExpirationTime":null,"tags":null,"kind":"elastic","resourceGroup":"clitest.rg000001","reserved":false,"isXenon":false,"hyperV":false,"mdmId":"waws-prod-dm1-119_14062","targetWorkerCount":0,"targetWorkerSizeId":0,"provisioningState":"Succeeded","webSiteId":null},"sku":{"name":"EP1","tier":"ElasticPremium","size":"EP1","family":"EP","capacity":5}}'} + headers: + cache-control: [no-cache] + content-length: ['1516'] + content-type: [application/json] + date: ['Wed, 03 Apr 2019 23:49:23 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/10.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [functionapp delete] + Connection: [keep-alive] + Content-Length: ['0'] + ParameterSetName: [-g -n] + User-Agent: [python/3.6.6 (Windows-10-10.0.17763-SP0) msrest/0.6.2 msrest_azure/0.4.34 + azure-mgmt-web/0.41.0 Azure-SDK-For-Python AZURECLI/2.0.61] + accept-language: [en-US] + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Web/sites/funcappplan000002?api-version=2018-02-01 + response: + body: {string: ''} + headers: + cache-control: [no-cache] + date: ['Wed, 03 Apr 2019 23:49:24 GMT'] + expires: ['-1'] + pragma: [no-cache] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-subscription-deletes: ['14999'] + status: {code: 204, message: No Content} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [group delete] + Connection: [keep-alive] + Content-Length: ['0'] + Content-Type: [application/json; charset=utf-8] + ParameterSetName: [--name --yes --no-wait] + User-Agent: [python/3.6.6 (Windows-10-10.0.17763-SP0) msrest/0.6.2 msrest_azure/0.4.34 + resourcemanagementclient/2.0.0 Azure-SDK-For-Python AZURECLI/2.0.61] + accept-language: [en-US] + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001?api-version=2018-05-01 + response: + body: {string: ''} + headers: + cache-control: [no-cache] + content-length: ['0'] + date: ['Wed, 03 Apr 2019 23:49:26 GMT'] + expires: ['-1'] + location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DTElURVNUOjJFUkdFSzdBNjNUVURHUEE1UFUzWlhIRERHWk0yQkpBWUpXSFBXUXxEQTIxMDcxNkExREJFNjg3LUNFTlRSQUxVUyIsImpvYkxvY2F0aW9uIjoiY2VudHJhbHVzIn0?api-version=2018-05-01'] + pragma: [no-cache] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-subscription-deletes: ['14999'] + status: {code: 202, message: Accepted} +version: 1 diff --git a/src/command_modules/azure-cli-appservice/azure/cli/command_modules/appservice/tests/latest/recordings/test_functionapp_reserved_instance.yaml b/src/command_modules/azure-cli-appservice/azure/cli/command_modules/appservice/tests/latest/recordings/test_functionapp_reserved_instance.yaml new file mode 100644 index 00000000000..5af820428c7 --- /dev/null +++ b/src/command_modules/azure-cli-appservice/azure/cli/command_modules/appservice/tests/latest/recordings/test_functionapp_reserved_instance.yaml @@ -0,0 +1,449 @@ +interactions: +- request: + body: '{"location": "westus", "tags": {"product": "azurecli", "cause": "automation", + "date": "2019-04-03T23:47:23Z"}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [group create] + Connection: [keep-alive] + Content-Length: ['110'] + Content-Type: [application/json; charset=utf-8] + ParameterSetName: [--location --name --tag] + User-Agent: [python/3.6.6 (Windows-10-10.0.17763-SP0) msrest/0.6.2 msrest_azure/0.4.34 + resourcemanagementclient/2.0.0 Azure-SDK-For-Python AZURECLI/2.0.61] + accept-language: [en-US] + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001?api-version=2018-05-01 + response: + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","name":"clitest.rg000001","location":"westus","tags":{"product":"azurecli","cause":"automation","date":"2019-04-03T23:47:23Z"},"properties":{"provisioningState":"Succeeded"}}'} + headers: + cache-control: [no-cache] + content-length: ['384'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 03 Apr 2019 23:47:27 GMT'] + expires: ['-1'] + pragma: [no-cache] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-subscription-writes: ['1199'] + status: {code: 201, message: Created} +- request: + body: '{"sku": {"name": "Standard_LRS"}, "kind": "Storage", "location": "westus"}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [storage account create] + Connection: [keep-alive] + Content-Length: ['74'] + Content-Type: [application/json; charset=utf-8] + ParameterSetName: [-n -g -l --sku] + User-Agent: [python/3.6.6 (Windows-10-10.0.17763-SP0) msrest/0.6.2 msrest_azure/0.4.34 + azure-mgmt-storage/3.1.1 Azure-SDK-For-Python AZURECLI/2.0.61] + accept-language: [en-US] + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Storage/storageAccounts/clitest000002?api-version=2018-07-01 + response: + body: {string: ''} + headers: + cache-control: [no-cache] + content-length: ['0'] + content-type: [text/plain; charset=utf-8] + date: ['Wed, 03 Apr 2019 23:47:29 GMT'] + expires: ['-1'] + location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Storage/locations/westus/asyncoperations/5c7e01a1-a8a1-44fa-81e0-a564b5bac2e5?monitor=true&api-version=2018-07-01'] + pragma: [no-cache] + server: ['Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 + Microsoft-HTTPAPI/2.0'] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-subscription-writes: ['1199'] + status: {code: 202, message: Accepted} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [storage account create] + Connection: [keep-alive] + ParameterSetName: [-n -g -l --sku] + User-Agent: [python/3.6.6 (Windows-10-10.0.17763-SP0) msrest/0.6.2 msrest_azure/0.4.34 + azure-mgmt-storage/3.1.1 Azure-SDK-For-Python AZURECLI/2.0.61] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Storage/locations/westus/asyncoperations/5c7e01a1-a8a1-44fa-81e0-a564b5bac2e5?monitor=true&api-version=2018-07-01 + response: + body: {string: '{"sku":{"name":"Standard_LRS","tier":"Standard"},"kind":"Storage","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Storage/storageAccounts/clitest000002","name":"clitest000002","type":"Microsoft.Storage/storageAccounts","location":"westus","tags":{},"properties":{"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":false,"encryption":{"services":{"file":{"enabled":true,"lastEnabledTime":"2019-04-03T23:47:29.5136065Z"},"blob":{"enabled":true,"lastEnabledTime":"2019-04-03T23:47:29.5136065Z"}},"keySource":"Microsoft.Storage"},"provisioningState":"Succeeded","creationTime":"2019-04-03T23:47:29.4199001Z","primaryEndpoints":{"blob":"https://clitest000002.blob.core.windows.net/","queue":"https://clitest000002.queue.core.windows.net/","table":"https://clitest000002.table.core.windows.net/","file":"https://clitest000002.file.core.windows.net/"},"primaryLocation":"westus","statusOfPrimary":"available"}}'} + headers: + cache-control: [no-cache] + content-length: ['1169'] + content-type: [application/json] + date: ['Wed, 03 Apr 2019 23:47:47 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: ['Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 + Microsoft-HTTPAPI/2.0'] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-content-type-options: [nosniff] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [storage account keys list] + Connection: [keep-alive] + Content-Length: ['0'] + ParameterSetName: [-n -g --query -o] + User-Agent: [python/3.6.6 (Windows-10-10.0.17763-SP0) msrest/0.6.2 msrest_azure/0.4.34 + azure-mgmt-storage/3.1.1 Azure-SDK-For-Python AZURECLI/2.0.61] + accept-language: [en-US] + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Storage/storageAccounts/clitest000002/listKeys?api-version=2018-07-01 + response: + body: {string: '{"keys":[{"keyName":"key1","value":"veryFakedStorageAccountKey==","permissions":"FULL"},{"keyName":"key2","value":"veryFakedStorageAccountKey==","permissions":"FULL"}]}'} + headers: + cache-control: [no-cache] + content-length: ['288'] + content-type: [application/json] + date: ['Wed, 03 Apr 2019 23:47:49 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: ['Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 + Microsoft-HTTPAPI/2.0'] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-subscription-writes: ['1199'] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [functionapp create] + Connection: [keep-alive] + ParameterSetName: [-g -n -c -s --os-type] + User-Agent: [python/3.6.6 (Windows-10-10.0.17763-SP0) msrest/0.6.2 msrest_azure/0.4.34 + azure-mgmt-web/0.41.0 Azure-SDK-For-Python AZURECLI/2.0.61] + accept-language: [en-US] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Web/geoRegions?sku=Dynamic&api-version=2018-02-01 + response: + body: {string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Web/geoRegions/Central + US","name":"Central US","type":"Microsoft.Web/geoRegions","properties":{"name":"Central + US","description":null,"sortOrder":0,"displayName":"Central US"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Web/geoRegions/North + Europe","name":"North Europe","type":"Microsoft.Web/geoRegions","properties":{"name":"North + Europe","description":null,"sortOrder":1,"displayName":"North Europe"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Web/geoRegions/West + Europe","name":"West Europe","type":"Microsoft.Web/geoRegions","properties":{"name":"West + Europe","description":null,"sortOrder":2,"displayName":"West Europe"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Web/geoRegions/Southeast + Asia","name":"Southeast Asia","type":"Microsoft.Web/geoRegions","properties":{"name":"Southeast + Asia","description":null,"sortOrder":3,"displayName":"Southeast Asia"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Web/geoRegions/East + Asia","name":"East Asia","type":"Microsoft.Web/geoRegions","properties":{"name":"East + Asia","description":null,"sortOrder":4,"displayName":"East Asia"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Web/geoRegions/West + US","name":"West US","type":"Microsoft.Web/geoRegions","properties":{"name":"West + US","description":null,"sortOrder":5,"displayName":"West US"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Web/geoRegions/East + US","name":"East US","type":"Microsoft.Web/geoRegions","properties":{"name":"East + US","description":null,"sortOrder":6,"displayName":"East US"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Web/geoRegions/Japan + West","name":"Japan West","type":"Microsoft.Web/geoRegions","properties":{"name":"Japan + West","description":null,"sortOrder":7,"displayName":"Japan West"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Web/geoRegions/Japan + East","name":"Japan East","type":"Microsoft.Web/geoRegions","properties":{"name":"Japan + East","description":null,"sortOrder":8,"displayName":"Japan East"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Web/geoRegions/East + US 2","name":"East US 2","type":"Microsoft.Web/geoRegions","properties":{"name":"East + US 2","description":null,"sortOrder":9,"displayName":"East US 2"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Web/geoRegions/North + Central US","name":"North Central US","type":"Microsoft.Web/geoRegions","properties":{"name":"North + Central US","description":null,"sortOrder":10,"displayName":"North Central + US"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Web/geoRegions/South + Central US","name":"South Central US","type":"Microsoft.Web/geoRegions","properties":{"name":"South + Central US","description":null,"sortOrder":11,"displayName":"South Central + US"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Web/geoRegions/Brazil + South","name":"Brazil South","type":"Microsoft.Web/geoRegions","properties":{"name":"Brazil + South","description":null,"sortOrder":12,"displayName":"Brazil South"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Web/geoRegions/Australia + East","name":"Australia East","type":"Microsoft.Web/geoRegions","properties":{"name":"Australia + East","description":null,"sortOrder":13,"displayName":"Australia East"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Web/geoRegions/Australia + Southeast","name":"Australia Southeast","type":"Microsoft.Web/geoRegions","properties":{"name":"Australia + Southeast","description":null,"sortOrder":14,"displayName":"Australia Southeast"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Web/geoRegions/Central + India","name":"Central India","type":"Microsoft.Web/geoRegions","properties":{"name":"Central + India","description":null,"sortOrder":2147483647,"displayName":"Central India"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Web/geoRegions/West + India","name":"West India","type":"Microsoft.Web/geoRegions","properties":{"name":"West + India","description":null,"sortOrder":2147483647,"displayName":"West India"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Web/geoRegions/South + India","name":"South India","type":"Microsoft.Web/geoRegions","properties":{"name":"South + India","description":null,"sortOrder":2147483647,"displayName":"South India"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Web/geoRegions/Canada + Central","name":"Canada Central","type":"Microsoft.Web/geoRegions","properties":{"name":"Canada + Central","description":null,"sortOrder":2147483647,"displayName":"Canada Central"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Web/geoRegions/Canada + East","name":"Canada East","type":"Microsoft.Web/geoRegions","properties":{"name":"Canada + East","description":null,"sortOrder":2147483647,"displayName":"Canada East"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Web/geoRegions/West + Central US","name":"West Central US","type":"Microsoft.Web/geoRegions","properties":{"name":"West + Central US","description":null,"sortOrder":2147483647,"displayName":"West + Central US"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Web/geoRegions/West + US 2","name":"West US 2","type":"Microsoft.Web/geoRegions","properties":{"name":"West + US 2","description":null,"sortOrder":2147483647,"displayName":"West US 2"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Web/geoRegions/UK + West","name":"UK West","type":"Microsoft.Web/geoRegions","properties":{"name":"UK + West","description":null,"sortOrder":2147483647,"displayName":"UK West"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Web/geoRegions/UK + South","name":"UK South","type":"Microsoft.Web/geoRegions","properties":{"name":"UK + South","description":null,"sortOrder":2147483647,"displayName":"UK South"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Web/geoRegions/Korea + Central","name":"Korea Central","type":"Microsoft.Web/geoRegions","properties":{"name":"Korea + Central","description":null,"sortOrder":2147483647,"displayName":"Korea Central"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Web/geoRegions/France + Central","name":"France Central","type":"Microsoft.Web/geoRegions","properties":{"name":"France + Central","description":null,"sortOrder":2147483647,"displayName":"France Central"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Web/geoRegions/Australia + Central","name":"Australia Central","type":"Microsoft.Web/geoRegions","properties":{"name":"Australia + Central","description":null,"sortOrder":2147483647,"displayName":"Australia + Central"}}],"nextLink":null,"id":null}'} + headers: + cache-control: [no-cache] + content-length: ['7254'] + content-type: [application/json] + date: ['Wed, 03 Apr 2019 23:47:51 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/10.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [functionapp create] + Connection: [keep-alive] + ParameterSetName: [-g -n -c -s --os-type] + User-Agent: [python/3.6.6 (Windows-10-10.0.17763-SP0) msrest/0.6.2 msrest_azure/0.4.34 + azure-mgmt-storage/3.1.1 Azure-SDK-For-Python AZURECLI/2.0.61] + accept-language: [en-US] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Storage/storageAccounts/clitest000002?api-version=2018-07-01 + response: + body: {string: '{"sku":{"name":"Standard_LRS","tier":"Standard"},"kind":"Storage","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Storage/storageAccounts/clitest000002","name":"clitest000002","type":"Microsoft.Storage/storageAccounts","location":"westus","tags":{},"properties":{"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":false,"encryption":{"services":{"file":{"enabled":true,"lastEnabledTime":"2019-04-03T23:47:29.5136065Z"},"blob":{"enabled":true,"lastEnabledTime":"2019-04-03T23:47:29.5136065Z"}},"keySource":"Microsoft.Storage"},"provisioningState":"Succeeded","creationTime":"2019-04-03T23:47:29.4199001Z","primaryEndpoints":{"blob":"https://clitest000002.blob.core.windows.net/","queue":"https://clitest000002.queue.core.windows.net/","table":"https://clitest000002.table.core.windows.net/","file":"https://clitest000002.file.core.windows.net/"},"primaryLocation":"westus","statusOfPrimary":"available"}}'} + headers: + cache-control: [no-cache] + content-length: ['1169'] + content-type: [application/json] + date: ['Wed, 03 Apr 2019 23:47:52 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: ['Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 + Microsoft-HTTPAPI/2.0'] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-content-type-options: [nosniff] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [functionapp create] + Connection: [keep-alive] + Content-Length: ['0'] + ParameterSetName: [-g -n -c -s --os-type] + User-Agent: [python/3.6.6 (Windows-10-10.0.17763-SP0) msrest/0.6.2 msrest_azure/0.4.34 + azure-mgmt-storage/3.1.1 Azure-SDK-For-Python AZURECLI/2.0.61] + accept-language: [en-US] + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Storage/storageAccounts/clitest000002/listKeys?api-version=2018-07-01 + response: + body: {string: '{"keys":[{"keyName":"key1","value":"veryFakedStorageAccountKey==","permissions":"FULL"},{"keyName":"key2","value":"veryFakedStorageAccountKey==","permissions":"FULL"}]}'} + headers: + cache-control: [no-cache] + content-length: ['288'] + content-type: [application/json] + date: ['Wed, 03 Apr 2019 23:47:53 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: ['Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 + Microsoft-HTTPAPI/2.0'] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-subscription-writes: ['1199'] + status: {code: 200, message: OK} +- request: + body: 'b''b\''{"kind": "functionapp", "location": "westus", "properties": {"reserved": + false, "isXenon": false, "hyperV": false, "siteConfig": {"netFrameworkVersion": + "v4.6", "appSettings": [{"name": "FUNCTIONS_EXTENSION_VERSION", "value": "~2"}, + {"name": "AzureWebJobsStorage", "value": "DefaultEndpointsProtocol=https;EndpointSuffix=core.windows.net;AccountName=clitest000002;AccountKey=veryFakedStorageAccountKey=="}, + {"name": "AzureWebJobsDashboard", "value": "DefaultEndpointsProtocol=https;EndpointSuffix=core.windows.net;AccountName=clitest000002;AccountKey=veryFakedStorageAccountKey=="}, + {"name": "WEBSITE_NODE_DEFAULT_VERSION", "value": "8.11.1"}, {"name": "WEBSITE_CONTENTAZUREFILECONNECTIONSTRING", + "value": "DefaultEndpointsProtocol=https;EndpointSuffix=core.windows.net;AccountName=clitest000002;AccountKey=veryFakedStorageAccountKey=="}, + {"name": "WEBSITE_CONTENTSHARE", "value": "functionappwithreservedinstance000003"}], + "localMySqlEnabled": false, "http20Enabled": true}, "scmSiteAlsoStopped": false}}\''''' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [functionapp create] + Connection: [keep-alive] + Content-Length: ['1221'] + Content-Type: [application/json; charset=utf-8] + ParameterSetName: [-g -n -c -s --os-type] + User-Agent: [python/3.6.6 (Windows-10-10.0.17763-SP0) msrest/0.6.2 msrest_azure/0.4.34 + azure-mgmt-web/0.41.0 Azure-SDK-For-Python AZURECLI/2.0.61] + accept-language: [en-US] + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Web/sites/functionappwithreservedinstance000003?api-version=2018-02-01 + response: + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Web/sites/functionappwithreservedinstance000003","name":"functionappwithreservedinstance000003","type":"Microsoft.Web/sites","kind":"functionapp","location":"westus","properties":{"name":"functionappwithreservedinstance000003","state":"Running","hostNames":["functionappwithreservedinstance000003.azurewebsites.net"],"webSpace":"clitest.rg000001-WestUSwebspace","selfLink":"https://waws-prod-bay-077.api.azurewebsites.windows.net:454/subscriptions/00000000-0000-0000-0000-000000000000/webspaces/clitest.rg000001-WestUSwebspace/sites/functionappwithreservedinstance000003","repositorySiteName":"functionappwithreservedinstance000003","owner":null,"usageState":"Normal","enabled":true,"adminEnabled":true,"enabledHostNames":["functionappwithreservedinstance000003.azurewebsites.net","functionappwithreservedinstance000003.scm.azurewebsites.net"],"siteProperties":{"metadata":null,"properties":[{"name":"LinuxFxVersion","value":""},{"name":"WindowsFxVersion","value":null}],"appSettings":null},"availabilityState":"Normal","sslCertificates":null,"csrs":[],"cers":null,"siteMode":null,"hostNameSslStates":[{"name":"functionappwithreservedinstance000003.azurewebsites.net","sslState":"Disabled","ipBasedSslResult":null,"virtualIP":null,"thumbprint":null,"toUpdate":null,"toUpdateIpBasedSsl":null,"ipBasedSslState":"NotConfigured","hostType":"Standard"},{"name":"functionappwithreservedinstance000003.scm.azurewebsites.net","sslState":"Disabled","ipBasedSslResult":null,"virtualIP":null,"thumbprint":null,"toUpdate":null,"toUpdateIpBasedSsl":null,"ipBasedSslState":"NotConfigured","hostType":"Repository"}],"computeMode":null,"serverFarm":null,"serverFarmId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Web/serverfarms/WestUSPlan","reserved":false,"isXenon":false,"hyperV":false,"lastModifiedTimeUtc":"2019-04-03T23:48:01.7833333","storageRecoveryDefaultState":"Running","contentAvailabilityState":"Normal","runtimeAvailabilityState":"Normal","siteConfig":null,"deploymentId":"functionappwithreservedinstance000003","trafficManagerHostNames":null,"sku":"Dynamic","scmSiteAlsoStopped":false,"targetSwapSlot":null,"hostingEnvironment":null,"hostingEnvironmentProfile":null,"clientAffinityEnabled":false,"clientCertEnabled":false,"clientCertExclusionPaths":null,"hostNamesDisabled":false,"domainVerificationIdentifiers":null,"kind":"functionapp","outboundIpAddresses":"138.91.247.220,138.91.246.230,138.91.246.197,138.91.241.182","possibleOutboundIpAddresses":"138.91.247.220,138.91.246.230,138.91.246.197,138.91.241.182","containerSize":1536,"dailyMemoryTimeQuota":0,"suspendedTill":null,"siteDisabledReason":0,"functionExecutionUnitsCache":null,"maxNumberOfWorkers":null,"homeStamp":"waws-prod-bay-077","cloningInfo":null,"hostingEnvironmentId":null,"tags":null,"resourceGroup":"clitest.rg000001","defaultHostName":"functionappwithreservedinstance000003.azurewebsites.net","slotSwapStatus":null,"httpsOnly":false,"redundancyMode":"None","inProgressOperationId":null,"geoDistributions":null}}'} + headers: + cache-control: [no-cache] + content-length: ['3487'] + content-type: [application/json] + date: ['Wed, 03 Apr 2019 23:48:36 GMT'] + etag: ['"1D4EA77AD2EFFD5"'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/10.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-subscription-resource-requests: ['499'] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [functionapp config set] + Connection: [keep-alive] + ParameterSetName: [-g -n --prewarmed-instance-count] + User-Agent: [python/3.6.6 (Windows-10-10.0.17763-SP0) msrest/0.6.2 msrest_azure/0.4.34 + azure-mgmt-web/0.41.0 Azure-SDK-For-Python AZURECLI/2.0.61] + accept-language: [en-US] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Web/sites/functionappwithreservedinstance000003/config/web?api-version=2018-02-01 + response: + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Web/sites/functionappwithreservedinstance000003/config/web","name":"functionappwithreservedinstance000003","type":"Microsoft.Web/sites/config","location":"West + US","properties":{"numberOfWorkers":1,"defaultDocuments":["Default.htm","Default.html","Default.asp","index.htm","index.html","iisstart.htm","default.aspx","index.php"],"netFrameworkVersion":"v4.0","phpVersion":"5.6","pythonVersion":"","nodeVersion":"","linuxFxVersion":"","windowsFxVersion":null,"requestTracingEnabled":false,"remoteDebuggingEnabled":false,"remoteDebuggingVersion":null,"httpLoggingEnabled":false,"logsDirectorySizeLimit":35,"detailedErrorLoggingEnabled":false,"publishingUsername":"$functionappwithreservedinstance000003","publishingPassword":null,"appSettings":null,"azureStorageAccounts":null,"metadata":null,"connectionStrings":null,"machineKey":null,"handlerMappings":null,"documentRoot":null,"scmType":"None","use32BitWorkerProcess":true,"webSocketsEnabled":false,"alwaysOn":false,"javaVersion":null,"javaContainer":null,"javaContainerVersion":null,"appCommandLine":"","managedPipelineMode":"Integrated","virtualApplications":[{"virtualPath":"/","physicalPath":"site\\wwwroot","preloadEnabled":false,"virtualDirectories":null}],"winAuthAdminState":0,"winAuthTenantState":0,"customAppPoolIdentityAdminState":false,"customAppPoolIdentityTenantState":false,"runtimeADUser":null,"runtimeADUserPassword":null,"loadBalancing":"LeastRequests","routingRules":[],"experiments":{"rampUpRules":[]},"limits":null,"autoHealEnabled":false,"autoHealRules":null,"tracingOptions":null,"vnetName":"","siteAuthEnabled":false,"siteAuthSettings":{"enabled":null,"unauthenticatedClientAction":null,"tokenStoreEnabled":null,"allowedExternalRedirectUrls":null,"defaultProvider":null,"clientId":null,"clientSecret":null,"clientSecretCertificateThumbprint":null,"issuer":null,"allowedAudiences":null,"additionalLoginParams":null,"isAadAutoProvisioned":false,"googleClientId":null,"googleClientSecret":null,"googleOAuthScopes":null,"facebookAppId":null,"facebookAppSecret":null,"facebookOAuthScopes":null,"twitterConsumerKey":null,"twitterConsumerSecret":null,"microsoftAccountClientId":null,"microsoftAccountClientSecret":null,"microsoftAccountOAuthScopes":null},"cors":{"allowedOrigins":["https://functions.azure.com","https://functions-staging.azure.com","https://functions-next.azure.com"],"supportCredentials":false},"push":null,"apiDefinition":null,"autoSwapSlotName":null,"localMySqlEnabled":false,"managedServiceIdentityId":null,"xManagedServiceIdentityId":null,"ipSecurityRestrictions":null,"scmIpSecurityRestrictions":null,"scmIpSecurityRestrictionsUseMain":false,"http20Enabled":true,"minTlsVersion":"1.2","ftpsState":"AllAllowed","reservedInstanceCount":0}}'} + headers: + cache-control: [no-cache] + content-length: ['2905'] + content-type: [application/json] + date: ['Wed, 03 Apr 2019 23:48:38 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/10.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: 'b''{"properties": {"numberOfWorkers": 1, "defaultDocuments": ["Default.htm", + "Default.html", "Default.asp", "index.htm", "index.html", "iisstart.htm", "default.aspx", + "index.php"], "netFrameworkVersion": "v4.0", "phpVersion": "5.6", "pythonVersion": + "", "nodeVersion": "", "linuxFxVersion": "", "requestTracingEnabled": false, + "remoteDebuggingEnabled": false, "httpLoggingEnabled": false, "logsDirectorySizeLimit": + 35, "detailedErrorLoggingEnabled": false, "publishingUsername": "$functionappwithreservedinstance000003", + "scmType": "None", "use32BitWorkerProcess": true, "webSocketsEnabled": false, + "alwaysOn": false, "appCommandLine": "", "managedPipelineMode": "Integrated", + "virtualApplications": [{"virtualPath": "/", "physicalPath": "site\\\\wwwroot", + "preloadEnabled": false}], "loadBalancing": "LeastRequests", "experiments": + {"rampUpRules": []}, "autoHealEnabled": false, "vnetName": "", "cors": {"allowedOrigins": + ["https://functions.azure.com", "https://functions-staging.azure.com", "https://functions-next.azure.com"], + "supportCredentials": false}, "localMySqlEnabled": false, "scmIpSecurityRestrictionsUseMain": + false, "http20Enabled": true, "minTlsVersion": "1.2", "ftpsState": "AllAllowed", + "reservedInstanceCount": 4}}''' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [functionapp config set] + Connection: [keep-alive] + Content-Length: ['1232'] + Content-Type: [application/json; charset=utf-8] + ParameterSetName: [-g -n --prewarmed-instance-count] + User-Agent: [python/3.6.6 (Windows-10-10.0.17763-SP0) msrest/0.6.2 msrest_azure/0.4.34 + azure-mgmt-web/0.41.0 Azure-SDK-For-Python AZURECLI/2.0.61] + accept-language: [en-US] + method: PATCH + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Web/sites/functionappwithreservedinstance000003/config/web?api-version=2018-02-01 + response: + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Web/sites/functionappwithreservedinstance000003","name":"functionappwithreservedinstance000003","type":"Microsoft.Web/sites","location":"West + US","properties":{"numberOfWorkers":1,"defaultDocuments":["Default.htm","Default.html","Default.asp","index.htm","index.html","iisstart.htm","default.aspx","index.php"],"netFrameworkVersion":"v4.0","phpVersion":"5.6","pythonVersion":"","nodeVersion":"","linuxFxVersion":"","windowsFxVersion":null,"requestTracingEnabled":false,"remoteDebuggingEnabled":false,"remoteDebuggingVersion":"VS2017","httpLoggingEnabled":false,"logsDirectorySizeLimit":35,"detailedErrorLoggingEnabled":false,"publishingUsername":"$functionappwithreservedinstance000003","publishingPassword":null,"appSettings":null,"azureStorageAccounts":null,"metadata":null,"connectionStrings":null,"machineKey":null,"handlerMappings":null,"documentRoot":null,"scmType":"None","use32BitWorkerProcess":true,"webSocketsEnabled":false,"alwaysOn":false,"javaVersion":null,"javaContainer":null,"javaContainerVersion":null,"appCommandLine":"","managedPipelineMode":"Integrated","virtualApplications":[{"virtualPath":"/","physicalPath":"site\\wwwroot","preloadEnabled":false,"virtualDirectories":null}],"winAuthAdminState":0,"winAuthTenantState":0,"customAppPoolIdentityAdminState":false,"customAppPoolIdentityTenantState":false,"runtimeADUser":null,"runtimeADUserPassword":null,"loadBalancing":"LeastRequests","routingRules":[],"experiments":{"rampUpRules":[]},"limits":null,"autoHealEnabled":false,"autoHealRules":null,"tracingOptions":null,"vnetName":"","siteAuthEnabled":false,"siteAuthSettings":{"enabled":null,"unauthenticatedClientAction":null,"tokenStoreEnabled":null,"allowedExternalRedirectUrls":null,"defaultProvider":null,"clientId":null,"clientSecret":null,"clientSecretCertificateThumbprint":null,"issuer":null,"allowedAudiences":null,"additionalLoginParams":null,"isAadAutoProvisioned":false,"googleClientId":null,"googleClientSecret":null,"googleOAuthScopes":null,"facebookAppId":null,"facebookAppSecret":null,"facebookOAuthScopes":null,"twitterConsumerKey":null,"twitterConsumerSecret":null,"microsoftAccountClientId":null,"microsoftAccountClientSecret":null,"microsoftAccountOAuthScopes":null},"cors":{"allowedOrigins":["https://functions.azure.com","https://functions-staging.azure.com","https://functions-next.azure.com"],"supportCredentials":false},"push":null,"apiDefinition":null,"autoSwapSlotName":null,"localMySqlEnabled":false,"managedServiceIdentityId":null,"xManagedServiceIdentityId":null,"ipSecurityRestrictions":null,"scmIpSecurityRestrictions":null,"scmIpSecurityRestrictionsUseMain":false,"http20Enabled":true,"minTlsVersion":"1.2","ftpsState":"AllAllowed","reservedInstanceCount":4}}'} + headers: + cache-control: [no-cache] + content-length: ['2891'] + content-type: [application/json] + date: ['Wed, 03 Apr 2019 23:48:42 GMT'] + etag: ['"1D4EA77AD2EFFD5"'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/10.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-subscription-writes: ['1199'] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [functionapp delete] + Connection: [keep-alive] + Content-Length: ['0'] + ParameterSetName: [-g -n] + User-Agent: [python/3.6.6 (Windows-10-10.0.17763-SP0) msrest/0.6.2 msrest_azure/0.4.34 + azure-mgmt-web/0.41.0 Azure-SDK-For-Python AZURECLI/2.0.61] + accept-language: [en-US] + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Web/sites/functionappwithreservedinstance000003?api-version=2018-02-01 + response: + body: {string: ''} + headers: + cache-control: [no-cache] + content-length: ['0'] + date: ['Wed, 03 Apr 2019 23:48:47 GMT'] + etag: ['"1D4EA77C3E59D80"'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/10.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-subscription-deletes: ['14999'] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [group delete] + Connection: [keep-alive] + Content-Length: ['0'] + Content-Type: [application/json; charset=utf-8] + ParameterSetName: [--name --yes --no-wait] + User-Agent: [python/3.6.6 (Windows-10-10.0.17763-SP0) msrest/0.6.2 msrest_azure/0.4.34 + resourcemanagementclient/2.0.0 Azure-SDK-For-Python AZURECLI/2.0.61] + accept-language: [en-US] + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001?api-version=2018-05-01 + response: + body: {string: ''} + headers: + cache-control: [no-cache] + content-length: ['0'] + date: ['Wed, 03 Apr 2019 23:48:49 GMT'] + expires: ['-1'] + location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DTElURVNUOjJFUkc3WE9XMzNZUVM1WVFRSU82WlBFTlFXNE5RQUxDVkZSMks2M3xCQzk4MEMwNURDQjM4NEVFLVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?api-version=2018-05-01'] + pragma: [no-cache] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-subscription-deletes: ['14999'] + status: {code: 202, message: Accepted} +version: 1 diff --git a/src/command_modules/azure-cli-appservice/azure/cli/command_modules/appservice/tests/latest/test_webapp_commands.py b/src/command_modules/azure-cli-appservice/azure/cli/command_modules/appservice/tests/latest/test_webapp_commands.py index aa43da8ad4a..4440510f408 100644 --- a/src/command_modules/azure-cli-appservice/azure/cli/command_modules/appservice/tests/latest/test_webapp_commands.py +++ b/src/command_modules/azure-cli-appservice/azure/cli/command_modules/appservice/tests/latest/test_webapp_commands.py @@ -696,6 +696,23 @@ def test_acr_deployment_function_app(self, resource_group, storage_account): self.cmd('functionapp delete -g {} -n {}'.format(resource_group, functionapp)) +class FunctionAppReservedInstanceTest(ScenarioTest): + @ResourceGroupPreparer() + @StorageAccountPreparer() + def test_functionapp_reserved_instance(self, resource_group, storage_account): + functionapp_name = self.create_random_name('functionappwithreservedinstance', 40) + self.cmd('functionapp create -g {} -n {} -c westus -s {} --os-type Windows' + .format(resource_group, functionapp_name, storage_account)).assert_with_checks([ + JMESPathCheck('state', 'Running'), + JMESPathCheck('name', functionapp_name), + JMESPathCheck('kind', 'functionapp'), + JMESPathCheck('hostNames[0]', functionapp_name + '.azurewebsites.net')]) + self.cmd('functionapp config set -g {} -n {} --prewarmed-instance-count 4' + .format(resource_group, functionapp_name)).assert_with_checks([ + JMESPathCheck('reservedInstanceCount', 4)]) + self.cmd('functionapp delete -g {} -n {}'.format(resource_group, functionapp_name)) + + class WebappGitScenarioTest(ScenarioTest): @ResourceGroupPreparer() def test_webapp_git(self, resource_group): @@ -1111,6 +1128,26 @@ def test_functionapp_app_service_plan(self, resource_group): JMESPathCheck('sku.name', 'S1') ]) + @ResourceGroupPreparer(location='centralus') + def test_functionapp_elastic_plan(self, resource_group): + plan = self.create_random_name(prefix='funcappplan', length=24) + self.cmd('functionapp plan create -g {} -n {} --sku EP1 --min-instances 4 --max-burst 12' .format(resource_group, plan), checks=[ + JMESPathCheck('maximumElasticWorkerCount', 12), + JMESPathCheck('sku.name', 'EP1'), + JMESPathCheck('sku.capacity', 4) + ]) + self.cmd('functionapp plan update -g {} -n {} --min-instances 5 --max-burst 11' .format(resource_group, plan), checks=[ + JMESPathCheck('maximumElasticWorkerCount', 11), + JMESPathCheck('sku.name', 'EP1'), + JMESPathCheck('sku.capacity', 5) + ]) + self.cmd('functionapp plan show -g {} -n {} '.format(resource_group, plan), checks=[ + JMESPathCheck('maximumElasticWorkerCount', 11), + JMESPathCheck('sku.name', 'EP1'), + JMESPathCheck('sku.capacity', 5) + ]) + self.cmd('functionapp delete -g {} -n {}'.format(resource_group, plan)) + class FunctionAppServicePlanLinux(ScenarioTest): @ResourceGroupPreparer(location='westus')