From 532220ec4b61f41f2821dadf51b1a3953eb06570 Mon Sep 17 00:00:00 2001 From: yugangw-msft Date: Tue, 14 Mar 2017 17:38:17 -0700 Subject: [PATCH 1/2] appservice: support to create plan when create a webapp --- .../cli/command_modules/appservice/_params.py | 26 +- .../command_modules/appservice/_validators.py | 47 +++ .../cli/command_modules/appservice/custom.py | 23 +- .../test_appservice_error_polish.yaml | 94 ++++- .../tests/recordings/test_webapp_git.yaml | 154 ++++--- .../recordings/test_webapp_simple_create.yaml | 386 ++++++++++++++++++ .../tests/test_webapp_commands.py | 89 ++-- .../tests/test_webapp_validators.py | 31 ++ 8 files changed, 712 insertions(+), 138 deletions(-) create mode 100644 src/command_modules/azure-cli-appservice/azure/cli/command_modules/appservice/_validators.py create mode 100644 src/command_modules/azure-cli-appservice/tests/recordings/test_webapp_simple_create.yaml create mode 100644 src/command_modules/azure-cli-appservice/tests/test_webapp_validators.py 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 2e738373cb3..1bafce8f2d6 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 @@ -4,16 +4,15 @@ # -------------------------------------------------------------------------------------------- from argcomplete.completers import FilesCompleter +from azure.mgmt.web.models import DatabaseType from azure.cli.core.commands import register_cli_argument from azure.cli.core.commands.parameters import (resource_group_name_type, location_type, get_resource_name_completion_list, file_type, CliArgumentType, ignore_type, enum_choice_list) - -from azure.mgmt.web.models import DatabaseType - -from ._client_factory import web_client_factory +from azure.cli.command_modules.appservice._validators import process_webapp_create_namespace +from azure.cli.command_modules.appservice._client_factory import web_client_factory def _generic_site_operation(resource_group_name, name, operation_name, slot=None, #pylint: disable=too-many-arguments extra_parameter=None, client=None): @@ -39,8 +38,9 @@ def get_hostname_completion_list(prefix, action, parsed_args, **kwargs): # pylin #pylint: disable=line-too-long # PARAMETER REGISTRATION name_arg_type = CliArgumentType(options_list=('--name', '-n'), metavar='NAME') -sku_arg_type = CliArgumentType(help='The pricing tiers, e.g., F1(Free), D1(Shared), B1(Basic Small), B2(Basic Medium), B3(Basic Large), S1(Standard Small), P1(Premium Small), etc', - **enum_choice_list(['F1', 'FREE', 'D1', 'SHARED', 'B1', 'B2', 'B3', 'S1', 'S2', 'S3', 'P1', 'P2', 'P3'])) +_SKU_HELP = 'The pricing tiers, e.g., F1(Free), D1(Shared), B1(Basic Small), B2(Basic Medium), B3(Basic Large), S1(Standard Small), P1(Premium Small), etc' +_SKU_LIST = ['F1', 'FREE', 'D1', 'SHARED', 'B1', 'B2', 'B3', 'S1', 'S2', 'S3', 'P1', 'P2', 'P3'] +sku_arg_type = CliArgumentType(help=_SKU_HELP, **enum_choice_list(_SKU_LIST)) register_cli_argument('appservice', 'resource_group_name', arg_type=resource_group_name_type) register_cli_argument('appservice', 'location', arg_type=location_type) @@ -60,9 +60,17 @@ def get_hostname_completion_list(prefix, action, parsed_args, **kwargs): # pylin register_cli_argument('appservice web', 'name', configured_default='web', arg_type=name_arg_type, completer=get_resource_name_completion_list('Microsoft.Web/sites'), id_part='name', help="name of the web. You can configure the default using 'az configure --defaults web='") -register_cli_argument('appservice web create', 'name', options_list=('--name', '-n'), help='name of the new webapp') -register_cli_argument('appservice web create', 'plan', options_list=('--plan', '-p'), completer=get_resource_name_completion_list('Microsoft.Web/serverFarms'), - help="name or resource id of the app service plan. Use 'appservice plan create' to get one") +register_cli_argument('appservice web create', 'name', options_list=('--name', '-n'), help='name of the new webapp', validator=process_webapp_create_namespace) +register_cli_argument('appservice web create', 'create_plan', ignore_type) +register_cli_argument('appservice web create', 'plan', arg_group='AppService Plan', + options_list=('--plan', '-p'), completer=get_resource_name_completion_list('Microsoft.Web/serverFarms'), + help='Appservice plan name. Can also reference an existing subnet by ID. If omitted, an appropriate plan in the same resource group will be selected automatically, or a new one will be created.') +register_cli_argument('appservice web create', 'sku', arg_group='AppService Plan', + help='{}. Default: S1'.format(_SKU_HELP), **enum_choice_list(_SKU_LIST)) +register_cli_argument('appservice web create', 'number_of_workers', help='Number of workers to be allocated. Default: 1', type=int, arg_group='AppService Plan') +register_cli_argument('appservice web create', 'is_linux', action='store_true', help='create a new linux web') +register_cli_argument('appservice web create', 'location', location_type, help='Location in which to create webapp and related resources. Defaults to the resource group\'s location.') + register_cli_argument('appservice web browse', 'logs', options_list=('--logs', '-l'), action='store_true', help='Enable viewing the log stream immediately after launching the web app') register_cli_argument('appservice web deployment user', 'user_name', help='user name') diff --git a/src/command_modules/azure-cli-appservice/azure/cli/command_modules/appservice/_validators.py b/src/command_modules/azure-cli-appservice/azure/cli/command_modules/appservice/_validators.py new file mode 100644 index 00000000000..39e0be9692f --- /dev/null +++ b/src/command_modules/azure-cli-appservice/azure/cli/command_modules/appservice/_validators.py @@ -0,0 +1,47 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +from azure.cli.core._util import CLIError +from azure.cli.core.commands.validators import get_default_location_from_resource_group + +def _validate_plan_arg(namespace): + from ._client_factory import web_client_factory + namespace.create_plan = False + if namespace.plan: + from azure.cli.core.commands.arm import is_valid_resource_id + if not is_valid_resource_id(namespace.plan): + from msrestazure.azure_exceptions import CloudError + client = web_client_factory() + try: + client.app_service_plans.get(namespace.resource_group_name, namespace.plan) + except CloudError: + namespace.create_plan = True + else: + client = web_client_factory() + result = client.app_service_plans.list_by_resource_group(namespace.resource_group_name) + existing_plan = next((x for x in result if _match_plan_location(x, namespace.location) and + namespace.is_linux == (x.kind == 'linux')), None) + if existing_plan: + namespace.plan = existing_plan.id + else: + namespace.create_plan = True + namespace.plan = namespace.name + '_plan' + + if not namespace.create_plan and (namespace.sku or namespace.number_of_workers): + raise CLIError('Usage error: argument values for --sku or --number-of-workers will ' + 'be ignored, as the new web will be created using an existing ' + 'plan {}. Please use --plan to specify a new plan'.format(namespace.plan)) + + + +def _match_plan_location(plan, location): + # the problem with appservice is it uses display name, rather canonical name + # so we have to hack it + return plan.location.replace(' ', '').lower() == location.lower() + + +def process_webapp_create_namespace(namespace): + get_default_location_from_resource_group(namespace) + _validate_plan_arg(namespace) 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 2498c0fb165..848e73e6a44 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 @@ -21,7 +21,7 @@ RestoreRequest, FrequencyUnit, Certificate, HostNameSslState) from azure.cli.core.commands.client_factory import get_mgmt_service_client -from azure.cli.core.commands.arm import is_valid_resource_id, parse_resource_id +from azure.cli.core.commands.arm import parse_resource_id from azure.cli.core.commands import LongRunningOperation from azure.cli.core.prompting import prompt_pass, NoTTYException @@ -56,18 +56,25 @@ def _get_detail_error(self, ex): "azure/app-service-web/app-service-linux-intro") elif 'Not enough available reserved instance servers to satisfy' in detail: detail = ("Plan with Linux worker can only be created in a group " + - "which has never contained a Windows worker. Please use " + - "a new resource group. Original error:" + detail) + "which has never contained a Windows worker, and vice versa. " + + "Please use a new resource group. Original error:" + detail) return CLIError(detail) except: #pylint: disable=bare-except return ex -def create_webapp(resource_group_name, name, plan): +def create_webapp(resource_group_name, name, + plan=None, create_plan=False, + sku=None, is_linux=False, number_of_workers=None, + location=None): client = web_client_factory() - if is_valid_resource_id(plan): - plan = parse_resource_id(plan)['name'] - location = _get_location_from_app_service_plan(client, resource_group_name, plan) - webapp_def = Site(server_farm_id=plan, location=location) + plan_id = plan + if create_plan: + logger.warning("Create appservice plan: '%s'", plan) + result = create_app_service_plan(resource_group_name, plan, is_linux, + sku or 'S1', number_of_workers or 1, location) + plan_id = result.id + + webapp_def = Site(server_farm_id=plan_id, location=location) poller = client.web_apps.create_or_update(resource_group_name, name, webapp_def) return AppServiceLongRunningOperation()(poller) diff --git a/src/command_modules/azure-cli-appservice/tests/recordings/test_appservice_error_polish.yaml b/src/command_modules/azure-cli-appservice/tests/recordings/test_appservice_error_polish.yaml index dea3562c282..073b7bef27b 100644 --- a/src/command_modules/azure-cli-appservice/tests/recordings/test_appservice_error_polish.yaml +++ b/src/command_modules/azure-cli-appservice/tests/recordings/test_appservice_error_polish.yaml @@ -6,20 +6,78 @@ interactions: Accept-Encoding: ['gzip, deflate'] Connection: [keep-alive] Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.5.2 (Windows-10-10.0.14393-SP0) requests/2.9.1 msrest/0.4.5 - msrest_azure/0.4.7 websitemanagementclient/0.31.0 Azure-SDK-For-Python AZURECLI/TEST/2.0.0+dev] + User-Agent: [python/3.5.3 (Windows-10-10.0.14393-SP0) requests/2.9.1 msrest/0.4.6 + msrest_azure/0.4.7 resourcemanagementclient/0.30.2 Azure-SDK-For-Python + AZURECLI/TEST/2.0.1+dev] accept-language: [en-US] - x-ms-client-request-id: [5b453146-05de-11e7-adce-480fcf502758] + x-ms-client-request-id: [554373c2-0b56-11e7-b694-64510658e3b3] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest-error2/providers/Microsoft.Web/serverfarms/webapp-error-plan?api-version=2016-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest-error2?api-version=2016-09-01 response: - body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest-error2/providers/Microsoft.Web/serverfarms/webapp-error-plan","name":"webapp-error-plan","type":"Microsoft.Web/serverfarms","kind":"app","location":"West - US","tags":null,"properties":{"serverFarmId":0,"name":"webapp-error-plan","workerSize":"Small","workerSizeId":0,"workerTierName":null,"numberOfWorkers":1,"currentWorkerSize":"Small","currentWorkerSizeId":0,"currentNumberOfWorkers":1,"status":"Ready","webSpace":"clitest-error2-WestUSwebspace","subscription":"8d57ddbd-c779-40ea-b660-1015f4bf027d","adminSiteName":null,"hostingEnvironment":null,"hostingEnvironmentProfile":null,"maximumNumberOfWorkers":3,"planName":"VirtualDedicatedPlan","adminRuntimeSiteName":null,"computeMode":"Shared","siteMode":null,"geoRegion":"West - US","perSiteScaling":false,"numberOfSites":0,"hostingEnvironmentId":null,"tags":null,"kind":"app","resourceGroup":"clitest-error2","reserved":false,"mdmId":"waws-prod-bay-045_13008","targetWorkerCount":0,"targetWorkerSizeId":0,"provisioningState":"Succeeded"},"sku":{"name":"B1","tier":"Basic","size":"B1","family":"B","capacity":1}}'} + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest-error2","name":"clitest-error2","location":"westus","properties":{"provisioningState":"Succeeded"}}'} + headers: + Cache-Control: [no-cache] + Content-Type: [application/json; charset=utf-8] + Date: ['Fri, 17 Mar 2017 21:11:47 GMT'] + Expires: ['-1'] + Pragma: [no-cache] + Strict-Transport-Security: [max-age=31536000; includeSubDomains] + Vary: [Accept-Encoding] + content-length: ['181'] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.5.3 (Windows-10-10.0.14393-SP0) requests/2.9.1 msrest/0.4.6 + msrest_azure/0.4.7 websitemanagementclient/0.31.0 Azure-SDK-For-Python AZURECLI/TEST/2.0.1+dev] + accept-language: [en-US] + x-ms-client-request-id: [556a35b4-0b56-11e7-beb7-64510658e3b3] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest-error2/providers/Microsoft.Web/serverfarms?api-version=2016-09-01 + response: + body: {string: '{"value":[],"nextLink":null,"id":null}'} + headers: + Cache-Control: [no-cache] + Content-Type: [application/json] + Date: ['Fri, 17 Mar 2017 21:11:48 GMT'] + Expires: ['-1'] + Pragma: [no-cache] + Server: [Microsoft-IIS/8.0] + Strict-Transport-Security: [max-age=31536000; includeSubDomains] + Transfer-Encoding: [chunked] + Vary: [Accept-Encoding] + X-AspNet-Version: [4.0.30319] + X-Powered-By: [ASP.NET] + content-length: ['38'] + status: {code: 200, message: OK} +- request: + body: '{"sku": {"name": "S1", "tier": "STANDARD", "capacity": 1}, "properties": + {"name": "webapp-error-test123_plan", "perSiteScaling": false}, "location": + "westus"}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Length: ['158'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.5.3 (Windows-10-10.0.14393-SP0) requests/2.9.1 msrest/0.4.6 + msrest_azure/0.4.7 websitemanagementclient/0.31.0 Azure-SDK-For-Python AZURECLI/TEST/2.0.1+dev] + accept-language: [en-US] + x-ms-client-request-id: [55c3eef0-0b56-11e7-9c6d-64510658e3b3] + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest-error2/providers/Microsoft.Web/serverfarms/webapp-error-test123_plan?api-version=2016-09-01 + response: + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest-error2/providers/Microsoft.Web/serverfarms/webapp-error-test123_plan","name":"webapp-error-test123_plan","type":"Microsoft.Web/serverfarms","kind":"app","location":"West + US","tags":null,"properties":{"serverFarmId":0,"name":"webapp-error-test123_plan","workerSize":"Small","workerSizeId":0,"workerTierName":null,"numberOfWorkers":1,"currentWorkerSize":"Small","currentWorkerSizeId":0,"currentNumberOfWorkers":1,"status":"Ready","webSpace":"clitest-error2-WestUSwebspace","subscription":"0b1f6471-1bf0-4dda-aec3-cb9272f09590","adminSiteName":null,"hostingEnvironment":null,"hostingEnvironmentProfile":null,"maximumNumberOfWorkers":10,"planName":"VirtualDedicatedPlan","adminRuntimeSiteName":null,"computeMode":"Shared","siteMode":null,"geoRegion":"West + US","perSiteScaling":false,"numberOfSites":0,"hostingEnvironmentId":null,"tags":null,"kind":"app","resourceGroup":"clitest-error2","reserved":false,"mdmId":"waws-prod-bay-061_8887","targetWorkerCount":0,"targetWorkerSizeId":0,"provisioningState":"Succeeded"},"sku":{"name":"S1","tier":"Standard","size":"S1","family":"S","capacity":1}}'} headers: Cache-Control: [no-cache] Content-Type: [application/json] - Date: ['Fri, 10 Mar 2017 22:10:24 GMT'] + Date: ['Fri, 17 Mar 2017 21:11:55 GMT'] Expires: ['-1'] Pragma: [no-cache] Server: [Microsoft-IIS/8.0] @@ -28,21 +86,23 @@ interactions: Vary: [Accept-Encoding] X-AspNet-Version: [4.0.30319] X-Powered-By: [ASP.NET] - content-length: ['1142'] + content-length: ['1169'] + x-ms-ratelimit-remaining-subscription-writes: ['1199'] status: {code: 200, message: OK} - request: - body: '{"location": "West US", "properties": {"microService": "false", "serverFarmId": - "webapp-error-plan", "scmSiteAlsoStopped": false, "reserved": false}}' + body: '{"properties": {"serverFarmId": "/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourceGroups/clitest-error2/providers/Microsoft.Web/serverfarms/webapp-error-test123_plan", + "scmSiteAlsoStopped": false, "microService": "false", "reserved": false}, "location": + "westus"}' headers: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] Connection: [keep-alive] - Content-Length: ['149'] + Content-Length: ['274'] Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.5.2 (Windows-10-10.0.14393-SP0) requests/2.9.1 msrest/0.4.5 - msrest_azure/0.4.7 websitemanagementclient/0.31.0 Azure-SDK-For-Python AZURECLI/TEST/2.0.0+dev] + User-Agent: [python/3.5.3 (Windows-10-10.0.14393-SP0) requests/2.9.1 msrest/0.4.6 + msrest_azure/0.4.7 websitemanagementclient/0.31.0 Azure-SDK-For-Python AZURECLI/TEST/2.0.1+dev] accept-language: [en-US] - x-ms-client-request-id: [5c6d23a4-05de-11e7-97fd-480fcf502758] + x-ms-client-request-id: [5a89b28a-0b56-11e7-84af-64510658e3b3] method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest-error2/providers/Microsoft.Web/sites/webapp-error-test123?api-version=2016-08-01 response: @@ -55,13 +115,13 @@ interactions: Cache-Control: [no-cache] Content-Length: ['484'] Content-Type: [application/json; charset=utf-8] - Date: ['Fri, 10 Mar 2017 22:10:26 GMT'] + Date: ['Fri, 17 Mar 2017 21:11:58 GMT'] Expires: ['-1'] Pragma: [no-cache] Server: [Microsoft-IIS/8.0] Strict-Transport-Security: [max-age=31536000; includeSubDomains] X-AspNet-Version: [4.0.30319] X-Powered-By: [ASP.NET] - x-ms-ratelimit-remaining-subscription-writes: ['1198'] + x-ms-ratelimit-remaining-subscription-writes: ['1199'] status: {code: 409, message: Conflict} version: 1 diff --git a/src/command_modules/azure-cli-appservice/tests/recordings/test_webapp_git.yaml b/src/command_modules/azure-cli-appservice/tests/recordings/test_webapp_git.yaml index f12a2065aa0..e379ecef1fc 100644 --- a/src/command_modules/azure-cli-appservice/tests/recordings/test_webapp_git.yaml +++ b/src/command_modules/azure-cli-appservice/tests/recordings/test_webapp_git.yaml @@ -6,11 +6,11 @@ interactions: Accept-Encoding: ['gzip, deflate'] Connection: [keep-alive] Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.5.2 (Windows-10-10.0.14393-SP0) requests/2.9.1 msrest/0.4.5 + User-Agent: [python/3.5.3 (Windows-10-10.0.14393-SP0) requests/2.9.1 msrest/0.4.6 msrest_azure/0.4.7 resourcemanagementclient/0.30.2 Azure-SDK-For-Python - AZURECLI/TEST/2.0.0+dev] + AZURECLI/TEST/2.0.1+dev] accept-language: [en-US] - x-ms-client-request-id: [9fc9f308-05c7-11e7-bc06-480fcf502758] + x-ms-client-request-id: [3ca740fa-0b61-11e7-ad72-64510658e3b3] method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli-webapp-git4?api-version=2016-09-01 response: @@ -18,7 +18,7 @@ interactions: headers: Cache-Control: [no-cache] Content-Type: [application/json; charset=utf-8] - Date: ['Fri, 10 Mar 2017 19:27:39 GMT'] + Date: ['Fri, 17 Mar 2017 22:29:50 GMT'] Expires: ['-1'] Pragma: [no-cache] Strict-Transport-Security: [max-age=31536000; includeSubDomains] @@ -26,28 +26,24 @@ interactions: content-length: ['220'] status: {code: 200, message: OK} - request: - body: '{"sku": {"capacity": 1, "name": "S1", "tier": "STANDARD"}, "properties": - {"perSiteScaling": false, "name": "webapp-git-plan5"}, "location": "westus"}' + body: null headers: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] Connection: [keep-alive] - Content-Length: ['149'] Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.5.2 (Windows-10-10.0.14393-SP0) requests/2.9.1 msrest/0.4.5 - msrest_azure/0.4.7 websitemanagementclient/0.31.0 Azure-SDK-For-Python AZURECLI/TEST/2.0.0+dev] + User-Agent: [python/3.5.3 (Windows-10-10.0.14393-SP0) requests/2.9.1 msrest/0.4.6 + msrest_azure/0.4.7 websitemanagementclient/0.31.0 Azure-SDK-For-Python AZURECLI/TEST/2.0.1+dev] accept-language: [en-US] - x-ms-client-request-id: [9ff148a2-05c7-11e7-b5a8-480fcf502758] - method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-webapp-git4/providers/Microsoft.Web/serverfarms/webapp-git-plan5?api-version=2016-09-01 + x-ms-client-request-id: [3cbdaf26-0b61-11e7-9422-64510658e3b3] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-webapp-git4/providers/Microsoft.Web/serverfarms?api-version=2016-09-01 response: - body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-webapp-git4/providers/Microsoft.Web/serverfarms/webapp-git-plan5","name":"webapp-git-plan5","type":"Microsoft.Web/serverfarms","kind":"app","location":"West - US","tags":null,"properties":{"serverFarmId":0,"name":"webapp-git-plan5","workerSize":"Small","workerSizeId":0,"workerTierName":null,"numberOfWorkers":1,"currentWorkerSize":"Small","currentWorkerSizeId":0,"currentNumberOfWorkers":1,"status":"Ready","webSpace":"cli-webapp-git4-WestUSwebspace","subscription":"8d57ddbd-c779-40ea-b660-1015f4bf027d","adminSiteName":null,"hostingEnvironment":null,"hostingEnvironmentProfile":null,"maximumNumberOfWorkers":10,"planName":"VirtualDedicatedPlan","adminRuntimeSiteName":null,"computeMode":"Shared","siteMode":null,"geoRegion":"West - US","perSiteScaling":false,"numberOfSites":0,"hostingEnvironmentId":null,"tags":null,"kind":"app","resourceGroup":"cli-webapp-git4","reserved":false,"mdmId":"waws-prod-bay-075_2632","targetWorkerCount":0,"targetWorkerSizeId":0,"provisioningState":"Succeeded"},"sku":{"name":"S1","tier":"Standard","size":"S1","family":"S","capacity":1}}'} + body: {string: '{"value":[],"nextLink":null,"id":null}'} headers: Cache-Control: [no-cache] Content-Type: [application/json] - Date: ['Fri, 10 Mar 2017 19:27:52 GMT'] + Date: ['Fri, 17 Mar 2017 22:29:51 GMT'] Expires: ['-1'] Pragma: [no-cache] Server: [Microsoft-IIS/8.0] @@ -56,30 +52,31 @@ interactions: Vary: [Accept-Encoding] X-AspNet-Version: [4.0.30319] X-Powered-By: [ASP.NET] - content-length: ['1163'] - x-ms-ratelimit-remaining-subscription-writes: ['1197'] + content-length: ['38'] status: {code: 200, message: OK} - request: - body: null + body: '{"properties": {"perSiteScaling": false, "name": "web-git-test2_plan"}, + "location": "westus", "sku": {"capacity": 1, "tier": "STANDARD", "name": "S1"}}' headers: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] Connection: [keep-alive] + Content-Length: ['151'] Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.5.2 (Windows-10-10.0.14393-SP0) requests/2.9.1 msrest/0.4.5 - msrest_azure/0.4.7 websitemanagementclient/0.31.0 Azure-SDK-For-Python AZURECLI/TEST/2.0.0+dev] + User-Agent: [python/3.5.3 (Windows-10-10.0.14393-SP0) requests/2.9.1 msrest/0.4.6 + msrest_azure/0.4.7 websitemanagementclient/0.31.0 Azure-SDK-For-Python AZURECLI/TEST/2.0.1+dev] accept-language: [en-US] - x-ms-client-request-id: [a7e463c0-05c7-11e7-bc74-480fcf502758] - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-webapp-git4/providers/Microsoft.Web/serverfarms/webapp-git-plan5?api-version=2016-09-01 + x-ms-client-request-id: [3d1ac31a-0b61-11e7-85d2-64510658e3b3] + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-webapp-git4/providers/Microsoft.Web/serverfarms/web-git-test2_plan?api-version=2016-09-01 response: - body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-webapp-git4/providers/Microsoft.Web/serverfarms/webapp-git-plan5","name":"webapp-git-plan5","type":"Microsoft.Web/serverfarms","kind":"app","location":"West - US","tags":null,"properties":{"serverFarmId":0,"name":"webapp-git-plan5","workerSize":"Small","workerSizeId":0,"workerTierName":null,"numberOfWorkers":1,"currentWorkerSize":"Small","currentWorkerSizeId":0,"currentNumberOfWorkers":1,"status":"Ready","webSpace":"cli-webapp-git4-WestUSwebspace","subscription":"8d57ddbd-c779-40ea-b660-1015f4bf027d","adminSiteName":null,"hostingEnvironment":null,"hostingEnvironmentProfile":null,"maximumNumberOfWorkers":10,"planName":"VirtualDedicatedPlan","adminRuntimeSiteName":null,"computeMode":"Shared","siteMode":null,"geoRegion":"West - US","perSiteScaling":false,"numberOfSites":0,"hostingEnvironmentId":null,"tags":null,"kind":"app","resourceGroup":"cli-webapp-git4","reserved":false,"mdmId":"waws-prod-bay-075_2632","targetWorkerCount":0,"targetWorkerSizeId":0,"provisioningState":"Succeeded"},"sku":{"name":"S1","tier":"Standard","size":"S1","family":"S","capacity":1}}'} + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-webapp-git4/providers/Microsoft.Web/serverfarms/web-git-test2_plan","name":"web-git-test2_plan","type":"Microsoft.Web/serverfarms","kind":"app","location":"West + US","tags":null,"properties":{"serverFarmId":0,"name":"web-git-test2_plan","workerSize":"Small","workerSizeId":0,"workerTierName":null,"numberOfWorkers":1,"currentWorkerSize":"Small","currentWorkerSizeId":0,"currentNumberOfWorkers":1,"status":"Ready","webSpace":"cli-webapp-git4-WestUSwebspace","subscription":"0b1f6471-1bf0-4dda-aec3-cb9272f09590","adminSiteName":null,"hostingEnvironment":null,"hostingEnvironmentProfile":null,"maximumNumberOfWorkers":10,"planName":"VirtualDedicatedPlan","adminRuntimeSiteName":null,"computeMode":"Shared","siteMode":null,"geoRegion":"West + US","perSiteScaling":false,"numberOfSites":0,"hostingEnvironmentId":null,"tags":null,"kind":"app","resourceGroup":"cli-webapp-git4","reserved":false,"mdmId":"waws-prod-bay-037_17533","targetWorkerCount":0,"targetWorkerSizeId":0,"provisioningState":"Succeeded"},"sku":{"name":"S1","tier":"Standard","size":"S1","family":"S","capacity":1}}'} headers: Cache-Control: [no-cache] Content-Type: [application/json] - Date: ['Fri, 10 Mar 2017 19:27:53 GMT'] + Date: ['Fri, 17 Mar 2017 22:30:05 GMT'] Expires: ['-1'] Pragma: [no-cache] Server: [Microsoft-IIS/8.0] @@ -88,31 +85,32 @@ interactions: Vary: [Accept-Encoding] X-AspNet-Version: [4.0.30319] X-Powered-By: [ASP.NET] - content-length: ['1163'] + content-length: ['1170'] + x-ms-ratelimit-remaining-subscription-writes: ['1199'] status: {code: 200, message: OK} - request: - body: '{"properties": {"serverFarmId": "webapp-git-plan5", "scmSiteAlsoStopped": - false, "microService": "false", "reserved": false}, "location": "West US"}' + body: '{"properties": {"serverFarmId": "/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourceGroups/cli-webapp-git4/providers/Microsoft.Web/serverfarms/web-git-test2_plan", + "scmSiteAlsoStopped": false, "reserved": false, "microService": "false"}, "location": + "westus"}' headers: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] Connection: [keep-alive] - Content-Length: ['148'] + Content-Length: ['274'] Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.5.2 (Windows-10-10.0.14393-SP0) requests/2.9.1 msrest/0.4.5 - msrest_azure/0.4.7 websitemanagementclient/0.31.0 Azure-SDK-For-Python AZURECLI/TEST/2.0.0+dev] + User-Agent: [python/3.5.3 (Windows-10-10.0.14393-SP0) requests/2.9.1 msrest/0.4.6 + msrest_azure/0.4.7 websitemanagementclient/0.31.0 Azure-SDK-For-Python AZURECLI/TEST/2.0.1+dev] accept-language: [en-US] - x-ms-client-request-id: [a8438f46-05c7-11e7-bab8-480fcf502758] + x-ms-client-request-id: [4574bf58-0b61-11e7-b5c5-64510658e3b3] method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-webapp-git4/providers/Microsoft.Web/sites/web-git-test2?api-version=2016-08-01 response: - body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-webapp-git4/providers/Microsoft.Web/sites/web-git-test2","name":"web-git-test2","type":"Microsoft.Web/sites","kind":"app","location":"West - US","tags":null,"properties":{"name":"web-git-test2","state":"Running","hostNames":["web-git-test2.azurewebsites.net"],"webSpace":"cli-webapp-git4-WestUSwebspace","selfLink":"https://waws-prod-bay-075.api.azurewebsites.windows.net:454/subscriptions/00000000-0000-0000-0000-000000000000/webspaces/cli-webapp-git4-WestUSwebspace/sites/web-git-test2","repositorySiteName":"web-git-test2","owner":null,"usageState":"Normal","enabled":true,"adminEnabled":true,"enabledHostNames":["web-git-test2.azurewebsites.net","web-git-test2.scm.azurewebsites.net"],"siteProperties":{"metadata":null,"properties":[],"appSettings":null},"availabilityState":"Normal","sslCertificates":null,"csrs":[],"cers":null,"siteMode":null,"hostNameSslStates":[{"name":"web-git-test2.azurewebsites.net","sslState":"Disabled","ipBasedSslResult":null,"virtualIP":null,"thumbprint":null,"toUpdate":null,"toUpdateIpBasedSsl":null,"ipBasedSslState":"NotConfigured","hostType":"Standard"},{"name":"web-git-test2.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/cli-webapp-git4/providers/Microsoft.Web/serverfarms/webapp-git-plan5","reserved":false,"lastModifiedTimeUtc":"2017-03-10T19:27:56.85","storageRecoveryDefaultState":"Running","contentAvailabilityState":"Normal","runtimeAvailabilityState":"Normal","siteConfig":null,"deploymentId":"web-git-test2","trafficManagerHostNames":null,"sku":"Standard","premiumAppDeployed":null,"scmSiteAlsoStopped":false,"targetSwapSlot":null,"hostingEnvironment":null,"hostingEnvironmentProfile":null,"microService":"false","gatewaySiteName":null,"clientAffinityEnabled":true,"clientCertEnabled":false,"hostNamesDisabled":false,"domainVerificationIdentifiers":null,"kind":"app","outboundIpAddresses":"104.40.3.53,104.40.18.224,104.40.21.79,104.40.21.56,104.40.23.196","containerSize":0,"dailyMemoryTimeQuota":0,"suspendedTill":null,"siteDisabledReason":0,"functionExecutionUnitsCache":null,"maxNumberOfWorkers":null,"homeStamp":"waws-prod-bay-075","cloningInfo":null,"hostingEnvironmentId":null,"tags":null,"resourceGroup":"cli-webapp-git4","defaultHostName":"web-git-test2.azurewebsites.net","slotSwapStatus":null}}'} + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-webapp-git4/providers/Microsoft.Web/sites/web-git-test2","name":"web-git-test2","type":"Microsoft.Web/sites","kind":"app","location":"westus","tags":null,"properties":{"name":"web-git-test2","state":"Running","hostNames":["web-git-test2.azurewebsites.net"],"webSpace":"cli-webapp-git4-WestUSwebspace","selfLink":"https://waws-prod-bay-037.api.azurewebsites.windows.net:454/subscriptions/00000000-0000-0000-0000-000000000000/webspaces/cli-webapp-git4-WestUSwebspace/sites/web-git-test2","repositorySiteName":"web-git-test2","owner":null,"usageState":"Normal","enabled":true,"adminEnabled":true,"enabledHostNames":["web-git-test2.azurewebsites.net","web-git-test2.scm.azurewebsites.net"],"siteProperties":{"metadata":null,"properties":[],"appSettings":null},"availabilityState":"Normal","sslCertificates":null,"csrs":[],"cers":null,"siteMode":null,"hostNameSslStates":[{"name":"web-git-test2.azurewebsites.net","sslState":"Disabled","ipBasedSslResult":null,"virtualIP":null,"thumbprint":null,"toUpdate":null,"toUpdateIpBasedSsl":null,"ipBasedSslState":"NotConfigured","hostType":"Standard"},{"name":"web-git-test2.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/cli-webapp-git4/providers/Microsoft.Web/serverfarms/web-git-test2_plan","reserved":false,"lastModifiedTimeUtc":"2017-03-17T22:30:10.42","storageRecoveryDefaultState":"Running","contentAvailabilityState":"Normal","runtimeAvailabilityState":"Normal","siteConfig":null,"deploymentId":"web-git-test2","trafficManagerHostNames":null,"sku":"Standard","premiumAppDeployed":null,"scmSiteAlsoStopped":false,"targetSwapSlot":null,"hostingEnvironment":null,"hostingEnvironmentProfile":null,"microService":"false","gatewaySiteName":null,"clientAffinityEnabled":true,"clientCertEnabled":false,"hostNamesDisabled":false,"domainVerificationIdentifiers":null,"kind":"app","outboundIpAddresses":"40.78.31.236,40.78.24.159,40.78.31.161,40.78.26.141","containerSize":0,"dailyMemoryTimeQuota":0,"suspendedTill":null,"siteDisabledReason":0,"functionExecutionUnitsCache":null,"maxNumberOfWorkers":null,"homeStamp":"waws-prod-bay-037","cloningInfo":null,"hostingEnvironmentId":null,"tags":null,"resourceGroup":"cli-webapp-git4","defaultHostName":"web-git-test2.azurewebsites.net","slotSwapStatus":null}}'} headers: Cache-Control: [no-cache] Content-Type: [application/json] - Date: ['Fri, 10 Mar 2017 19:27:58 GMT'] - ETag: ['"1D299D46BF57FD5"'] + Date: ['Fri, 17 Mar 2017 22:30:09 GMT'] + ETag: ['"1D29F6E09B7DFF0"'] Expires: ['-1'] Pragma: [no-cache] Server: [Microsoft-IIS/8.0] @@ -121,7 +119,7 @@ interactions: Vary: [Accept-Encoding] X-AspNet-Version: [4.0.30319] X-Powered-By: [ASP.NET] - content-length: ['2639'] + content-length: ['2626'] x-ms-ratelimit-remaining-subscription-writes: ['1199'] status: {code: 200, message: OK} - request: @@ -131,20 +129,20 @@ interactions: Accept-Encoding: ['gzip, deflate'] Connection: [keep-alive] Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.5.2 (Windows-10-10.0.14393-SP0) requests/2.9.1 msrest/0.4.5 - msrest_azure/0.4.7 websitemanagementclient/0.31.0 Azure-SDK-For-Python AZURECLI/TEST/2.0.0+dev] + User-Agent: [python/3.5.3 (Windows-10-10.0.14393-SP0) requests/2.9.1 msrest/0.4.6 + msrest_azure/0.4.7 websitemanagementclient/0.31.0 Azure-SDK-For-Python AZURECLI/TEST/2.0.1+dev] accept-language: [en-US] - x-ms-client-request-id: [ac134ce2-05c7-11e7-bbbf-480fcf502758] + x-ms-client-request-id: [4819c67a-0b61-11e7-9d7a-64510658e3b3] method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-webapp-git4/providers/Microsoft.Web/sites/web-git-test2?api-version=2016-08-01 response: body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-webapp-git4/providers/Microsoft.Web/sites/web-git-test2","name":"web-git-test2","type":"Microsoft.Web/sites","kind":"app","location":"West - US","tags":null,"properties":{"name":"web-git-test2","state":"Running","hostNames":["web-git-test2.azurewebsites.net"],"webSpace":"cli-webapp-git4-WestUSwebspace","selfLink":"https://waws-prod-bay-075.api.azurewebsites.windows.net:454/subscriptions/00000000-0000-0000-0000-000000000000/webspaces/cli-webapp-git4-WestUSwebspace/sites/web-git-test2","repositorySiteName":"web-git-test2","owner":null,"usageState":"Normal","enabled":true,"adminEnabled":true,"enabledHostNames":["web-git-test2.azurewebsites.net","web-git-test2.scm.azurewebsites.net"],"siteProperties":{"metadata":null,"properties":[],"appSettings":null},"availabilityState":"Normal","sslCertificates":null,"csrs":[],"cers":null,"siteMode":null,"hostNameSslStates":[{"name":"web-git-test2.azurewebsites.net","sslState":"Disabled","ipBasedSslResult":null,"virtualIP":null,"thumbprint":null,"toUpdate":null,"toUpdateIpBasedSsl":null,"ipBasedSslState":"NotConfigured","hostType":"Standard"},{"name":"web-git-test2.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/cli-webapp-git4/providers/Microsoft.Web/serverfarms/webapp-git-plan5","reserved":false,"lastModifiedTimeUtc":"2017-03-10T19:27:57.0533333","storageRecoveryDefaultState":"Running","contentAvailabilityState":"Normal","runtimeAvailabilityState":"Normal","siteConfig":null,"deploymentId":"web-git-test2","trafficManagerHostNames":null,"sku":"Standard","premiumAppDeployed":null,"scmSiteAlsoStopped":false,"targetSwapSlot":null,"hostingEnvironment":null,"hostingEnvironmentProfile":null,"microService":"false","gatewaySiteName":null,"clientAffinityEnabled":true,"clientCertEnabled":false,"hostNamesDisabled":false,"domainVerificationIdentifiers":null,"kind":"app","outboundIpAddresses":"104.40.3.53,104.40.18.224,104.40.21.79,104.40.21.56,104.40.23.196","containerSize":0,"dailyMemoryTimeQuota":0,"suspendedTill":null,"siteDisabledReason":0,"functionExecutionUnitsCache":null,"maxNumberOfWorkers":null,"homeStamp":"waws-prod-bay-075","cloningInfo":null,"hostingEnvironmentId":null,"tags":null,"resourceGroup":"cli-webapp-git4","defaultHostName":"web-git-test2.azurewebsites.net","slotSwapStatus":null}}'} + US","tags":null,"properties":{"name":"web-git-test2","state":"Running","hostNames":["web-git-test2.azurewebsites.net"],"webSpace":"cli-webapp-git4-WestUSwebspace","selfLink":"https://waws-prod-bay-037.api.azurewebsites.windows.net:454/subscriptions/00000000-0000-0000-0000-000000000000/webspaces/cli-webapp-git4-WestUSwebspace/sites/web-git-test2","repositorySiteName":"web-git-test2","owner":null,"usageState":"Normal","enabled":true,"adminEnabled":true,"enabledHostNames":["web-git-test2.azurewebsites.net","web-git-test2.scm.azurewebsites.net"],"siteProperties":{"metadata":null,"properties":[],"appSettings":null},"availabilityState":"Normal","sslCertificates":null,"csrs":[],"cers":null,"siteMode":null,"hostNameSslStates":[{"name":"web-git-test2.azurewebsites.net","sslState":"Disabled","ipBasedSslResult":null,"virtualIP":null,"thumbprint":null,"toUpdate":null,"toUpdateIpBasedSsl":null,"ipBasedSslState":"NotConfigured","hostType":"Standard"},{"name":"web-git-test2.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/cli-webapp-git4/providers/Microsoft.Web/serverfarms/web-git-test2_plan","reserved":false,"lastModifiedTimeUtc":"2017-03-17T22:30:10.543","storageRecoveryDefaultState":"Running","contentAvailabilityState":"Normal","runtimeAvailabilityState":"Normal","siteConfig":null,"deploymentId":"web-git-test2","trafficManagerHostNames":null,"sku":"Standard","premiumAppDeployed":null,"scmSiteAlsoStopped":false,"targetSwapSlot":null,"hostingEnvironment":null,"hostingEnvironmentProfile":null,"microService":"false","gatewaySiteName":null,"clientAffinityEnabled":true,"clientCertEnabled":false,"hostNamesDisabled":false,"domainVerificationIdentifiers":null,"kind":"app","outboundIpAddresses":"40.78.31.236,40.78.24.159,40.78.31.161,40.78.26.141","containerSize":0,"dailyMemoryTimeQuota":0,"suspendedTill":null,"siteDisabledReason":0,"functionExecutionUnitsCache":null,"maxNumberOfWorkers":null,"homeStamp":"waws-prod-bay-037","cloningInfo":null,"hostingEnvironmentId":null,"tags":null,"resourceGroup":"cli-webapp-git4","defaultHostName":"web-git-test2.azurewebsites.net","slotSwapStatus":null}}'} headers: Cache-Control: [no-cache] Content-Type: [application/json] - Date: ['Fri, 10 Mar 2017 19:28:00 GMT'] - ETag: ['"1D299D46BF57FD5"'] + Date: ['Fri, 17 Mar 2017 22:30:11 GMT'] + ETag: ['"1D29F6E09B7DFF0"'] Expires: ['-1'] Pragma: [no-cache] Server: [Microsoft-IIS/8.0] @@ -153,11 +151,11 @@ interactions: Vary: [Accept-Encoding] X-AspNet-Version: [4.0.30319] X-Powered-By: [ASP.NET] - content-length: ['2644'] + content-length: ['2628'] status: {code: 200, message: OK} - request: - body: '{"properties": {"isManualIntegration": true, "branch": "master", "isMercurial": - false, "repoUrl": "https://github.com/yugangw-msft/azure-site-test"}, "location": + body: '{"properties": {"isManualIntegration": true, "branch": "master", "repoUrl": + "https://github.com/yugangw-msft/azure-site-test", "isMercurial": false}, "location": "West US"}' headers: Accept: [application/json] @@ -165,10 +163,10 @@ interactions: Connection: [keep-alive] Content-Length: ['172'] Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.5.2 (Windows-10-10.0.14393-SP0) requests/2.9.1 msrest/0.4.5 - msrest_azure/0.4.7 websitemanagementclient/0.31.0 Azure-SDK-For-Python AZURECLI/TEST/2.0.0+dev] + User-Agent: [python/3.5.3 (Windows-10-10.0.14393-SP0) requests/2.9.1 msrest/0.4.6 + msrest_azure/0.4.7 websitemanagementclient/0.31.0 Azure-SDK-For-Python AZURECLI/TEST/2.0.1+dev] accept-language: [en-US] - x-ms-client-request-id: [ac80d154-05c7-11e7-89b1-480fcf502758] + x-ms-client-request-id: [489a8ef6-0b61-11e7-b07e-64510658e3b3] method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-webapp-git4/providers/Microsoft.Web/sites/web-git-test2/sourcecontrols/web?api-version=2016-08-01 response: @@ -178,15 +176,15 @@ interactions: Cache-Control: [no-cache] Content-Length: ['467'] Content-Type: [application/json] - Date: ['Fri, 10 Mar 2017 19:28:45 GMT'] - ETag: ['"1D299D4896FFCE0"'] + Date: ['Fri, 17 Mar 2017 22:30:23 GMT'] + ETag: ['"1D29F6E125EFE40"'] Expires: ['-1'] Pragma: [no-cache] Server: [Microsoft-IIS/8.0] Strict-Transport-Security: [max-age=31536000; includeSubDomains] X-AspNet-Version: [4.0.30319] X-Powered-By: [ASP.NET] - x-ms-ratelimit-remaining-subscription-writes: ['1199'] + x-ms-ratelimit-remaining-subscription-writes: ['1198'] status: {code: 201, message: Created} - request: body: null @@ -195,22 +193,22 @@ interactions: Accept-Encoding: ['gzip, deflate'] Connection: [keep-alive] Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.5.2 (Windows-10-10.0.14393-SP0) requests/2.9.1 msrest/0.4.5 - msrest_azure/0.4.7 websitemanagementclient/0.31.0 Azure-SDK-For-Python AZURECLI/TEST/2.0.0+dev] + User-Agent: [python/3.5.3 (Windows-10-10.0.14393-SP0) requests/2.9.1 msrest/0.4.6 + msrest_azure/0.4.7 websitemanagementclient/0.31.0 Azure-SDK-For-Python AZURECLI/TEST/2.0.1+dev] accept-language: [en-US] - x-ms-client-request-id: [ac80d154-05c7-11e7-89b1-480fcf502758] + x-ms-client-request-id: [489a8ef6-0b61-11e7-b07e-64510658e3b3] method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-webapp-git4/providers/Microsoft.Web/sites/web-git-test2/sourcecontrols/web?api-version=2016-08-01 response: body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-webapp-git4/providers/Microsoft.Web/sites/web-git-test2/sourcecontrols/web","name":"web-git-test2","type":"Microsoft.Web/sites/sourcecontrols","location":"West - US","tags":null,"properties":{"repoUrl":"https://github.com/yugangw-msft/azure-site-test","branch":"master","isManualIntegration":true,"deploymentRollbackEnabled":false,"isMercurial":false,"provisioningState":"InProgress","provisioningDetails":"2017-03-10T19:29:06.3673544 - https://web-git-test2.scm.azurewebsites.net/api/deployments/latest?deployer=GitHub&time=2017-03-10_19-28-54Z"}}'} + US","tags":null,"properties":{"repoUrl":"https://github.com/yugangw-msft/azure-site-test","branch":"master","isManualIntegration":true,"deploymentRollbackEnabled":false,"isMercurial":false,"provisioningState":"InProgress","provisioningDetails":"2017-03-17T22:30:45.8064945 + https://web-git-test2.scm.azurewebsites.net/api/deployments/latest?deployer=GitHub&time=2017-03-17_22-30-31Z"}}'} headers: Cache-Control: [no-cache] Content-Length: ['628'] Content-Type: [application/json] - Date: ['Fri, 10 Mar 2017 19:29:17 GMT'] - ETag: ['"1D299D4896FFCE0"'] + Date: ['Fri, 17 Mar 2017 22:30:54 GMT'] + ETag: ['"1D29F6E125EFE40"'] Expires: ['-1'] Pragma: [no-cache] Server: [Microsoft-IIS/8.0] @@ -225,10 +223,10 @@ interactions: Accept-Encoding: ['gzip, deflate'] Connection: [keep-alive] Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.5.2 (Windows-10-10.0.14393-SP0) requests/2.9.1 msrest/0.4.5 - msrest_azure/0.4.7 websitemanagementclient/0.31.0 Azure-SDK-For-Python AZURECLI/TEST/2.0.0+dev] + User-Agent: [python/3.5.3 (Windows-10-10.0.14393-SP0) requests/2.9.1 msrest/0.4.6 + msrest_azure/0.4.7 websitemanagementclient/0.31.0 Azure-SDK-For-Python AZURECLI/TEST/2.0.1+dev] accept-language: [en-US] - x-ms-client-request-id: [ac80d154-05c7-11e7-89b1-480fcf502758] + x-ms-client-request-id: [489a8ef6-0b61-11e7-b07e-64510658e3b3] method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-webapp-git4/providers/Microsoft.Web/sites/web-git-test2/sourcecontrols/web?api-version=2016-08-01 response: @@ -237,8 +235,8 @@ interactions: headers: Cache-Control: [no-cache] Content-Type: [application/json] - Date: ['Fri, 10 Mar 2017 19:29:47 GMT'] - ETag: ['"1D299D4896FFCE0"'] + Date: ['Fri, 17 Mar 2017 22:31:25 GMT'] + ETag: ['"1D29F6E125EFE40"'] Expires: ['-1'] Pragma: [no-cache] Server: [Microsoft-IIS/8.0] @@ -256,10 +254,10 @@ interactions: Accept-Encoding: ['gzip, deflate'] Connection: [keep-alive] Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.5.2 (Windows-10-10.0.14393-SP0) requests/2.9.1 msrest/0.4.5 - msrest_azure/0.4.7 websitemanagementclient/0.31.0 Azure-SDK-For-Python AZURECLI/TEST/2.0.0+dev] + User-Agent: [python/3.5.3 (Windows-10-10.0.14393-SP0) requests/2.9.1 msrest/0.4.6 + msrest_azure/0.4.7 websitemanagementclient/0.31.0 Azure-SDK-For-Python AZURECLI/TEST/2.0.1+dev] accept-language: [en-US] - x-ms-client-request-id: [ed2246d4-05c7-11e7-a071-480fcf502758] + x-ms-client-request-id: [7597ccc8-0b61-11e7-872e-64510658e3b3] method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-webapp-git4/providers/Microsoft.Web/sites/web-git-test2/sourcecontrols/web?api-version=2016-08-01 response: @@ -268,8 +266,8 @@ interactions: headers: Cache-Control: [no-cache] Content-Type: [application/json] - Date: ['Fri, 10 Mar 2017 19:29:50 GMT'] - ETag: ['"1D299D4896FFCE0"'] + Date: ['Fri, 17 Mar 2017 22:31:27 GMT'] + ETag: ['"1D29F6E125EFE40"'] Expires: ['-1'] Pragma: [no-cache] Server: [Microsoft-IIS/8.0] @@ -288,10 +286,10 @@ interactions: Connection: [keep-alive] Content-Length: ['0'] Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.5.2 (Windows-10-10.0.14393-SP0) requests/2.9.1 msrest/0.4.5 - msrest_azure/0.4.7 websitemanagementclient/0.31.0 Azure-SDK-For-Python AZURECLI/TEST/2.0.0+dev] + User-Agent: [python/3.5.3 (Windows-10-10.0.14393-SP0) requests/2.9.1 msrest/0.4.6 + msrest_azure/0.4.7 websitemanagementclient/0.31.0 Azure-SDK-For-Python AZURECLI/TEST/2.0.1+dev] accept-language: [en-US] - x-ms-client-request-id: [ede4b088-05c7-11e7-a1ba-480fcf502758] + x-ms-client-request-id: [76a96358-0b61-11e7-b55e-64510658e3b3] method: DELETE uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-webapp-git4/providers/Microsoft.Web/sites/web-git-test2/sourcecontrols/web?api-version=2016-08-01 response: @@ -299,14 +297,14 @@ interactions: headers: Cache-Control: [no-cache] Content-Length: ['0'] - Date: ['Fri, 10 Mar 2017 19:29:59 GMT'] - ETag: ['"1D299D4B09C1060"'] + Date: ['Fri, 17 Mar 2017 22:31:41 GMT'] + ETag: ['"1D29F6E3A6FF380"'] Expires: ['-1'] Pragma: [no-cache] Server: [Microsoft-IIS/8.0] Strict-Transport-Security: [max-age=31536000; includeSubDomains] X-AspNet-Version: [4.0.30319] X-Powered-By: [ASP.NET] - x-ms-ratelimit-remaining-subscription-writes: ['1198'] + x-ms-ratelimit-remaining-subscription-writes: ['1199'] status: {code: 200, message: OK} version: 1 diff --git a/src/command_modules/azure-cli-appservice/tests/recordings/test_webapp_simple_create.yaml b/src/command_modules/azure-cli-appservice/tests/recordings/test_webapp_simple_create.yaml new file mode 100644 index 00000000000..fa9beca25d9 --- /dev/null +++ b/src/command_modules/azure-cli-appservice/tests/recordings/test_webapp_simple_create.yaml @@ -0,0 +1,386 @@ +interactions: +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.5.3 (Windows-10-10.0.14393-SP0) requests/2.9.1 msrest/0.4.6 + msrest_azure/0.4.7 resourcemanagementclient/0.30.2 Azure-SDK-For-Python + AZURECLI/TEST/2.0.1+dev] + accept-language: [en-US] + x-ms-client-request-id: [3f83325c-0b5e-11e7-91f5-64510658e3b3] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/azurecli-webapp-simple?api-version=2016-09-01 + response: + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azurecli-webapp-simple","name":"azurecli-webapp-simple","location":"westus","tags":{"use":"az-test"},"properties":{"provisioningState":"Succeeded"}}'} + headers: + Cache-Control: [no-cache] + Content-Type: [application/json; charset=utf-8] + Date: ['Fri, 17 Mar 2017 22:08:27 GMT'] + Expires: ['-1'] + Pragma: [no-cache] + Strict-Transport-Security: [max-age=31536000; includeSubDomains] + Vary: [Accept-Encoding] + content-length: ['234'] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.5.3 (Windows-10-10.0.14393-SP0) requests/2.9.1 msrest/0.4.6 + msrest_azure/0.4.7 websitemanagementclient/0.31.0 Azure-SDK-For-Python AZURECLI/TEST/2.0.1+dev] + accept-language: [en-US] + x-ms-client-request-id: [3fac6468-0b5e-11e7-8ba8-64510658e3b3] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azurecli-webapp-simple/providers/Microsoft.Web/serverfarms?api-version=2016-09-01 + response: + body: {string: '{"value":[],"nextLink":null,"id":null}'} + headers: + Cache-Control: [no-cache] + Content-Type: [application/json] + Date: ['Fri, 17 Mar 2017 22:08:28 GMT'] + Expires: ['-1'] + Pragma: [no-cache] + Server: [Microsoft-IIS/8.0] + Strict-Transport-Security: [max-age=31536000; includeSubDomains] + Transfer-Encoding: [chunked] + Vary: [Accept-Encoding] + X-AspNet-Version: [4.0.30319] + X-Powered-By: [ASP.NET] + content-length: ['38'] + status: {code: 200, message: OK} +- request: + body: '{"sku": {"tier": "STANDARD", "name": "S1", "capacity": 1}, "location": + "westus", "properties": {"perSiteScaling": false, "reserved": true, "name": + "cli-webapp-simple_plan"}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Length: ['173'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.5.3 (Windows-10-10.0.14393-SP0) requests/2.9.1 msrest/0.4.6 + msrest_azure/0.4.7 websitemanagementclient/0.31.0 Azure-SDK-For-Python AZURECLI/TEST/2.0.1+dev] + accept-language: [en-US] + x-ms-client-request-id: [40095152-0b5e-11e7-a310-64510658e3b3] + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azurecli-webapp-simple/providers/Microsoft.Web/serverfarms/cli-webapp-simple_plan?api-version=2016-09-01 + response: + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azurecli-webapp-simple/providers/Microsoft.Web/serverfarms/cli-webapp-simple_plan","name":"cli-webapp-simple_plan","type":"Microsoft.Web/serverfarms","kind":"linux","location":"West + US","tags":null,"properties":{"serverFarmId":0,"name":"cli-webapp-simple_plan","workerSize":"Small","workerSizeId":0,"workerTierName":null,"numberOfWorkers":1,"currentWorkerSize":"Small","currentWorkerSizeId":0,"currentNumberOfWorkers":1,"status":"Ready","webSpace":"azurecli-webapp-simple-WestUSwebspace","subscription":"0b1f6471-1bf0-4dda-aec3-cb9272f09590","adminSiteName":null,"hostingEnvironment":null,"hostingEnvironmentProfile":null,"maximumNumberOfWorkers":10,"planName":"VirtualDedicatedPlan","adminRuntimeSiteName":null,"computeMode":"Shared","siteMode":null,"geoRegion":"West + US","perSiteScaling":false,"numberOfSites":0,"hostingEnvironmentId":null,"tags":null,"kind":"linux","resourceGroup":"azurecli-webapp-simple","reserved":true,"mdmId":"waws-prod-bay-063_2191","targetWorkerCount":0,"targetWorkerSizeId":0,"provisioningState":"Succeeded"},"sku":{"name":"S1","tier":"Standard","size":"S1","family":"S","capacity":1}}'} + headers: + Cache-Control: [no-cache] + Content-Type: [application/json] + Date: ['Fri, 17 Mar 2017 22:08:36 GMT'] + Expires: ['-1'] + Pragma: [no-cache] + Server: [Microsoft-IIS/8.0] + Strict-Transport-Security: [max-age=31536000; includeSubDomains] + Transfer-Encoding: [chunked] + Vary: [Accept-Encoding] + X-AspNet-Version: [4.0.30319] + X-Powered-By: [ASP.NET] + content-length: ['1205'] + x-ms-ratelimit-remaining-subscription-writes: ['1198'] + status: {code: 200, message: OK} +- request: + body: '{"location": "westus", "properties": {"microService": "false", "scmSiteAlsoStopped": + false, "reserved": false, "serverFarmId": "/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourceGroups/azurecli-webapp-simple/providers/Microsoft.Web/serverfarms/cli-webapp-simple_plan"}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Length: ['285'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.5.3 (Windows-10-10.0.14393-SP0) requests/2.9.1 msrest/0.4.6 + msrest_azure/0.4.7 websitemanagementclient/0.31.0 Azure-SDK-For-Python AZURECLI/TEST/2.0.1+dev] + accept-language: [en-US] + x-ms-client-request-id: [44ceeeba-0b5e-11e7-828f-64510658e3b3] + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azurecli-webapp-simple/providers/Microsoft.Web/sites/cli-webapp-simple?api-version=2016-08-01 + response: + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azurecli-webapp-simple/providers/Microsoft.Web/sites/cli-webapp-simple","name":"cli-webapp-simple","type":"Microsoft.Web/sites","kind":"app","location":"westus","tags":null,"properties":{"name":"cli-webapp-simple","state":"Running","hostNames":["cli-webapp-simple.azurewebsites.net"],"webSpace":"azurecli-webapp-simple-WestUSwebspace","selfLink":"https://waws-prod-bay-063.api.azurewebsites.windows.net:454/subscriptions/00000000-0000-0000-0000-000000000000/webspaces/azurecli-webapp-simple-WestUSwebspace/sites/cli-webapp-simple","repositorySiteName":"cli-webapp-simple","owner":null,"usageState":"Normal","enabled":true,"adminEnabled":true,"enabledHostNames":["cli-webapp-simple.azurewebsites.net","cli-webapp-simple.scm.azurewebsites.net"],"siteProperties":{"metadata":null,"properties":[],"appSettings":null},"availabilityState":"Normal","sslCertificates":null,"csrs":[],"cers":null,"siteMode":null,"hostNameSslStates":[{"name":"cli-webapp-simple.azurewebsites.net","sslState":"Disabled","ipBasedSslResult":null,"virtualIP":null,"thumbprint":null,"toUpdate":null,"toUpdateIpBasedSsl":null,"ipBasedSslState":"NotConfigured","hostType":"Standard"},{"name":"cli-webapp-simple.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/azurecli-webapp-simple/providers/Microsoft.Web/serverfarms/cli-webapp-simple_plan","reserved":true,"lastModifiedTimeUtc":"2017-03-17T22:08:38.3066667","storageRecoveryDefaultState":"Running","contentAvailabilityState":"Normal","runtimeAvailabilityState":"Normal","siteConfig":null,"deploymentId":"cli-webapp-simple","trafficManagerHostNames":null,"sku":"Standard","premiumAppDeployed":null,"scmSiteAlsoStopped":false,"targetSwapSlot":null,"hostingEnvironment":null,"hostingEnvironmentProfile":null,"microService":"false","gatewaySiteName":null,"clientAffinityEnabled":true,"clientCertEnabled":false,"hostNamesDisabled":false,"domainVerificationIdentifiers":null,"kind":"app","outboundIpAddresses":"13.93.220.109,13.64.108.119,13.64.198.87,13.64.192.142,13.64.109.132","containerSize":0,"dailyMemoryTimeQuota":0,"suspendedTill":null,"siteDisabledReason":0,"functionExecutionUnitsCache":null,"maxNumberOfWorkers":null,"homeStamp":"waws-prod-bay-063","cloningInfo":null,"hostingEnvironmentId":null,"tags":null,"resourceGroup":"azurecli-webapp-simple","defaultHostName":"cli-webapp-simple.azurewebsites.net","slotSwapStatus":null}}'} + headers: + Cache-Control: [no-cache] + Content-Type: [application/json] + Date: ['Fri, 17 Mar 2017 22:08:41 GMT'] + ETag: ['"1D29F6B0798BDD5"'] + Expires: ['-1'] + Pragma: [no-cache] + Server: [Microsoft-IIS/8.0] + Strict-Transport-Security: [max-age=31536000; includeSubDomains] + Transfer-Encoding: [chunked] + Vary: [Accept-Encoding] + X-AspNet-Version: [4.0.30319] + X-Powered-By: [ASP.NET] + content-length: ['2734'] + x-ms-ratelimit-remaining-subscription-writes: ['1198'] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.5.3 (Windows-10-10.0.14393-SP0) requests/2.9.1 msrest/0.4.6 + msrest_azure/0.4.7 resourcemanagementclient/0.30.2 Azure-SDK-For-Python + AZURECLI/TEST/2.0.1+dev] + accept-language: [en-US] + x-ms-client-request-id: [48a5f518-0b5e-11e7-9ba4-64510658e3b3] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/azurecli-webapp-simple?api-version=2016-09-01 + response: + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azurecli-webapp-simple","name":"azurecli-webapp-simple","location":"westus","tags":{"use":"az-test"},"properties":{"provisioningState":"Succeeded"}}'} + headers: + Cache-Control: [no-cache] + Content-Type: [application/json; charset=utf-8] + Date: ['Fri, 17 Mar 2017 22:08:43 GMT'] + Expires: ['-1'] + Pragma: [no-cache] + Strict-Transport-Security: [max-age=31536000; includeSubDomains] + Vary: [Accept-Encoding] + content-length: ['234'] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.5.3 (Windows-10-10.0.14393-SP0) requests/2.9.1 msrest/0.4.6 + msrest_azure/0.4.7 websitemanagementclient/0.31.0 Azure-SDK-For-Python AZURECLI/TEST/2.0.1+dev] + accept-language: [en-US] + x-ms-client-request-id: [48d2a992-0b5e-11e7-a021-64510658e3b3] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azurecli-webapp-simple/providers/Microsoft.Web/serverfarms?api-version=2016-09-01 + response: + body: {string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azurecli-webapp-simple/providers/Microsoft.Web/serverfarms/cli-webapp-simple_plan","name":"cli-webapp-simple_plan","type":"Microsoft.Web/serverfarms","kind":"linux","location":"West + US","tags":null,"properties":{"serverFarmId":0,"name":"cli-webapp-simple_plan","workerSize":"Small","workerSizeId":0,"workerTierName":null,"numberOfWorkers":1,"currentWorkerSize":"Small","currentWorkerSizeId":0,"currentNumberOfWorkers":1,"status":"Ready","webSpace":"azurecli-webapp-simple-WestUSwebspace","subscription":"0b1f6471-1bf0-4dda-aec3-cb9272f09590","adminSiteName":null,"hostingEnvironment":null,"hostingEnvironmentProfile":null,"maximumNumberOfWorkers":10,"planName":"VirtualDedicatedPlan","adminRuntimeSiteName":null,"computeMode":"Shared","siteMode":null,"geoRegion":"West + US","perSiteScaling":false,"numberOfSites":1,"hostingEnvironmentId":null,"tags":null,"kind":"linux","resourceGroup":"azurecli-webapp-simple","reserved":true,"mdmId":"waws-prod-bay-063_2191","targetWorkerCount":0,"targetWorkerSizeId":0,"provisioningState":"Succeeded"},"sku":{"name":"S1","tier":"Standard","size":"S1","family":"S","capacity":1}}],"nextLink":null,"id":null}'} + headers: + Cache-Control: [no-cache] + Content-Type: [application/json] + Date: ['Fri, 17 Mar 2017 22:08:43 GMT'] + Expires: ['-1'] + Pragma: [no-cache] + Server: [Microsoft-IIS/8.0] + Strict-Transport-Security: [max-age=31536000; includeSubDomains] + Transfer-Encoding: [chunked] + Vary: [Accept-Encoding] + X-AspNet-Version: [4.0.30319] + X-Powered-By: [ASP.NET] + content-length: ['1243'] + status: {code: 200, message: OK} +- request: + body: '{"location": "westus", "properties": {"microService": "false", "scmSiteAlsoStopped": + false, "reserved": false, "serverFarmId": "/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourceGroups/azurecli-webapp-simple/providers/Microsoft.Web/serverfarms/cli-webapp-simple_plan"}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Length: ['285'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.5.3 (Windows-10-10.0.14393-SP0) requests/2.9.1 msrest/0.4.6 + msrest_azure/0.4.7 websitemanagementclient/0.31.0 Azure-SDK-For-Python AZURECLI/TEST/2.0.1+dev] + accept-language: [en-US] + x-ms-client-request-id: [495ee49c-0b5e-11e7-82a6-64510658e3b3] + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azurecli-webapp-simple/providers/Microsoft.Web/sites/cli-webapp-simple2?api-version=2016-08-01 + response: + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azurecli-webapp-simple/providers/Microsoft.Web/sites/cli-webapp-simple2","name":"cli-webapp-simple2","type":"Microsoft.Web/sites","kind":"app","location":"westus","tags":null,"properties":{"name":"cli-webapp-simple2","state":"Running","hostNames":["cli-webapp-simple2.azurewebsites.net"],"webSpace":"azurecli-webapp-simple-WestUSwebspace","selfLink":"https://waws-prod-bay-063.api.azurewebsites.windows.net:454/subscriptions/00000000-0000-0000-0000-000000000000/webspaces/azurecli-webapp-simple-WestUSwebspace/sites/cli-webapp-simple2","repositorySiteName":"cli-webapp-simple2","owner":null,"usageState":"Normal","enabled":true,"adminEnabled":true,"enabledHostNames":["cli-webapp-simple2.azurewebsites.net","cli-webapp-simple2.scm.azurewebsites.net"],"siteProperties":{"metadata":null,"properties":[],"appSettings":null},"availabilityState":"Normal","sslCertificates":null,"csrs":[],"cers":null,"siteMode":null,"hostNameSslStates":[{"name":"cli-webapp-simple2.azurewebsites.net","sslState":"Disabled","ipBasedSslResult":null,"virtualIP":null,"thumbprint":null,"toUpdate":null,"toUpdateIpBasedSsl":null,"ipBasedSslState":"NotConfigured","hostType":"Standard"},{"name":"cli-webapp-simple2.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/azurecli-webapp-simple/providers/Microsoft.Web/serverfarms/cli-webapp-simple_plan","reserved":true,"lastModifiedTimeUtc":"2017-03-17T22:08:46.3666667","storageRecoveryDefaultState":"Running","contentAvailabilityState":"Normal","runtimeAvailabilityState":"Normal","siteConfig":null,"deploymentId":"cli-webapp-simple2","trafficManagerHostNames":null,"sku":"Standard","premiumAppDeployed":null,"scmSiteAlsoStopped":false,"targetSwapSlot":null,"hostingEnvironment":null,"hostingEnvironmentProfile":null,"microService":"false","gatewaySiteName":null,"clientAffinityEnabled":true,"clientCertEnabled":false,"hostNamesDisabled":false,"domainVerificationIdentifiers":null,"kind":"app","outboundIpAddresses":"13.93.220.109,13.64.108.119,13.64.198.87,13.64.192.142,13.64.109.132","containerSize":0,"dailyMemoryTimeQuota":0,"suspendedTill":null,"siteDisabledReason":0,"functionExecutionUnitsCache":null,"maxNumberOfWorkers":null,"homeStamp":"waws-prod-bay-063","cloningInfo":null,"hostingEnvironmentId":null,"tags":null,"resourceGroup":"azurecli-webapp-simple","defaultHostName":"cli-webapp-simple2.azurewebsites.net","slotSwapStatus":null}}'} + headers: + Cache-Control: [no-cache] + Content-Type: [application/json] + Date: ['Fri, 17 Mar 2017 22:08:54 GMT'] + ETag: ['"1D29F6B0C6205B5"'] + Expires: ['-1'] + Pragma: [no-cache] + Server: [Microsoft-IIS/8.0] + Strict-Transport-Security: [max-age=31536000; includeSubDomains] + Transfer-Encoding: [chunked] + Vary: [Accept-Encoding] + X-AspNet-Version: [4.0.30319] + X-Powered-By: [ASP.NET] + content-length: ['2746'] + x-ms-ratelimit-remaining-subscription-writes: ['1197'] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.5.3 (Windows-10-10.0.14393-SP0) requests/2.9.1 msrest/0.4.6 + msrest_azure/0.4.7 resourcemanagementclient/0.30.2 Azure-SDK-For-Python + AZURECLI/TEST/2.0.1+dev] + accept-language: [en-US] + x-ms-client-request-id: [5031255a-0b5e-11e7-b68e-64510658e3b3] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resources?$filter=resourceGroup%20eq%20%27azurecli-webapp-simple%27&api-version=2016-09-01 + response: + body: {string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azurecli-webapp-simple/providers/Microsoft.Web/serverFarms/cli-webapp-simple_plan","name":"cli-webapp-simple_plan","type":"Microsoft.Web/serverFarms","sku":{"name":"S1","tier":"Standard","size":"S1","family":"S","capacity":1},"kind":"linux","location":"westus"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azurecli-webapp-simple/providers/Microsoft.Web/sites/cli-webapp-simple","name":"cli-webapp-simple","type":"Microsoft.Web/sites","kind":"app","location":"westus"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azurecli-webapp-simple/providers/Microsoft.Web/sites/cli-webapp-simple2","name":"cli-webapp-simple2","type":"Microsoft.Web/sites","kind":"app","location":"westus"}]}'} + headers: + Cache-Control: [no-cache] + Content-Type: [application/json; charset=utf-8] + Date: ['Fri, 17 Mar 2017 22:08:55 GMT'] + Expires: ['-1'] + Pragma: [no-cache] + Strict-Transport-Security: [max-age=31536000; includeSubDomains] + Vary: [Accept-Encoding] + content-length: ['839'] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.5.3 (Windows-10-10.0.14393-SP0) requests/2.9.1 msrest/0.4.6 + msrest_azure/0.4.7 resourcemanagementclient/0.30.2 Azure-SDK-For-Python + AZURECLI/TEST/2.0.1+dev] + accept-language: [en-US] + x-ms-client-request-id: [50abd06c-0b5e-11e7-8e55-64510658e3b3] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/azurecli-webapp-simple?api-version=2016-09-01 + response: + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azurecli-webapp-simple","name":"azurecli-webapp-simple","location":"westus","tags":{"use":"az-test"},"properties":{"provisioningState":"Succeeded"}}'} + headers: + Cache-Control: [no-cache] + Content-Type: [application/json; charset=utf-8] + Date: ['Fri, 17 Mar 2017 22:08:56 GMT'] + Expires: ['-1'] + Pragma: [no-cache] + Strict-Transport-Security: [max-age=31536000; includeSubDomains] + Vary: [Accept-Encoding] + content-length: ['234'] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.5.3 (Windows-10-10.0.14393-SP0) requests/2.9.1 msrest/0.4.6 + msrest_azure/0.4.7 websitemanagementclient/0.31.0 Azure-SDK-For-Python AZURECLI/TEST/2.0.1+dev] + accept-language: [en-US] + x-ms-client-request-id: [50d28358-0b5e-11e7-98e5-64510658e3b3] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azurecli-webapp-simple/providers/Microsoft.Web/serverfarms/winplan?api-version=2016-09-01 + response: + body: {string: '{"error":{"code":"ResourceNotFound","message":"The Resource ''Microsoft.Web/serverFarms/winplan'' + under resource group ''azurecli-webapp-simple'' was not found."}}'} + headers: + Cache-Control: [no-cache] + Content-Length: ['165'] + Content-Type: [application/json; charset=utf-8] + Date: ['Fri, 17 Mar 2017 22:08:56 GMT'] + Expires: ['-1'] + Pragma: [no-cache] + Strict-Transport-Security: [max-age=31536000; includeSubDomains] + x-ms-failure-cause: [gateway] + status: {code: 404, message: Not Found} +- request: + body: '{"sku": {"tier": "BASIC", "name": "B1", "capacity": 1}, "location": "westus", + "properties": {"perSiteScaling": false, "reserved": true, "name": "winplan"}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Length: ['155'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.5.3 (Windows-10-10.0.14393-SP0) requests/2.9.1 msrest/0.4.6 + msrest_azure/0.4.7 websitemanagementclient/0.31.0 Azure-SDK-For-Python AZURECLI/TEST/2.0.1+dev] + accept-language: [en-US] + x-ms-client-request-id: [511917d0-0b5e-11e7-909b-64510658e3b3] + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azurecli-webapp-simple/providers/Microsoft.Web/serverfarms/winplan?api-version=2016-09-01 + response: + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azurecli-webapp-simple/providers/Microsoft.Web/serverfarms/winplan","name":"winplan","type":"Microsoft.Web/serverfarms","kind":"linux","location":"West + US","tags":null,"properties":{"serverFarmId":0,"name":"winplan","workerSize":"Small","workerSizeId":0,"workerTierName":null,"numberOfWorkers":1,"currentWorkerSize":"Small","currentWorkerSizeId":0,"currentNumberOfWorkers":1,"status":"Ready","webSpace":"azurecli-webapp-simple-WestUSwebspace","subscription":"0b1f6471-1bf0-4dda-aec3-cb9272f09590","adminSiteName":null,"hostingEnvironment":null,"hostingEnvironmentProfile":null,"maximumNumberOfWorkers":3,"planName":"VirtualDedicatedPlan","adminRuntimeSiteName":null,"computeMode":"Shared","siteMode":null,"geoRegion":"West + US","perSiteScaling":false,"numberOfSites":0,"hostingEnvironmentId":null,"tags":null,"kind":"linux","resourceGroup":"azurecli-webapp-simple","reserved":true,"mdmId":"waws-prod-bay-063_2192","targetWorkerCount":0,"targetWorkerSizeId":0,"provisioningState":"Succeeded"},"sku":{"name":"B1","tier":"Basic","size":"B1","family":"B","capacity":1}}'} + headers: + Cache-Control: [no-cache] + Content-Type: [application/json] + Date: ['Fri, 17 Mar 2017 22:09:02 GMT'] + Expires: ['-1'] + Pragma: [no-cache] + Server: [Microsoft-IIS/8.0] + Strict-Transport-Security: [max-age=31536000; includeSubDomains] + Transfer-Encoding: [chunked] + Vary: [Accept-Encoding] + X-AspNet-Version: [4.0.30319] + X-Powered-By: [ASP.NET] + content-length: ['1156'] + x-ms-ratelimit-remaining-subscription-writes: ['1198'] + status: {code: 200, message: OK} +- request: + body: '{"location": "westus", "properties": {"microService": "false", "scmSiteAlsoStopped": + false, "reserved": false, "serverFarmId": "/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourceGroups/azurecli-webapp-simple/providers/Microsoft.Web/serverfarms/winplan"}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Length: ['270'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.5.3 (Windows-10-10.0.14393-SP0) requests/2.9.1 msrest/0.4.6 + msrest_azure/0.4.7 websitemanagementclient/0.31.0 Azure-SDK-For-Python AZURECLI/TEST/2.0.1+dev] + accept-language: [en-US] + x-ms-client-request-id: [54ad3914-0b5e-11e7-889a-64510658e3b3] + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azurecli-webapp-simple/providers/Microsoft.Web/sites/cli-webapp-simple3?api-version=2016-08-01 + response: + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azurecli-webapp-simple/providers/Microsoft.Web/sites/cli-webapp-simple3","name":"cli-webapp-simple3","type":"Microsoft.Web/sites","kind":"app","location":"westus","tags":null,"properties":{"name":"cli-webapp-simple3","state":"Running","hostNames":["cli-webapp-simple3.azurewebsites.net"],"webSpace":"azurecli-webapp-simple-WestUSwebspace","selfLink":"https://waws-prod-bay-063.api.azurewebsites.windows.net:454/subscriptions/00000000-0000-0000-0000-000000000000/webspaces/azurecli-webapp-simple-WestUSwebspace/sites/cli-webapp-simple3","repositorySiteName":"cli-webapp-simple3","owner":null,"usageState":"Normal","enabled":true,"adminEnabled":true,"enabledHostNames":["cli-webapp-simple3.azurewebsites.net","cli-webapp-simple3.scm.azurewebsites.net"],"siteProperties":{"metadata":null,"properties":[],"appSettings":null},"availabilityState":"Normal","sslCertificates":null,"csrs":[],"cers":null,"siteMode":null,"hostNameSslStates":[{"name":"cli-webapp-simple3.azurewebsites.net","sslState":"Disabled","ipBasedSslResult":null,"virtualIP":null,"thumbprint":null,"toUpdate":null,"toUpdateIpBasedSsl":null,"ipBasedSslState":"NotConfigured","hostType":"Standard"},{"name":"cli-webapp-simple3.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/azurecli-webapp-simple/providers/Microsoft.Web/serverfarms/winplan","reserved":true,"lastModifiedTimeUtc":"2017-03-17T22:09:04.8733333","storageRecoveryDefaultState":"Running","contentAvailabilityState":"Normal","runtimeAvailabilityState":"Normal","siteConfig":null,"deploymentId":"cli-webapp-simple3","trafficManagerHostNames":null,"sku":"Basic","premiumAppDeployed":null,"scmSiteAlsoStopped":false,"targetSwapSlot":null,"hostingEnvironment":null,"hostingEnvironmentProfile":null,"microService":"false","gatewaySiteName":null,"clientAffinityEnabled":true,"clientCertEnabled":false,"hostNamesDisabled":false,"domainVerificationIdentifiers":null,"kind":"app","outboundIpAddresses":"13.93.220.109,13.64.108.119,13.64.198.87,13.64.192.142,13.64.109.132","containerSize":0,"dailyMemoryTimeQuota":0,"suspendedTill":null,"siteDisabledReason":0,"functionExecutionUnitsCache":null,"maxNumberOfWorkers":null,"homeStamp":"waws-prod-bay-063","cloningInfo":null,"hostingEnvironmentId":null,"tags":null,"resourceGroup":"azurecli-webapp-simple","defaultHostName":"cli-webapp-simple3.azurewebsites.net","slotSwapStatus":null}}'} + headers: + Cache-Control: [no-cache] + Content-Type: [application/json] + Date: ['Fri, 17 Mar 2017 22:09:15 GMT'] + ETag: ['"1D29F6B176C756B"'] + Expires: ['-1'] + Pragma: [no-cache] + Server: [Microsoft-IIS/8.0] + Strict-Transport-Security: [max-age=31536000; includeSubDomains] + Transfer-Encoding: [chunked] + Vary: [Accept-Encoding] + X-AspNet-Version: [4.0.30319] + X-Powered-By: [ASP.NET] + content-length: ['2728'] + x-ms-ratelimit-remaining-subscription-writes: ['1197'] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.5.3 (Windows-10-10.0.14393-SP0) requests/2.9.1 msrest/0.4.6 + msrest_azure/0.4.7 resourcemanagementclient/0.30.2 Azure-SDK-For-Python + AZURECLI/TEST/2.0.1+dev] + accept-language: [en-US] + x-ms-client-request-id: [5ca882de-0b5e-11e7-9291-64510658e3b3] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resources?$filter=resourceGroup%20eq%20%27azurecli-webapp-simple%27&api-version=2016-09-01 + response: + body: {string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azurecli-webapp-simple/providers/Microsoft.Web/serverFarms/cli-webapp-simple_plan","name":"cli-webapp-simple_plan","type":"Microsoft.Web/serverFarms","sku":{"name":"S1","tier":"Standard","size":"S1","family":"S","capacity":1},"kind":"linux","location":"westus"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azurecli-webapp-simple/providers/Microsoft.Web/serverFarms/winplan","name":"winplan","type":"Microsoft.Web/serverFarms","sku":{"name":"B1","tier":"Basic","size":"B1","family":"B","capacity":1},"kind":"linux","location":"westus"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azurecli-webapp-simple/providers/Microsoft.Web/sites/cli-webapp-simple","name":"cli-webapp-simple","type":"Microsoft.Web/sites","kind":"app","location":"westus"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azurecli-webapp-simple/providers/Microsoft.Web/sites/cli-webapp-simple2","name":"cli-webapp-simple2","type":"Microsoft.Web/sites","kind":"app","location":"westus"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azurecli-webapp-simple/providers/Microsoft.Web/sites/cli-webapp-simple3","name":"cli-webapp-simple3","type":"Microsoft.Web/sites","kind":"app","location":"westus"}]}'} + headers: + Cache-Control: [no-cache] + Content-Type: [application/json; charset=utf-8] + Date: ['Fri, 17 Mar 2017 22:09:16 GMT'] + Expires: ['-1'] + Pragma: [no-cache] + Strict-Transport-Security: [max-age=31536000; includeSubDomains] + Vary: [Accept-Encoding] + content-length: ['1392'] + status: {code: 200, message: OK} +version: 1 diff --git a/src/command_modules/azure-cli-appservice/tests/test_webapp_commands.py b/src/command_modules/azure-cli-appservice/tests/test_webapp_commands.py index b5254f83baf..e61a029acfe 100644 --- a/src/command_modules/azure-cli-appservice/tests/test_webapp_commands.py +++ b/src/command_modules/azure-cli-appservice/tests/test_webapp_commands.py @@ -22,7 +22,7 @@ def test_webapp_e2e(self): def body(self): webapp_name = 'webapp-e2e3' plan = 'webapp-e2e-plan' - self.cmd('appservice plan create -g {} -n {}'.format(self.resource_group, plan)) + plan_result = self.cmd('appservice plan create -g {} -n {}'.format(self.resource_group, plan)) self.cmd('appservice plan list -g {}'.format(self.resource_group), checks=[ JMESPathCheck('length(@)', 1), JMESPathCheck('[0].name', plan), @@ -42,7 +42,7 @@ def body(self): JMESPathCheck('sku.name', 'S1') ]) - self.cmd('appservice web create -g {} -n {} --plan {}'.format(self.resource_group, webapp_name, plan), checks=[ + self.cmd('appservice web create -g {} -n {} --plan {} -l {}'.format(self.resource_group, webapp_name, plan_result['id'], self.location), checks=[ JMESPathCheck('state', 'Running'), JMESPathCheck('name', webapp_name), JMESPathCheck('hostNames[0]', webapp_name + '.azurewebsites.net') @@ -57,8 +57,8 @@ def body(self): JMESPathCheck('hostNames[0]', webapp_name + '.azurewebsites.net') ]) - result = self.cmd('appservice web source-control config-local-git -g {} -n {}'.format(self.resource_group, webapp_name)) - self.assertTrue(result['url'].endswith(webapp_name + '.git')) + plan_result = self.cmd('appservice web source-control config-local-git -g {} -n {}'.format(self.resource_group, webapp_name)) + self.assertTrue(plan_result['url'].endswith(webapp_name + '.git')) self.cmd('appservice web source-control show -g {} -n {}'.format(self.resource_group, webapp_name), checks=[ JMESPathCheck('repoUrl', 'https://{}.scm.azurewebsites.net'.format(webapp_name)) ]) @@ -76,8 +76,8 @@ def body(self): ]) # show publish profile info - result = self.cmd('appservice web deployment list-publishing-profiles -g {} -n {}'.format(self.resource_group, webapp_name)) - self.assertTrue(result[1]['publishUrl'].startswith('ftp://')) + plan_result = self.cmd('appservice web deployment list-publishing-profiles -g {} -n {}'.format(self.resource_group, webapp_name)) + self.assertTrue(plan_result[1]['publishUrl'].startswith('ftp://')) self.cmd('appservice web stop -g {} -n {}'.format(self.resource_group, webapp_name)) self.cmd('appservice web show -g {} -n {}'.format(self.resource_group, webapp_name), checks=[ @@ -93,10 +93,51 @@ def body(self): self.cmd('appservice web delete -g {} -n {}'.format(self.resource_group, webapp_name)) #test empty service plan should be automatically deleted. - result = self.cmd('appservice plan list -g {}'.format(self.resource_group), checks=[ + plan_result = self.cmd('appservice plan list -g {}'.format(self.resource_group), checks=[ JMESPathCheck('length(@)', 0) ]) +class WebappSimpleCreateTest(ResourceGroupVCRTestBase): + + def __init__(self, test_method): + super(WebappSimpleCreateTest, self).__init__(__file__, test_method, resource_group='azurecli-webapp-simple') + + def test_webapp_simple_create(self): + self.execute() + + def body(self): + webapp_name = 'cli-webapp-simple' + webapp_name2 = 'cli-webapp-simple2' + webapp_name3 = 'cli-webapp-simple3' + + # create web 1 + result = self.cmd('appservice web create -g {} -n {} --is-linux'.format(self.resource_group, webapp_name)) + self.assertEqual(webapp_name, result['name']) + self.assertTrue(result['serverFarmId'].endswith('/' + webapp_name + '_plan')) + + # create web 2 + result = self.cmd('appservice web create -g {} -n {} --is-linux'.format(self.resource_group, webapp_name2)) + self.assertEqual(webapp_name2, result['name']) + self.assertTrue(result['serverFarmId'].endswith('/' + webapp_name + '_plan')) + + # verify we reuse the plan for second web + self.cmd('resource list -g {}'.format(self.resource_group), checks=[ + JMESPathCheck('length([])', 3), + JMESPathCheck("length([?name=='{}_plan'])".format(webapp_name), 1) + ]) + + # create web 3 which explictly calls out the plan name + result = self.cmd('appservice web create -g {} -n {} --plan winplan --is-linux --sku b1'.format(self.resource_group, webapp_name3)) + self.assertEqual(webapp_name3, result['name']) + self.assertTrue(result['serverFarmId'].endswith('/winplan')) + + # verify we create a new plan + self.cmd('resource list -g {}'.format(self.resource_group), checks=[ + JMESPathCheck('length([])', 5), + JMESPathCheck("length([?name=='winplan'])".format(webapp_name), 1) + ]) + + class WebappConfigureTest(ResourceGroupVCRTestBase): def __init__(self, test_method): @@ -109,8 +150,8 @@ def test_webapp_config(self): def set_up(self): super(WebappConfigureTest, self).set_up() plan = 'webapp-config-plan' - self.cmd('appservice plan create -g {} -n {} --sku S1'.format(self.resource_group, plan)) - self.cmd('appservice web create -g {} -n {} --plan {}'.format(self.resource_group, self.webapp_name, plan)) + plan_result = self.cmd('appservice plan create -g {} -n {} --sku S1'.format(self.resource_group, plan)) + self.cmd('appservice web create -g {} -n {} --plan {}'.format(self.resource_group, self.webapp_name, plan_result['id'])) def body(self): #site config testing @@ -222,9 +263,7 @@ def test_appservice_error_polish(self): def set_up(self): super(AppServiceBadErrorPolishTest, self).set_up() self.cmd('group create -n {} -l westus'.format(self.resource_group2)) - self.cmd('appservice plan create -g {} -n {} --sku b1'.format(self.resource_group, self.plan)) - self.cmd('appservice web create -g {} -n {} --plan {}'.format(self.resource_group, self.webapp_name, self.plan)) - self.cmd('appservice plan create -g {} -n {} --sku b1'.format(self.resource_group2, self.plan)) + self.cmd('appservice web create -g {} -n {}'.format(self.resource_group, self.webapp_name)) def tear_down(self): super(AppServiceBadErrorPolishTest, self).tear_down() @@ -232,7 +271,7 @@ def tear_down(self): def body(self): # we will try to produce an error by try creating 2 webapp with same name in different groups - self.cmd('appservice web create -g {} -n {} --plan {}'.format(self.resource_group2, self.webapp_name, self.plan), + self.cmd('appservice web create -g {} -n {}'.format(self.resource_group2, self.webapp_name), allowed_exceptions='Website with given name {} already exists'.format(self.webapp_name)) #this test doesn't contain the ultimate verification which you need to manually load the frontpage in a browser @@ -246,11 +285,11 @@ def test_linux_webapp(self): def body(self): plan = 'webapp-linux-plan' webapp = 'webapp-linux1' - self.cmd('appservice plan create -g {} -n {} --sku S1 --is-linux' .format(self.resource_group, plan), checks=[ + plan_result = self.cmd('appservice plan create -g {} -n {} --sku S1 --is-linux' .format(self.resource_group, plan), checks=[ JMESPathCheck('reserved', True), #this weird field means it is a linux JMESPathCheck('sku.name', 'S1'), ]) - self.cmd('appservice web create -g {} -n {} --plan {}'.format(self.resource_group, webapp, plan), checks=[ + self.cmd('appservice web create -g {} -n {} --plan {} -l {}'.format(self.resource_group, webapp, plan_result['id'], self.location), checks=[ JMESPathCheck('name', webapp), ]) self.cmd('appservice web config update -g {} -n {} --startup-file {}'.format(self.resource_group, webapp, 'process.json'), checks=[ @@ -275,14 +314,12 @@ def test_webapp_git(self): self.execute() def body(self): - plan = 'webapp-git-plan5' webapp = 'web-git-test2' #You can create and use any repros with the 3 files under "./sample_web" test_git_repo = 'https://github.com/yugangw-msft/azure-site-test' - self.cmd('appservice plan create -g {} -n {} --sku S1'.format(self.resource_group, plan)) - self.cmd('appservice web create -g {} -n {} --plan {}'.format(self.resource_group, webapp, plan)) + self.cmd('appservice web create -g {} -n {}'.format(self.resource_group, webapp)) self.cmd('appservice web source-control config -g {} -n {} --repo-url {} --branch {} --manual-integration'.format(self.resource_group, webapp, test_git_repo, 'master'), checks=[ JMESPathCheck('repoUrl', test_git_repo), @@ -319,8 +356,8 @@ def test_webapp_slot(self): self.execute() def body(self): - self.cmd('appservice plan create -g {} -n {} --sku S1'.format(self.resource_group, self.plan)) - self.cmd('appservice web create -g {} -n {} --plan {}'.format(self.resource_group, self.webapp, self.plan)) + plan_result = self.cmd('appservice plan create -g {} -n {} --sku S1'.format(self.resource_group, self.plan)) + self.cmd('appservice web create -g {} -n {} --plan {} -l {}'.format(self.resource_group, self.webapp, plan_result['id'], self.location)) #You can create and use any repros with the 3 files under "./sample_web" and with a 'staging 'branch slot = 'staging' slot2 = 'dev' @@ -396,8 +433,8 @@ def body(self): pfx_file = os.path.join(TEST_DIR, 'server.pfx') cert_password = 'test' cert_thumbprint = 'DB2BA6898D0B330A93E7F69FF505C61EF39921B6' - self.cmd('appservice plan create -g {} -n {} --sku B1'.format(self.resource_group, plan)) - self.cmd('appservice web create -g {} -n {} --plan {}'.format(self.resource_group, self.webapp_name, plan)) + plan_result = self.cmd('appservice plan create -g {} -n {} --sku B1'.format(self.resource_group, plan)) + self.cmd('appservice web create -g {} -n {} --plan {} -l {}'.format(self.resource_group, self.webapp_name, plan_result['id'], self.location)) self.cmd('appservice web config ssl upload -g {} -n {} --certificate-file "{}" --certificate-password {}'.format(self.resource_group, self.webapp_name, pfx_file, cert_password), checks=[ JMESPathCheck('thumbprint', cert_thumbprint) ]) @@ -423,8 +460,8 @@ def test_webapp_backup_config(self): def set_up(self): super(WebappBackupConfigScenarioTest, self).set_up() plan = 'webapp-backup-plan' - self.cmd('appservice plan create -g {} -n {} --sku S1'.format(self.resource_group, plan)) - self.cmd('appservice web create -g {} -n {} --plan {}'.format(self.resource_group, self.webapp_name, plan)) + plan_result = self.cmd('appservice plan create -g {} -n {} --sku S1'.format(self.resource_group, plan)) + self.cmd('appservice web create -g {} -n {} --plan {} -l {}'.format(self.resource_group, self.webapp_name, plan_result['id'], self.location)) def body(self): sas_url = 'https://azureclistore.blob.core.windows.net/sitebackups?sv=2015-04-05&sr=c&sig=%2FjH1lEtbm3uFqtMI%2BfFYwgrntOs1qhGnpGv9uRibJ7A%3D&se=2017-02-14T04%3A53%3A28Z&sp=rwdl' @@ -490,8 +527,8 @@ def test_webapp_backup_restore(self): def set_up(self): super(WebappBackupRestoreScenarioTest, self).set_up() plan = 'webapp-backup-plan' - self.cmd('appservice plan create -g {} -n {} --sku S1'.format(self.resource_group, plan)) - self.cmd('appservice web create -g {} -n {} --plan {}'.format(self.resource_group, self.webapp_name, plan)) + plan_result = self.cmd('appservice plan create -g {} -n {} --sku S1'.format(self.resource_group, plan)) + self.cmd('appservice web create -g {} -n {} --plan {} -l {}'.format(self.resource_group, self.webapp_name, plan_result['id'], self.location)) def body(self): sas_url = 'https://azureclistore.blob.core.windows.net/sitebackups?sv=2015-04-05&sr=c&sig=PJpE6swgZ6oZNFTlUz0GOIl87KKdvvgX7Ap8YXKHRp8%3D&se=2017-03-10T23%3A40%3A24Z&sp=rwdl' diff --git a/src/command_modules/azure-cli-appservice/tests/test_webapp_validators.py b/src/command_modules/azure-cli-appservice/tests/test_webapp_validators.py new file mode 100644 index 00000000000..ba06fe27bbf --- /dev/null +++ b/src/command_modules/azure-cli-appservice/tests/test_webapp_validators.py @@ -0,0 +1,31 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +import unittest +import mock + +from azure.cli.core._util import CLIError +from azure.cli.command_modules.appservice._validators import process_webapp_create_namespace + +class TestValidators(unittest.TestCase): + def test_create_web_with_plan_id(self): + np = mock.MagicMock() + np.location = 'antarctic' + np.plan = '/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourceGroups/g1/providers/Microsoft.Web/serverfarms/plan1' + np.sku = None + np.number_of_workers = None + process_webapp_create_namespace(np) + self.assertEqual(False, np.create_plan) + + def test_create_web_with_plan_error(self): + np = mock.MagicMock() + np.location = 'antarctic' + np.plan = '/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourceGroups/g1/providers/Microsoft.Web/serverfarms/plan1' + np.sku = 'B1' + np.number_of_workers = None + with self.assertRaises(CLIError) as context: + process_webapp_create_namespace(np) + self.assertTrue('Usage error:' in str(context.exception)) + From 910fd654abed9849e984c58ffdf9bce4d9bde5a4 Mon Sep 17 00:00:00 2001 From: yugangw-msft Date: Mon, 20 Mar 2017 11:18:40 -0700 Subject: [PATCH 2/2] address code review feedback --- .../cli/command_modules/appservice/_params.py | 2 +- .../command_modules/appservice/_validators.py | 8 +- .../recordings/test_webapp_simple_create.yaml | 473 ++++++++++-------- .../tests/test_webapp_commands.py | 30 +- 4 files changed, 284 insertions(+), 229 deletions(-) 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 1bafce8f2d6..3b634d613ae 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 @@ -64,7 +64,7 @@ def get_hostname_completion_list(prefix, action, parsed_args, **kwargs): # pylin register_cli_argument('appservice web create', 'create_plan', ignore_type) register_cli_argument('appservice web create', 'plan', arg_group='AppService Plan', options_list=('--plan', '-p'), completer=get_resource_name_completion_list('Microsoft.Web/serverFarms'), - help='Appservice plan name. Can also reference an existing subnet by ID. If omitted, an appropriate plan in the same resource group will be selected automatically, or a new one will be created.') + help='Appservice plan name. Can also reference an existing plan by ID. If omitted, an appropriate plan in the same resource group will be selected automatically, or a new one will be created.') register_cli_argument('appservice web create', 'sku', arg_group='AppService Plan', help='{}. Default: S1'.format(_SKU_HELP), **enum_choice_list(_SKU_LIST)) register_cli_argument('appservice web create', 'number_of_workers', help='Number of workers to be allocated. Default: 1', type=int, arg_group='AppService Plan') diff --git a/src/command_modules/azure-cli-appservice/azure/cli/command_modules/appservice/_validators.py b/src/command_modules/azure-cli-appservice/azure/cli/command_modules/appservice/_validators.py index 39e0be9692f..bd9ea21e8b9 100644 --- a/src/command_modules/azure-cli-appservice/azure/cli/command_modules/appservice/_validators.py +++ b/src/command_modules/azure-cli-appservice/azure/cli/command_modules/appservice/_validators.py @@ -6,7 +6,7 @@ from azure.cli.core._util import CLIError from azure.cli.core.commands.validators import get_default_location_from_resource_group -def _validate_plan_arg(namespace): +def validate_plan_arg(namespace): from ._client_factory import web_client_factory namespace.create_plan = False if namespace.plan: @@ -21,7 +21,7 @@ def _validate_plan_arg(namespace): else: client = web_client_factory() result = client.app_service_plans.list_by_resource_group(namespace.resource_group_name) - existing_plan = next((x for x in result if _match_plan_location(x, namespace.location) and + existing_plan = next((x for x in result if match_plan_location(x, namespace.location) and namespace.is_linux == (x.kind == 'linux')), None) if existing_plan: namespace.plan = existing_plan.id @@ -36,7 +36,7 @@ def _validate_plan_arg(namespace): -def _match_plan_location(plan, location): +def match_plan_location(plan, location): # the problem with appservice is it uses display name, rather canonical name # so we have to hack it return plan.location.replace(' ', '').lower() == location.lower() @@ -44,4 +44,4 @@ def _match_plan_location(plan, location): def process_webapp_create_namespace(namespace): get_default_location_from_resource_group(namespace) - _validate_plan_arg(namespace) + validate_plan_arg(namespace) diff --git a/src/command_modules/azure-cli-appservice/tests/recordings/test_webapp_simple_create.yaml b/src/command_modules/azure-cli-appservice/tests/recordings/test_webapp_simple_create.yaml index fa9beca25d9..a9dd6026b0a 100644 --- a/src/command_modules/azure-cli-appservice/tests/recordings/test_webapp_simple_create.yaml +++ b/src/command_modules/azure-cli-appservice/tests/recordings/test_webapp_simple_create.yaml @@ -1,386 +1,443 @@ interactions: +- request: + body: '{"location": "westus", "tags": {"use": "az-test"}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [group create] + Connection: [keep-alive] + Content-Length: ['50'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.5.3 (Windows-10-10.0.14393-SP0) requests/2.9.1 msrest/0.4.6 + msrest_azure/0.4.7 resourcemanagementclient/0.30.2 Azure-SDK-For-Python + AZURECLI/2.0.1+dev] + accept-language: [en-US] + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001?api-version=2016-09-01 + response: + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","name":"clitest.rg000001","location":"westus","tags":{"use":"az-test"},"properties":{"provisioningState":"Succeeded"}}'} + headers: + cache-control: [no-cache] + content-length: ['326'] + content-type: [application/json; charset=utf-8] + date: ['Mon, 20 Mar 2017 18:10:01 GMT'] + expires: ['-1'] + pragma: [no-cache] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-ms-ratelimit-remaining-subscription-writes: ['1199'] + status: {code: 201, message: Created} - request: body: null headers: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] + CommandName: [appservice web create] Connection: [keep-alive] Content-Type: [application/json; charset=utf-8] User-Agent: [python/3.5.3 (Windows-10-10.0.14393-SP0) requests/2.9.1 msrest/0.4.6 msrest_azure/0.4.7 resourcemanagementclient/0.30.2 Azure-SDK-For-Python - AZURECLI/TEST/2.0.1+dev] + AZURECLI/2.0.1+dev] accept-language: [en-US] - x-ms-client-request-id: [3f83325c-0b5e-11e7-91f5-64510658e3b3] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/azurecli-webapp-simple?api-version=2016-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001?api-version=2016-09-01 response: - body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azurecli-webapp-simple","name":"azurecli-webapp-simple","location":"westus","tags":{"use":"az-test"},"properties":{"provisioningState":"Succeeded"}}'} + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","name":"clitest.rg000001","location":"westus","tags":{"use":"az-test"},"properties":{"provisioningState":"Succeeded"}}'} headers: - Cache-Control: [no-cache] - Content-Type: [application/json; charset=utf-8] - Date: ['Fri, 17 Mar 2017 22:08:27 GMT'] - Expires: ['-1'] - Pragma: [no-cache] - Strict-Transport-Security: [max-age=31536000; includeSubDomains] - Vary: [Accept-Encoding] - content-length: ['234'] + cache-control: [no-cache] + content-length: ['326'] + content-type: [application/json; charset=utf-8] + date: ['Mon, 20 Mar 2017 18:10:02 GMT'] + expires: ['-1'] + pragma: [no-cache] + strict-transport-security: [max-age=31536000; includeSubDomains] + vary: [Accept-Encoding] status: {code: 200, message: OK} - request: body: null headers: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] + CommandName: [appservice web create] Connection: [keep-alive] Content-Type: [application/json; charset=utf-8] User-Agent: [python/3.5.3 (Windows-10-10.0.14393-SP0) requests/2.9.1 msrest/0.4.6 - msrest_azure/0.4.7 websitemanagementclient/0.31.0 Azure-SDK-For-Python AZURECLI/TEST/2.0.1+dev] + msrest_azure/0.4.7 websitemanagementclient/0.31.0 Azure-SDK-For-Python AZURECLI/2.0.1+dev] accept-language: [en-US] - x-ms-client-request-id: [3fac6468-0b5e-11e7-8ba8-64510658e3b3] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azurecli-webapp-simple/providers/Microsoft.Web/serverfarms?api-version=2016-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Web/serverfarms?api-version=2016-09-01 response: body: {string: '{"value":[],"nextLink":null,"id":null}'} headers: - Cache-Control: [no-cache] - Content-Type: [application/json] - Date: ['Fri, 17 Mar 2017 22:08:28 GMT'] - Expires: ['-1'] - Pragma: [no-cache] - Server: [Microsoft-IIS/8.0] - Strict-Transport-Security: [max-age=31536000; includeSubDomains] - Transfer-Encoding: [chunked] - Vary: [Accept-Encoding] - X-AspNet-Version: [4.0.30319] - X-Powered-By: [ASP.NET] + cache-control: [no-cache] content-length: ['38'] + content-type: [application/json] + date: ['Mon, 20 Mar 2017 18:10:02 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-aspnet-version: [4.0.30319] + x-powered-by: [ASP.NET] status: {code: 200, message: OK} - request: - body: '{"sku": {"tier": "STANDARD", "name": "S1", "capacity": 1}, "location": - "westus", "properties": {"perSiteScaling": false, "reserved": true, "name": - "cli-webapp-simple_plan"}}' + body: '{"location": "westus", "sku": {"tier": "STANDARD", "capacity": 1, "name": + "S1"}, "properties": {"reserved": true, "perSiteScaling": false, "name": "cli-webapp-simple_plan"}}' headers: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] + CommandName: [appservice web create] Connection: [keep-alive] Content-Length: ['173'] Content-Type: [application/json; charset=utf-8] User-Agent: [python/3.5.3 (Windows-10-10.0.14393-SP0) requests/2.9.1 msrest/0.4.6 - msrest_azure/0.4.7 websitemanagementclient/0.31.0 Azure-SDK-For-Python AZURECLI/TEST/2.0.1+dev] + msrest_azure/0.4.7 websitemanagementclient/0.31.0 Azure-SDK-For-Python AZURECLI/2.0.1+dev] accept-language: [en-US] - x-ms-client-request-id: [40095152-0b5e-11e7-a310-64510658e3b3] method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azurecli-webapp-simple/providers/Microsoft.Web/serverfarms/cli-webapp-simple_plan?api-version=2016-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Web/serverfarms/cli-webapp-simple_plan?api-version=2016-09-01 response: - body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azurecli-webapp-simple/providers/Microsoft.Web/serverfarms/cli-webapp-simple_plan","name":"cli-webapp-simple_plan","type":"Microsoft.Web/serverfarms","kind":"linux","location":"West - US","tags":null,"properties":{"serverFarmId":0,"name":"cli-webapp-simple_plan","workerSize":"Small","workerSizeId":0,"workerTierName":null,"numberOfWorkers":1,"currentWorkerSize":"Small","currentWorkerSizeId":0,"currentNumberOfWorkers":1,"status":"Ready","webSpace":"azurecli-webapp-simple-WestUSwebspace","subscription":"0b1f6471-1bf0-4dda-aec3-cb9272f09590","adminSiteName":null,"hostingEnvironment":null,"hostingEnvironmentProfile":null,"maximumNumberOfWorkers":10,"planName":"VirtualDedicatedPlan","adminRuntimeSiteName":null,"computeMode":"Shared","siteMode":null,"geoRegion":"West - US","perSiteScaling":false,"numberOfSites":0,"hostingEnvironmentId":null,"tags":null,"kind":"linux","resourceGroup":"azurecli-webapp-simple","reserved":true,"mdmId":"waws-prod-bay-063_2191","targetWorkerCount":0,"targetWorkerSizeId":0,"provisioningState":"Succeeded"},"sku":{"name":"S1","tier":"Standard","size":"S1","family":"S","capacity":1}}'} + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Web/serverfarms/cli-webapp-simple_plan","name":"cli-webapp-simple_plan","type":"Microsoft.Web/serverfarms","kind":"linux","location":"West + US","tags":null,"properties":{"serverFarmId":0,"name":"cli-webapp-simple_plan","workerSize":"Small","workerSizeId":0,"workerTierName":null,"numberOfWorkers":1,"currentWorkerSize":"Small","currentWorkerSizeId":0,"currentNumberOfWorkers":1,"status":"Ready","webSpace":"clitest.rg000001-WestUSwebspace","subscription":"0b1f6471-1bf0-4dda-aec3-cb9272f09590","adminSiteName":null,"hostingEnvironment":null,"hostingEnvironmentProfile":null,"maximumNumberOfWorkers":10,"planName":"VirtualDedicatedPlan","adminRuntimeSiteName":null,"computeMode":"Shared","siteMode":null,"geoRegion":"West + US","perSiteScaling":false,"numberOfSites":0,"hostingEnvironmentId":null,"tags":null,"kind":"linux","resourceGroup":"clitest.rg000001","reserved":true,"mdmId":"waws-prod-bay-063_2240","targetWorkerCount":0,"targetWorkerSizeId":0,"provisioningState":"Succeeded"},"sku":{"name":"S1","tier":"Standard","size":"S1","family":"S","capacity":1}}'} headers: - Cache-Control: [no-cache] - Content-Type: [application/json] - Date: ['Fri, 17 Mar 2017 22:08:36 GMT'] - Expires: ['-1'] - Pragma: [no-cache] - Server: [Microsoft-IIS/8.0] - Strict-Transport-Security: [max-age=31536000; includeSubDomains] - Transfer-Encoding: [chunked] - Vary: [Accept-Encoding] - X-AspNet-Version: [4.0.30319] - X-Powered-By: [ASP.NET] - content-length: ['1205'] - x-ms-ratelimit-remaining-subscription-writes: ['1198'] + cache-control: [no-cache] + content-length: ['1343'] + content-type: [application/json] + date: ['Mon, 20 Mar 2017 18:10:11 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-aspnet-version: [4.0.30319] + x-ms-ratelimit-remaining-subscription-writes: ['1197'] + x-powered-by: [ASP.NET] status: {code: 200, message: OK} - request: - body: '{"location": "westus", "properties": {"microService": "false", "scmSiteAlsoStopped": - false, "reserved": false, "serverFarmId": "/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourceGroups/azurecli-webapp-simple/providers/Microsoft.Web/serverfarms/cli-webapp-simple_plan"}}' + body: 'b''{"location": "westus", "properties": {"reserved": false, "scmSiteAlsoStopped": + false, "serverFarmId": "/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourceGroups/clitest.rg000001/providers/Microsoft.Web/serverfarms/cli-webapp-simple_plan", + "microService": "false"}}''' headers: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] + CommandName: [appservice web create] Connection: [keep-alive] - Content-Length: ['285'] + Content-Length: ['331'] Content-Type: [application/json; charset=utf-8] User-Agent: [python/3.5.3 (Windows-10-10.0.14393-SP0) requests/2.9.1 msrest/0.4.6 - msrest_azure/0.4.7 websitemanagementclient/0.31.0 Azure-SDK-For-Python AZURECLI/TEST/2.0.1+dev] + msrest_azure/0.4.7 websitemanagementclient/0.31.0 Azure-SDK-For-Python AZURECLI/2.0.1+dev] accept-language: [en-US] - x-ms-client-request-id: [44ceeeba-0b5e-11e7-828f-64510658e3b3] method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azurecli-webapp-simple/providers/Microsoft.Web/sites/cli-webapp-simple?api-version=2016-08-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Web/sites/cli-webapp-simple?api-version=2016-08-01 response: - body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azurecli-webapp-simple/providers/Microsoft.Web/sites/cli-webapp-simple","name":"cli-webapp-simple","type":"Microsoft.Web/sites","kind":"app","location":"westus","tags":null,"properties":{"name":"cli-webapp-simple","state":"Running","hostNames":["cli-webapp-simple.azurewebsites.net"],"webSpace":"azurecli-webapp-simple-WestUSwebspace","selfLink":"https://waws-prod-bay-063.api.azurewebsites.windows.net:454/subscriptions/00000000-0000-0000-0000-000000000000/webspaces/azurecli-webapp-simple-WestUSwebspace/sites/cli-webapp-simple","repositorySiteName":"cli-webapp-simple","owner":null,"usageState":"Normal","enabled":true,"adminEnabled":true,"enabledHostNames":["cli-webapp-simple.azurewebsites.net","cli-webapp-simple.scm.azurewebsites.net"],"siteProperties":{"metadata":null,"properties":[],"appSettings":null},"availabilityState":"Normal","sslCertificates":null,"csrs":[],"cers":null,"siteMode":null,"hostNameSslStates":[{"name":"cli-webapp-simple.azurewebsites.net","sslState":"Disabled","ipBasedSslResult":null,"virtualIP":null,"thumbprint":null,"toUpdate":null,"toUpdateIpBasedSsl":null,"ipBasedSslState":"NotConfigured","hostType":"Standard"},{"name":"cli-webapp-simple.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/azurecli-webapp-simple/providers/Microsoft.Web/serverfarms/cli-webapp-simple_plan","reserved":true,"lastModifiedTimeUtc":"2017-03-17T22:08:38.3066667","storageRecoveryDefaultState":"Running","contentAvailabilityState":"Normal","runtimeAvailabilityState":"Normal","siteConfig":null,"deploymentId":"cli-webapp-simple","trafficManagerHostNames":null,"sku":"Standard","premiumAppDeployed":null,"scmSiteAlsoStopped":false,"targetSwapSlot":null,"hostingEnvironment":null,"hostingEnvironmentProfile":null,"microService":"false","gatewaySiteName":null,"clientAffinityEnabled":true,"clientCertEnabled":false,"hostNamesDisabled":false,"domainVerificationIdentifiers":null,"kind":"app","outboundIpAddresses":"13.93.220.109,13.64.108.119,13.64.198.87,13.64.192.142,13.64.109.132","containerSize":0,"dailyMemoryTimeQuota":0,"suspendedTill":null,"siteDisabledReason":0,"functionExecutionUnitsCache":null,"maxNumberOfWorkers":null,"homeStamp":"waws-prod-bay-063","cloningInfo":null,"hostingEnvironmentId":null,"tags":null,"resourceGroup":"azurecli-webapp-simple","defaultHostName":"cli-webapp-simple.azurewebsites.net","slotSwapStatus":null}}'} + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Web/sites/cli-webapp-simple","name":"cli-webapp-simple","type":"Microsoft.Web/sites","kind":"app","location":"westus","tags":null,"properties":{"name":"cli-webapp-simple","state":"Running","hostNames":["cli-webapp-simple.azurewebsites.net"],"webSpace":"clitest.rg000001-WestUSwebspace","selfLink":"https://waws-prod-bay-063.api.azurewebsites.windows.net:454/subscriptions/00000000-0000-0000-0000-000000000000/webspaces/clitest.rg000001-WestUSwebspace/sites/cli-webapp-simple","repositorySiteName":"cli-webapp-simple","owner":null,"usageState":"Normal","enabled":true,"adminEnabled":true,"enabledHostNames":["cli-webapp-simple.azurewebsites.net","cli-webapp-simple.scm.azurewebsites.net"],"siteProperties":{"metadata":null,"properties":[],"appSettings":null},"availabilityState":"Normal","sslCertificates":null,"csrs":[],"cers":null,"siteMode":null,"hostNameSslStates":[{"name":"cli-webapp-simple.azurewebsites.net","sslState":"Disabled","ipBasedSslResult":null,"virtualIP":null,"thumbprint":null,"toUpdate":null,"toUpdateIpBasedSsl":null,"ipBasedSslState":"NotConfigured","hostType":"Standard"},{"name":"cli-webapp-simple.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/cli-webapp-simple_plan","reserved":true,"lastModifiedTimeUtc":"2017-03-20T18:10:16.19","storageRecoveryDefaultState":"Running","contentAvailabilityState":"Normal","runtimeAvailabilityState":"Normal","siteConfig":null,"deploymentId":"cli-webapp-simple","trafficManagerHostNames":null,"sku":"Standard","premiumAppDeployed":null,"scmSiteAlsoStopped":false,"targetSwapSlot":null,"hostingEnvironment":null,"hostingEnvironmentProfile":null,"microService":"false","gatewaySiteName":null,"clientAffinityEnabled":true,"clientCertEnabled":false,"hostNamesDisabled":false,"domainVerificationIdentifiers":null,"kind":"app","outboundIpAddresses":"13.93.220.109,13.64.108.119,13.64.198.87,13.64.192.142,13.64.109.132","containerSize":0,"dailyMemoryTimeQuota":0,"suspendedTill":null,"siteDisabledReason":0,"functionExecutionUnitsCache":null,"maxNumberOfWorkers":null,"homeStamp":"waws-prod-bay-063","cloningInfo":null,"hostingEnvironmentId":null,"tags":null,"resourceGroup":"clitest.rg000001","defaultHostName":"cli-webapp-simple.azurewebsites.net","slotSwapStatus":null}}'} headers: - Cache-Control: [no-cache] - Content-Type: [application/json] - Date: ['Fri, 17 Mar 2017 22:08:41 GMT'] - ETag: ['"1D29F6B0798BDD5"'] - Expires: ['-1'] - Pragma: [no-cache] - Server: [Microsoft-IIS/8.0] - Strict-Transport-Security: [max-age=31536000; includeSubDomains] - Transfer-Encoding: [chunked] - Vary: [Accept-Encoding] - X-AspNet-Version: [4.0.30319] - X-Powered-By: [ASP.NET] - content-length: ['2734'] - x-ms-ratelimit-remaining-subscription-writes: ['1198'] + cache-control: [no-cache] + content-length: ['2959'] + content-type: [application/json] + date: ['Mon, 20 Mar 2017 18:10:24 GMT'] + etag: ['"1D2A1A53A1A24B5"'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-aspnet-version: [4.0.30319] + 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: [appservice web create] Connection: [keep-alive] Content-Type: [application/json; charset=utf-8] User-Agent: [python/3.5.3 (Windows-10-10.0.14393-SP0) requests/2.9.1 msrest/0.4.6 msrest_azure/0.4.7 resourcemanagementclient/0.30.2 Azure-SDK-For-Python - AZURECLI/TEST/2.0.1+dev] + AZURECLI/2.0.1+dev] accept-language: [en-US] - x-ms-client-request-id: [48a5f518-0b5e-11e7-9ba4-64510658e3b3] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/azurecli-webapp-simple?api-version=2016-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001?api-version=2016-09-01 response: - body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azurecli-webapp-simple","name":"azurecli-webapp-simple","location":"westus","tags":{"use":"az-test"},"properties":{"provisioningState":"Succeeded"}}'} + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","name":"clitest.rg000001","location":"westus","tags":{"use":"az-test"},"properties":{"provisioningState":"Succeeded"}}'} headers: - Cache-Control: [no-cache] - Content-Type: [application/json; charset=utf-8] - Date: ['Fri, 17 Mar 2017 22:08:43 GMT'] - Expires: ['-1'] - Pragma: [no-cache] - Strict-Transport-Security: [max-age=31536000; includeSubDomains] - Vary: [Accept-Encoding] - content-length: ['234'] + cache-control: [no-cache] + content-length: ['326'] + content-type: [application/json; charset=utf-8] + date: ['Mon, 20 Mar 2017 18:10:26 GMT'] + expires: ['-1'] + pragma: [no-cache] + strict-transport-security: [max-age=31536000; includeSubDomains] + vary: [Accept-Encoding] status: {code: 200, message: OK} - request: body: null headers: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] + CommandName: [appservice web create] Connection: [keep-alive] Content-Type: [application/json; charset=utf-8] User-Agent: [python/3.5.3 (Windows-10-10.0.14393-SP0) requests/2.9.1 msrest/0.4.6 - msrest_azure/0.4.7 websitemanagementclient/0.31.0 Azure-SDK-For-Python AZURECLI/TEST/2.0.1+dev] + msrest_azure/0.4.7 websitemanagementclient/0.31.0 Azure-SDK-For-Python AZURECLI/2.0.1+dev] accept-language: [en-US] - x-ms-client-request-id: [48d2a992-0b5e-11e7-a021-64510658e3b3] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azurecli-webapp-simple/providers/Microsoft.Web/serverfarms?api-version=2016-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Web/serverfarms?api-version=2016-09-01 response: - body: {string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azurecli-webapp-simple/providers/Microsoft.Web/serverfarms/cli-webapp-simple_plan","name":"cli-webapp-simple_plan","type":"Microsoft.Web/serverfarms","kind":"linux","location":"West - US","tags":null,"properties":{"serverFarmId":0,"name":"cli-webapp-simple_plan","workerSize":"Small","workerSizeId":0,"workerTierName":null,"numberOfWorkers":1,"currentWorkerSize":"Small","currentWorkerSizeId":0,"currentNumberOfWorkers":1,"status":"Ready","webSpace":"azurecli-webapp-simple-WestUSwebspace","subscription":"0b1f6471-1bf0-4dda-aec3-cb9272f09590","adminSiteName":null,"hostingEnvironment":null,"hostingEnvironmentProfile":null,"maximumNumberOfWorkers":10,"planName":"VirtualDedicatedPlan","adminRuntimeSiteName":null,"computeMode":"Shared","siteMode":null,"geoRegion":"West - US","perSiteScaling":false,"numberOfSites":1,"hostingEnvironmentId":null,"tags":null,"kind":"linux","resourceGroup":"azurecli-webapp-simple","reserved":true,"mdmId":"waws-prod-bay-063_2191","targetWorkerCount":0,"targetWorkerSizeId":0,"provisioningState":"Succeeded"},"sku":{"name":"S1","tier":"Standard","size":"S1","family":"S","capacity":1}}],"nextLink":null,"id":null}'} + body: {string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Web/serverfarms/cli-webapp-simple_plan","name":"cli-webapp-simple_plan","type":"Microsoft.Web/serverfarms","kind":"linux","location":"West + US","tags":null,"properties":{"serverFarmId":0,"name":"cli-webapp-simple_plan","workerSize":"Small","workerSizeId":0,"workerTierName":null,"numberOfWorkers":1,"currentWorkerSize":"Small","currentWorkerSizeId":0,"currentNumberOfWorkers":1,"status":"Ready","webSpace":"clitest.rg000001-WestUSwebspace","subscription":"0b1f6471-1bf0-4dda-aec3-cb9272f09590","adminSiteName":null,"hostingEnvironment":null,"hostingEnvironmentProfile":null,"maximumNumberOfWorkers":10,"planName":"VirtualDedicatedPlan","adminRuntimeSiteName":null,"computeMode":"Shared","siteMode":null,"geoRegion":"West + US","perSiteScaling":false,"numberOfSites":1,"hostingEnvironmentId":null,"tags":null,"kind":"linux","resourceGroup":"clitest.rg000001","reserved":true,"mdmId":"waws-prod-bay-063_2240","targetWorkerCount":0,"targetWorkerSizeId":0,"provisioningState":"Succeeded"},"sku":{"name":"S1","tier":"Standard","size":"S1","family":"S","capacity":1}}],"nextLink":null,"id":null}'} headers: - Cache-Control: [no-cache] - Content-Type: [application/json] - Date: ['Fri, 17 Mar 2017 22:08:43 GMT'] - Expires: ['-1'] - Pragma: [no-cache] - Server: [Microsoft-IIS/8.0] - Strict-Transport-Security: [max-age=31536000; includeSubDomains] - Transfer-Encoding: [chunked] - Vary: [Accept-Encoding] - X-AspNet-Version: [4.0.30319] - X-Powered-By: [ASP.NET] - content-length: ['1243'] + cache-control: [no-cache] + content-length: ['1381'] + content-type: [application/json] + date: ['Mon, 20 Mar 2017 18:10:27 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-aspnet-version: [4.0.30319] + x-powered-by: [ASP.NET] status: {code: 200, message: OK} - request: - body: '{"location": "westus", "properties": {"microService": "false", "scmSiteAlsoStopped": - false, "reserved": false, "serverFarmId": "/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourceGroups/azurecli-webapp-simple/providers/Microsoft.Web/serverfarms/cli-webapp-simple_plan"}}' + body: 'b''{"location": "westus", "properties": {"reserved": false, "scmSiteAlsoStopped": + false, "serverFarmId": "/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourceGroups/clitest.rg000001/providers/Microsoft.Web/serverfarms/cli-webapp-simple_plan", + "microService": "false"}}''' headers: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] + CommandName: [appservice web create] Connection: [keep-alive] - Content-Length: ['285'] + Content-Length: ['331'] Content-Type: [application/json; charset=utf-8] User-Agent: [python/3.5.3 (Windows-10-10.0.14393-SP0) requests/2.9.1 msrest/0.4.6 - msrest_azure/0.4.7 websitemanagementclient/0.31.0 Azure-SDK-For-Python AZURECLI/TEST/2.0.1+dev] + msrest_azure/0.4.7 websitemanagementclient/0.31.0 Azure-SDK-For-Python AZURECLI/2.0.1+dev] accept-language: [en-US] - x-ms-client-request-id: [495ee49c-0b5e-11e7-82a6-64510658e3b3] method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azurecli-webapp-simple/providers/Microsoft.Web/sites/cli-webapp-simple2?api-version=2016-08-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Web/sites/cli-webapp-simple2?api-version=2016-08-01 response: - body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azurecli-webapp-simple/providers/Microsoft.Web/sites/cli-webapp-simple2","name":"cli-webapp-simple2","type":"Microsoft.Web/sites","kind":"app","location":"westus","tags":null,"properties":{"name":"cli-webapp-simple2","state":"Running","hostNames":["cli-webapp-simple2.azurewebsites.net"],"webSpace":"azurecli-webapp-simple-WestUSwebspace","selfLink":"https://waws-prod-bay-063.api.azurewebsites.windows.net:454/subscriptions/00000000-0000-0000-0000-000000000000/webspaces/azurecli-webapp-simple-WestUSwebspace/sites/cli-webapp-simple2","repositorySiteName":"cli-webapp-simple2","owner":null,"usageState":"Normal","enabled":true,"adminEnabled":true,"enabledHostNames":["cli-webapp-simple2.azurewebsites.net","cli-webapp-simple2.scm.azurewebsites.net"],"siteProperties":{"metadata":null,"properties":[],"appSettings":null},"availabilityState":"Normal","sslCertificates":null,"csrs":[],"cers":null,"siteMode":null,"hostNameSslStates":[{"name":"cli-webapp-simple2.azurewebsites.net","sslState":"Disabled","ipBasedSslResult":null,"virtualIP":null,"thumbprint":null,"toUpdate":null,"toUpdateIpBasedSsl":null,"ipBasedSslState":"NotConfigured","hostType":"Standard"},{"name":"cli-webapp-simple2.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/azurecli-webapp-simple/providers/Microsoft.Web/serverfarms/cli-webapp-simple_plan","reserved":true,"lastModifiedTimeUtc":"2017-03-17T22:08:46.3666667","storageRecoveryDefaultState":"Running","contentAvailabilityState":"Normal","runtimeAvailabilityState":"Normal","siteConfig":null,"deploymentId":"cli-webapp-simple2","trafficManagerHostNames":null,"sku":"Standard","premiumAppDeployed":null,"scmSiteAlsoStopped":false,"targetSwapSlot":null,"hostingEnvironment":null,"hostingEnvironmentProfile":null,"microService":"false","gatewaySiteName":null,"clientAffinityEnabled":true,"clientCertEnabled":false,"hostNamesDisabled":false,"domainVerificationIdentifiers":null,"kind":"app","outboundIpAddresses":"13.93.220.109,13.64.108.119,13.64.198.87,13.64.192.142,13.64.109.132","containerSize":0,"dailyMemoryTimeQuota":0,"suspendedTill":null,"siteDisabledReason":0,"functionExecutionUnitsCache":null,"maxNumberOfWorkers":null,"homeStamp":"waws-prod-bay-063","cloningInfo":null,"hostingEnvironmentId":null,"tags":null,"resourceGroup":"azurecli-webapp-simple","defaultHostName":"cli-webapp-simple2.azurewebsites.net","slotSwapStatus":null}}'} + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Web/sites/cli-webapp-simple2","name":"cli-webapp-simple2","type":"Microsoft.Web/sites","kind":"app","location":"westus","tags":null,"properties":{"name":"cli-webapp-simple2","state":"Running","hostNames":["cli-webapp-simple2.azurewebsites.net"],"webSpace":"clitest.rg000001-WestUSwebspace","selfLink":"https://waws-prod-bay-063.api.azurewebsites.windows.net:454/subscriptions/00000000-0000-0000-0000-000000000000/webspaces/clitest.rg000001-WestUSwebspace/sites/cli-webapp-simple2","repositorySiteName":"cli-webapp-simple2","owner":null,"usageState":"Normal","enabled":true,"adminEnabled":true,"enabledHostNames":["cli-webapp-simple2.azurewebsites.net","cli-webapp-simple2.scm.azurewebsites.net"],"siteProperties":{"metadata":null,"properties":[],"appSettings":null},"availabilityState":"Normal","sslCertificates":null,"csrs":[],"cers":null,"siteMode":null,"hostNameSslStates":[{"name":"cli-webapp-simple2.azurewebsites.net","sslState":"Disabled","ipBasedSslResult":null,"virtualIP":null,"thumbprint":null,"toUpdate":null,"toUpdateIpBasedSsl":null,"ipBasedSslState":"NotConfigured","hostType":"Standard"},{"name":"cli-webapp-simple2.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/cli-webapp-simple_plan","reserved":true,"lastModifiedTimeUtc":"2017-03-20T18:10:29.6866667","storageRecoveryDefaultState":"Running","contentAvailabilityState":"Normal","runtimeAvailabilityState":"Normal","siteConfig":null,"deploymentId":"cli-webapp-simple2","trafficManagerHostNames":null,"sku":"Standard","premiumAppDeployed":null,"scmSiteAlsoStopped":false,"targetSwapSlot":null,"hostingEnvironment":null,"hostingEnvironmentProfile":null,"microService":"false","gatewaySiteName":null,"clientAffinityEnabled":true,"clientCertEnabled":false,"hostNamesDisabled":false,"domainVerificationIdentifiers":null,"kind":"app","outboundIpAddresses":"13.93.220.109,13.64.108.119,13.64.198.87,13.64.192.142,13.64.109.132","containerSize":0,"dailyMemoryTimeQuota":0,"suspendedTill":null,"siteDisabledReason":0,"functionExecutionUnitsCache":null,"maxNumberOfWorkers":null,"homeStamp":"waws-prod-bay-063","cloningInfo":null,"hostingEnvironmentId":null,"tags":null,"resourceGroup":"clitest.rg000001","defaultHostName":"cli-webapp-simple2.azurewebsites.net","slotSwapStatus":null}}'} headers: - Cache-Control: [no-cache] - Content-Type: [application/json] - Date: ['Fri, 17 Mar 2017 22:08:54 GMT'] - ETag: ['"1D29F6B0C6205B5"'] - Expires: ['-1'] - Pragma: [no-cache] - Server: [Microsoft-IIS/8.0] - Strict-Transport-Security: [max-age=31536000; includeSubDomains] - Transfer-Encoding: [chunked] - Vary: [Accept-Encoding] - X-AspNet-Version: [4.0.30319] - X-Powered-By: [ASP.NET] - content-length: ['2746'] + cache-control: [no-cache] + content-length: ['2976'] + content-type: [application/json] + date: ['Mon, 20 Mar 2017 18:10:32 GMT'] + etag: ['"1D2A1A542279B15"'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-aspnet-version: [4.0.30319] x-ms-ratelimit-remaining-subscription-writes: ['1197'] + x-powered-by: [ASP.NET] status: {code: 200, message: OK} - request: body: null headers: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] + CommandName: [resource list] Connection: [keep-alive] Content-Type: [application/json; charset=utf-8] User-Agent: [python/3.5.3 (Windows-10-10.0.14393-SP0) requests/2.9.1 msrest/0.4.6 msrest_azure/0.4.7 resourcemanagementclient/0.30.2 Azure-SDK-For-Python - AZURECLI/TEST/2.0.1+dev] + AZURECLI/2.0.1+dev] accept-language: [en-US] - x-ms-client-request-id: [5031255a-0b5e-11e7-b68e-64510658e3b3] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resources?$filter=resourceGroup%20eq%20%27azurecli-webapp-simple%27&api-version=2016-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resources?$filter=resourceGroup%20eq%20%27clitest.rg000001%27&api-version=2016-09-01 response: - body: {string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azurecli-webapp-simple/providers/Microsoft.Web/serverFarms/cli-webapp-simple_plan","name":"cli-webapp-simple_plan","type":"Microsoft.Web/serverFarms","sku":{"name":"S1","tier":"Standard","size":"S1","family":"S","capacity":1},"kind":"linux","location":"westus"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azurecli-webapp-simple/providers/Microsoft.Web/sites/cli-webapp-simple","name":"cli-webapp-simple","type":"Microsoft.Web/sites","kind":"app","location":"westus"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azurecli-webapp-simple/providers/Microsoft.Web/sites/cli-webapp-simple2","name":"cli-webapp-simple2","type":"Microsoft.Web/sites","kind":"app","location":"westus"}]}'} + body: {string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Web/serverFarms/cli-webapp-simple_plan","name":"cli-webapp-simple_plan","type":"Microsoft.Web/serverFarms","sku":{"name":"S1","tier":"Standard","size":"S1","family":"S","capacity":1},"kind":"linux","location":"westus"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Web/sites/cli-webapp-simple","name":"cli-webapp-simple","type":"Microsoft.Web/sites","kind":"app","location":"westus"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Web/sites/cli-webapp-simple2","name":"cli-webapp-simple2","type":"Microsoft.Web/sites","kind":"app","location":"westus"}]}'} headers: - Cache-Control: [no-cache] - Content-Type: [application/json; charset=utf-8] - Date: ['Fri, 17 Mar 2017 22:08:55 GMT'] - Expires: ['-1'] - Pragma: [no-cache] - Strict-Transport-Security: [max-age=31536000; includeSubDomains] - Vary: [Accept-Encoding] - content-length: ['839'] + cache-control: [no-cache] + content-length: ['977'] + content-type: [application/json; charset=utf-8] + date: ['Mon, 20 Mar 2017 18:10:33 GMT'] + expires: ['-1'] + pragma: [no-cache] + strict-transport-security: [max-age=31536000; includeSubDomains] + vary: [Accept-Encoding] status: {code: 200, message: OK} - request: body: null headers: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] + CommandName: [appservice web create] Connection: [keep-alive] Content-Type: [application/json; charset=utf-8] User-Agent: [python/3.5.3 (Windows-10-10.0.14393-SP0) requests/2.9.1 msrest/0.4.6 msrest_azure/0.4.7 resourcemanagementclient/0.30.2 Azure-SDK-For-Python - AZURECLI/TEST/2.0.1+dev] + AZURECLI/2.0.1+dev] accept-language: [en-US] - x-ms-client-request-id: [50abd06c-0b5e-11e7-8e55-64510658e3b3] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/azurecli-webapp-simple?api-version=2016-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001?api-version=2016-09-01 response: - body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azurecli-webapp-simple","name":"azurecli-webapp-simple","location":"westus","tags":{"use":"az-test"},"properties":{"provisioningState":"Succeeded"}}'} + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","name":"clitest.rg000001","location":"westus","tags":{"use":"az-test"},"properties":{"provisioningState":"Succeeded"}}'} headers: - Cache-Control: [no-cache] - Content-Type: [application/json; charset=utf-8] - Date: ['Fri, 17 Mar 2017 22:08:56 GMT'] - Expires: ['-1'] - Pragma: [no-cache] - Strict-Transport-Security: [max-age=31536000; includeSubDomains] - Vary: [Accept-Encoding] - content-length: ['234'] + cache-control: [no-cache] + content-length: ['326'] + content-type: [application/json; charset=utf-8] + date: ['Mon, 20 Mar 2017 18:10:34 GMT'] + expires: ['-1'] + pragma: [no-cache] + strict-transport-security: [max-age=31536000; includeSubDomains] + vary: [Accept-Encoding] status: {code: 200, message: OK} - request: body: null headers: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] + CommandName: [appservice web create] Connection: [keep-alive] Content-Type: [application/json; charset=utf-8] User-Agent: [python/3.5.3 (Windows-10-10.0.14393-SP0) requests/2.9.1 msrest/0.4.6 - msrest_azure/0.4.7 websitemanagementclient/0.31.0 Azure-SDK-For-Python AZURECLI/TEST/2.0.1+dev] + msrest_azure/0.4.7 websitemanagementclient/0.31.0 Azure-SDK-For-Python AZURECLI/2.0.1+dev] accept-language: [en-US] - x-ms-client-request-id: [50d28358-0b5e-11e7-98e5-64510658e3b3] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azurecli-webapp-simple/providers/Microsoft.Web/serverfarms/winplan?api-version=2016-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Web/serverfarms/winplan?api-version=2016-09-01 response: body: {string: '{"error":{"code":"ResourceNotFound","message":"The Resource ''Microsoft.Web/serverFarms/winplan'' - under resource group ''azurecli-webapp-simple'' was not found."}}'} + under resource group ''clitest.rg000001'' was not found."}}'} headers: - Cache-Control: [no-cache] - Content-Length: ['165'] - Content-Type: [application/json; charset=utf-8] - Date: ['Fri, 17 Mar 2017 22:08:56 GMT'] - Expires: ['-1'] - Pragma: [no-cache] - Strict-Transport-Security: [max-age=31536000; includeSubDomains] + cache-control: [no-cache] + content-length: ['211'] + content-type: [application/json; charset=utf-8] + date: ['Mon, 20 Mar 2017 18:10:34 GMT'] + expires: ['-1'] + pragma: [no-cache] + strict-transport-security: [max-age=31536000; includeSubDomains] x-ms-failure-cause: [gateway] status: {code: 404, message: Not Found} - request: - body: '{"sku": {"tier": "BASIC", "name": "B1", "capacity": 1}, "location": "westus", - "properties": {"perSiteScaling": false, "reserved": true, "name": "winplan"}}' + body: '{"location": "westus", "sku": {"tier": "BASIC", "capacity": 1, "name": + "B1"}, "properties": {"reserved": true, "perSiteScaling": false, "name": "winplan"}}' headers: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] + CommandName: [appservice web create] Connection: [keep-alive] Content-Length: ['155'] Content-Type: [application/json; charset=utf-8] User-Agent: [python/3.5.3 (Windows-10-10.0.14393-SP0) requests/2.9.1 msrest/0.4.6 - msrest_azure/0.4.7 websitemanagementclient/0.31.0 Azure-SDK-For-Python AZURECLI/TEST/2.0.1+dev] + msrest_azure/0.4.7 websitemanagementclient/0.31.0 Azure-SDK-For-Python AZURECLI/2.0.1+dev] accept-language: [en-US] - x-ms-client-request-id: [511917d0-0b5e-11e7-909b-64510658e3b3] method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azurecli-webapp-simple/providers/Microsoft.Web/serverfarms/winplan?api-version=2016-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Web/serverfarms/winplan?api-version=2016-09-01 response: - body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azurecli-webapp-simple/providers/Microsoft.Web/serverfarms/winplan","name":"winplan","type":"Microsoft.Web/serverfarms","kind":"linux","location":"West - US","tags":null,"properties":{"serverFarmId":0,"name":"winplan","workerSize":"Small","workerSizeId":0,"workerTierName":null,"numberOfWorkers":1,"currentWorkerSize":"Small","currentWorkerSizeId":0,"currentNumberOfWorkers":1,"status":"Ready","webSpace":"azurecli-webapp-simple-WestUSwebspace","subscription":"0b1f6471-1bf0-4dda-aec3-cb9272f09590","adminSiteName":null,"hostingEnvironment":null,"hostingEnvironmentProfile":null,"maximumNumberOfWorkers":3,"planName":"VirtualDedicatedPlan","adminRuntimeSiteName":null,"computeMode":"Shared","siteMode":null,"geoRegion":"West - US","perSiteScaling":false,"numberOfSites":0,"hostingEnvironmentId":null,"tags":null,"kind":"linux","resourceGroup":"azurecli-webapp-simple","reserved":true,"mdmId":"waws-prod-bay-063_2192","targetWorkerCount":0,"targetWorkerSizeId":0,"provisioningState":"Succeeded"},"sku":{"name":"B1","tier":"Basic","size":"B1","family":"B","capacity":1}}'} + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Web/serverfarms/winplan","name":"winplan","type":"Microsoft.Web/serverfarms","kind":"linux","location":"West + US","tags":null,"properties":{"serverFarmId":0,"name":"winplan","workerSize":"Small","workerSizeId":0,"workerTierName":null,"numberOfWorkers":1,"currentWorkerSize":"Small","currentWorkerSizeId":0,"currentNumberOfWorkers":1,"status":"Ready","webSpace":"clitest.rg000001-WestUSwebspace","subscription":"0b1f6471-1bf0-4dda-aec3-cb9272f09590","adminSiteName":null,"hostingEnvironment":null,"hostingEnvironmentProfile":null,"maximumNumberOfWorkers":3,"planName":"VirtualDedicatedPlan","adminRuntimeSiteName":null,"computeMode":"Shared","siteMode":null,"geoRegion":"West + US","perSiteScaling":false,"numberOfSites":0,"hostingEnvironmentId":null,"tags":null,"kind":"linux","resourceGroup":"clitest.rg000001","reserved":true,"mdmId":"waws-prod-bay-063_2241","targetWorkerCount":0,"targetWorkerSizeId":0,"provisioningState":"Succeeded"},"sku":{"name":"B1","tier":"Basic","size":"B1","family":"B","capacity":1}}'} headers: - Cache-Control: [no-cache] - Content-Type: [application/json] - Date: ['Fri, 17 Mar 2017 22:09:02 GMT'] - Expires: ['-1'] - Pragma: [no-cache] - Server: [Microsoft-IIS/8.0] - Strict-Transport-Security: [max-age=31536000; includeSubDomains] - Transfer-Encoding: [chunked] - Vary: [Accept-Encoding] - X-AspNet-Version: [4.0.30319] - X-Powered-By: [ASP.NET] - content-length: ['1156'] - x-ms-ratelimit-remaining-subscription-writes: ['1198'] + cache-control: [no-cache] + content-length: ['1294'] + content-type: [application/json] + date: ['Mon, 20 Mar 2017 18:10:39 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-aspnet-version: [4.0.30319] + x-ms-ratelimit-remaining-subscription-writes: ['1197'] + x-powered-by: [ASP.NET] status: {code: 200, message: OK} - request: - body: '{"location": "westus", "properties": {"microService": "false", "scmSiteAlsoStopped": - false, "reserved": false, "serverFarmId": "/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourceGroups/azurecli-webapp-simple/providers/Microsoft.Web/serverfarms/winplan"}}' + body: 'b''{"location": "westus", "properties": {"reserved": false, "scmSiteAlsoStopped": + false, "serverFarmId": "/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourceGroups/clitest.rg000001/providers/Microsoft.Web/serverfarms/winplan", + "microService": "false"}}''' headers: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] + CommandName: [appservice web create] Connection: [keep-alive] - Content-Length: ['270'] + Content-Length: ['316'] Content-Type: [application/json; charset=utf-8] User-Agent: [python/3.5.3 (Windows-10-10.0.14393-SP0) requests/2.9.1 msrest/0.4.6 - msrest_azure/0.4.7 websitemanagementclient/0.31.0 Azure-SDK-For-Python AZURECLI/TEST/2.0.1+dev] + msrest_azure/0.4.7 websitemanagementclient/0.31.0 Azure-SDK-For-Python AZURECLI/2.0.1+dev] accept-language: [en-US] - x-ms-client-request-id: [54ad3914-0b5e-11e7-889a-64510658e3b3] method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azurecli-webapp-simple/providers/Microsoft.Web/sites/cli-webapp-simple3?api-version=2016-08-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Web/sites/cli-webapp-simple3?api-version=2016-08-01 response: - body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azurecli-webapp-simple/providers/Microsoft.Web/sites/cli-webapp-simple3","name":"cli-webapp-simple3","type":"Microsoft.Web/sites","kind":"app","location":"westus","tags":null,"properties":{"name":"cli-webapp-simple3","state":"Running","hostNames":["cli-webapp-simple3.azurewebsites.net"],"webSpace":"azurecli-webapp-simple-WestUSwebspace","selfLink":"https://waws-prod-bay-063.api.azurewebsites.windows.net:454/subscriptions/00000000-0000-0000-0000-000000000000/webspaces/azurecli-webapp-simple-WestUSwebspace/sites/cli-webapp-simple3","repositorySiteName":"cli-webapp-simple3","owner":null,"usageState":"Normal","enabled":true,"adminEnabled":true,"enabledHostNames":["cli-webapp-simple3.azurewebsites.net","cli-webapp-simple3.scm.azurewebsites.net"],"siteProperties":{"metadata":null,"properties":[],"appSettings":null},"availabilityState":"Normal","sslCertificates":null,"csrs":[],"cers":null,"siteMode":null,"hostNameSslStates":[{"name":"cli-webapp-simple3.azurewebsites.net","sslState":"Disabled","ipBasedSslResult":null,"virtualIP":null,"thumbprint":null,"toUpdate":null,"toUpdateIpBasedSsl":null,"ipBasedSslState":"NotConfigured","hostType":"Standard"},{"name":"cli-webapp-simple3.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/azurecli-webapp-simple/providers/Microsoft.Web/serverfarms/winplan","reserved":true,"lastModifiedTimeUtc":"2017-03-17T22:09:04.8733333","storageRecoveryDefaultState":"Running","contentAvailabilityState":"Normal","runtimeAvailabilityState":"Normal","siteConfig":null,"deploymentId":"cli-webapp-simple3","trafficManagerHostNames":null,"sku":"Basic","premiumAppDeployed":null,"scmSiteAlsoStopped":false,"targetSwapSlot":null,"hostingEnvironment":null,"hostingEnvironmentProfile":null,"microService":"false","gatewaySiteName":null,"clientAffinityEnabled":true,"clientCertEnabled":false,"hostNamesDisabled":false,"domainVerificationIdentifiers":null,"kind":"app","outboundIpAddresses":"13.93.220.109,13.64.108.119,13.64.198.87,13.64.192.142,13.64.109.132","containerSize":0,"dailyMemoryTimeQuota":0,"suspendedTill":null,"siteDisabledReason":0,"functionExecutionUnitsCache":null,"maxNumberOfWorkers":null,"homeStamp":"waws-prod-bay-063","cloningInfo":null,"hostingEnvironmentId":null,"tags":null,"resourceGroup":"azurecli-webapp-simple","defaultHostName":"cli-webapp-simple3.azurewebsites.net","slotSwapStatus":null}}'} + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Web/sites/cli-webapp-simple3","name":"cli-webapp-simple3","type":"Microsoft.Web/sites","kind":"app","location":"westus","tags":null,"properties":{"name":"cli-webapp-simple3","state":"Running","hostNames":["cli-webapp-simple3.azurewebsites.net"],"webSpace":"clitest.rg000001-WestUSwebspace","selfLink":"https://waws-prod-bay-063.api.azurewebsites.windows.net:454/subscriptions/00000000-0000-0000-0000-000000000000/webspaces/clitest.rg000001-WestUSwebspace/sites/cli-webapp-simple3","repositorySiteName":"cli-webapp-simple3","owner":null,"usageState":"Normal","enabled":true,"adminEnabled":true,"enabledHostNames":["cli-webapp-simple3.azurewebsites.net","cli-webapp-simple3.scm.azurewebsites.net"],"siteProperties":{"metadata":null,"properties":[],"appSettings":null},"availabilityState":"Normal","sslCertificates":null,"csrs":[],"cers":null,"siteMode":null,"hostNameSslStates":[{"name":"cli-webapp-simple3.azurewebsites.net","sslState":"Disabled","ipBasedSslResult":null,"virtualIP":null,"thumbprint":null,"toUpdate":null,"toUpdateIpBasedSsl":null,"ipBasedSslState":"NotConfigured","hostType":"Standard"},{"name":"cli-webapp-simple3.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/winplan","reserved":true,"lastModifiedTimeUtc":"2017-03-20T18:10:42.93","storageRecoveryDefaultState":"Running","contentAvailabilityState":"Normal","runtimeAvailabilityState":"Normal","siteConfig":null,"deploymentId":"cli-webapp-simple3","trafficManagerHostNames":null,"sku":"Basic","premiumAppDeployed":null,"scmSiteAlsoStopped":false,"targetSwapSlot":null,"hostingEnvironment":null,"hostingEnvironmentProfile":null,"microService":"false","gatewaySiteName":null,"clientAffinityEnabled":true,"clientCertEnabled":false,"hostNamesDisabled":false,"domainVerificationIdentifiers":null,"kind":"app","outboundIpAddresses":"13.93.220.109,13.64.108.119,13.64.198.87,13.64.192.142,13.64.109.132","containerSize":0,"dailyMemoryTimeQuota":0,"suspendedTill":null,"siteDisabledReason":0,"functionExecutionUnitsCache":null,"maxNumberOfWorkers":null,"homeStamp":"waws-prod-bay-063","cloningInfo":null,"hostingEnvironmentId":null,"tags":null,"resourceGroup":"clitest.rg000001","defaultHostName":"cli-webapp-simple3.azurewebsites.net","slotSwapStatus":null}}'} headers: - Cache-Control: [no-cache] - Content-Type: [application/json] - Date: ['Fri, 17 Mar 2017 22:09:15 GMT'] - ETag: ['"1D29F6B176C756B"'] - Expires: ['-1'] - Pragma: [no-cache] - Server: [Microsoft-IIS/8.0] - Strict-Transport-Security: [max-age=31536000; includeSubDomains] - Transfer-Encoding: [chunked] - Vary: [Accept-Encoding] - X-AspNet-Version: [4.0.30319] - X-Powered-By: [ASP.NET] - content-length: ['2728'] - x-ms-ratelimit-remaining-subscription-writes: ['1197'] + cache-control: [no-cache] + content-length: ['2953'] + content-type: [application/json] + date: ['Mon, 20 Mar 2017 18:10:50 GMT'] + etag: ['"1D2A1A54A09D5C0"'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-aspnet-version: [4.0.30319] + x-ms-ratelimit-remaining-subscription-writes: ['1198'] + x-powered-by: [ASP.NET] status: {code: 200, message: OK} - request: body: null headers: Accept: [application/json] Accept-Encoding: ['gzip, deflate'] + CommandName: [resource list] Connection: [keep-alive] Content-Type: [application/json; charset=utf-8] User-Agent: [python/3.5.3 (Windows-10-10.0.14393-SP0) requests/2.9.1 msrest/0.4.6 msrest_azure/0.4.7 resourcemanagementclient/0.30.2 Azure-SDK-For-Python - AZURECLI/TEST/2.0.1+dev] + AZURECLI/2.0.1+dev] accept-language: [en-US] - x-ms-client-request-id: [5ca882de-0b5e-11e7-9291-64510658e3b3] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resources?$filter=resourceGroup%20eq%20%27azurecli-webapp-simple%27&api-version=2016-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resources?$filter=resourceGroup%20eq%20%27clitest.rg000001%27&api-version=2016-09-01 response: - body: {string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azurecli-webapp-simple/providers/Microsoft.Web/serverFarms/cli-webapp-simple_plan","name":"cli-webapp-simple_plan","type":"Microsoft.Web/serverFarms","sku":{"name":"S1","tier":"Standard","size":"S1","family":"S","capacity":1},"kind":"linux","location":"westus"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azurecli-webapp-simple/providers/Microsoft.Web/serverFarms/winplan","name":"winplan","type":"Microsoft.Web/serverFarms","sku":{"name":"B1","tier":"Basic","size":"B1","family":"B","capacity":1},"kind":"linux","location":"westus"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azurecli-webapp-simple/providers/Microsoft.Web/sites/cli-webapp-simple","name":"cli-webapp-simple","type":"Microsoft.Web/sites","kind":"app","location":"westus"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azurecli-webapp-simple/providers/Microsoft.Web/sites/cli-webapp-simple2","name":"cli-webapp-simple2","type":"Microsoft.Web/sites","kind":"app","location":"westus"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azurecli-webapp-simple/providers/Microsoft.Web/sites/cli-webapp-simple3","name":"cli-webapp-simple3","type":"Microsoft.Web/sites","kind":"app","location":"westus"}]}'} + body: {string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Web/serverFarms/cli-webapp-simple_plan","name":"cli-webapp-simple_plan","type":"Microsoft.Web/serverFarms","sku":{"name":"S1","tier":"Standard","size":"S1","family":"S","capacity":1},"kind":"linux","location":"westus"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Web/serverFarms/winplan","name":"winplan","type":"Microsoft.Web/serverFarms","sku":{"name":"B1","tier":"Basic","size":"B1","family":"B","capacity":1},"kind":"linux","location":"westus"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Web/sites/cli-webapp-simple","name":"cli-webapp-simple","type":"Microsoft.Web/sites","kind":"app","location":"westus"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Web/sites/cli-webapp-simple2","name":"cli-webapp-simple2","type":"Microsoft.Web/sites","kind":"app","location":"westus"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Web/sites/cli-webapp-simple3","name":"cli-webapp-simple3","type":"Microsoft.Web/sites","kind":"app","location":"westus"}]}'} headers: - Cache-Control: [no-cache] - Content-Type: [application/json; charset=utf-8] - Date: ['Fri, 17 Mar 2017 22:09:16 GMT'] - Expires: ['-1'] - Pragma: [no-cache] - Strict-Transport-Security: [max-age=31536000; includeSubDomains] - Vary: [Accept-Encoding] - content-length: ['1392'] + cache-control: [no-cache] + content-length: ['1622'] + content-type: [application/json; charset=utf-8] + date: ['Mon, 20 Mar 2017 18:10:52 GMT'] + expires: ['-1'] + pragma: [no-cache] + strict-transport-security: [max-age=31536000; includeSubDomains] + vary: [Accept-Encoding] 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] + User-Agent: [python/3.5.3 (Windows-10-10.0.14393-SP0) requests/2.9.1 msrest/0.4.6 + msrest_azure/0.4.7 resourcemanagementclient/0.30.2 Azure-SDK-For-Python + AZURECLI/2.0.1+dev] + accept-language: [en-US] + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001?api-version=2016-09-01 + response: + body: {string: ''} + headers: + cache-control: [no-cache] + content-length: ['0'] + date: ['Mon, 20 Mar 2017 18:10:53 GMT'] + expires: ['-1'] + location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DTElURVNUOjJFUkdCNDdGRURCN0NGOEEzNjEzNTIyRTU5ODg3RUVCRUQ1NDg3RXxGRkU0RURDMDBCRkYxRUVBLVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?api-version=2016-09-01'] + pragma: [no-cache] + retry-after: ['15'] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-ms-ratelimit-remaining-subscription-writes: ['1197'] + status: {code: 202, message: Accepted} version: 1 diff --git a/src/command_modules/azure-cli-appservice/tests/test_webapp_commands.py b/src/command_modules/azure-cli-appservice/tests/test_webapp_commands.py index e61a029acfe..4a33906ebd9 100644 --- a/src/command_modules/azure-cli-appservice/tests/test_webapp_commands.py +++ b/src/command_modules/azure-cli-appservice/tests/test_webapp_commands.py @@ -4,6 +4,8 @@ # -------------------------------------------------------------------------------------------- import os +from azure.cli.testsdk import ScenarioTest, ResourceGroupPreparer +from azure.cli.testsdk import JMESPathCheck as JMESPathCheckV2 from azure.cli.core.test_utils.vcr_test_base import (ResourceGroupVCRTestBase, JMESPathCheck, NoneCheck) @@ -97,44 +99,40 @@ def body(self): JMESPathCheck('length(@)', 0) ]) -class WebappSimpleCreateTest(ResourceGroupVCRTestBase): - def __init__(self, test_method): - super(WebappSimpleCreateTest, self).__init__(__file__, test_method, resource_group='azurecli-webapp-simple') - - def test_webapp_simple_create(self): - self.execute() +class WebappSimpleCreateTest(ScenarioTest): - def body(self): + @ResourceGroupPreparer() + def test_webapp_simple_create(self, resource_group): webapp_name = 'cli-webapp-simple' webapp_name2 = 'cli-webapp-simple2' webapp_name3 = 'cli-webapp-simple3' # create web 1 - result = self.cmd('appservice web create -g {} -n {} --is-linux'.format(self.resource_group, webapp_name)) + result = self.cmd('appservice web create -g {} -n {} --is-linux'.format(resource_group, webapp_name)).get_output_in_json() self.assertEqual(webapp_name, result['name']) self.assertTrue(result['serverFarmId'].endswith('/' + webapp_name + '_plan')) # create web 2 - result = self.cmd('appservice web create -g {} -n {} --is-linux'.format(self.resource_group, webapp_name2)) + result = self.cmd('appservice web create -g {} -n {} --is-linux'.format(resource_group, webapp_name2)).get_output_in_json() self.assertEqual(webapp_name2, result['name']) self.assertTrue(result['serverFarmId'].endswith('/' + webapp_name + '_plan')) # verify we reuse the plan for second web - self.cmd('resource list -g {}'.format(self.resource_group), checks=[ - JMESPathCheck('length([])', 3), - JMESPathCheck("length([?name=='{}_plan'])".format(webapp_name), 1) + self.cmd('resource list -g {}'.format(resource_group), checks=[ + JMESPathCheckV2('length([])', 3), + JMESPathCheckV2("length([?name=='{}_plan'])".format(webapp_name), 1) ]) # create web 3 which explictly calls out the plan name - result = self.cmd('appservice web create -g {} -n {} --plan winplan --is-linux --sku b1'.format(self.resource_group, webapp_name3)) + result = self.cmd('appservice web create -g {} -n {} --plan winplan --is-linux --sku b1'.format(resource_group, webapp_name3)).get_output_in_json() self.assertEqual(webapp_name3, result['name']) self.assertTrue(result['serverFarmId'].endswith('/winplan')) # verify we create a new plan - self.cmd('resource list -g {}'.format(self.resource_group), checks=[ - JMESPathCheck('length([])', 5), - JMESPathCheck("length([?name=='winplan'])".format(webapp_name), 1) + self.cmd('resource list -g {}'.format(resource_group), checks=[ + JMESPathCheckV2('length([])', 5), + JMESPathCheckV2("length([?name=='winplan'])".format(webapp_name), 1) ])