diff --git a/src/command_modules/azure-cli-appservice/HISTORY.rst b/src/command_modules/azure-cli-appservice/HISTORY.rst index 8b98de85aae..f7211c503d8 100644 --- a/src/command_modules/azure-cli-appservice/HISTORY.rst +++ b/src/command_modules/azure-cli-appservice/HISTORY.rst @@ -10,6 +10,7 @@ Release History * webapp: removing the 'storage' option from --web-server-logging since this is not working * `deployment user set`: logged more informative error messages. * functionapp: add support for creating Linux function apps +* appservice: fix list-locations 0.1.19 ++++++ diff --git a/src/command_modules/azure-cli-appservice/azure/cli/command_modules/appservice/commands.py b/src/command_modules/azure-cli-appservice/azure/cli/command_modules/appservice/commands.py index fe332b5f5a3..43eed737b01 100644 --- a/src/command_modules/azure-cli-appservice/azure/cli/command_modules/appservice/commands.py +++ b/src/command_modules/azure-cli-appservice/azure/cli/command_modules/appservice/commands.py @@ -154,8 +154,7 @@ def _polish_bad_errors(ex): 'azure.mgmt.web.operations.app_service_plans_operations#AppServicePlansOperations.create_or_update', custom_function_op=custom_path + 'update_app_service_plan', setter_arg_name='app_service_plan', factory=cf_plans) - cli_command(__name__, 'appservice list-locations', 'azure.mgmt.web.web_site_management_client#WebSiteManagementClient.list_geo_regions', cf_web_client, transform=transform_list_location_output) - + cli_command(__name__, 'appservice list-locations', custom_path + 'list_locations', transform=transform_list_location_output) cli_command(__name__, 'functionapp create', custom_path + 'create_function') cli_command(__name__, 'functionapp list', custom_path + 'list_function_app', table_transformer=transform_web_list_output) cli_command(__name__, 'functionapp show', custom_path + 'show_webapp', exception_handler=empty_on_404, table_transformer=transform_web_output) 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 f14e098c1d9..0cce69aa672 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 @@ -908,8 +908,10 @@ def _get_sku_name(tier): return 'BASIC' elif tier in ['S1', 'S2', 'S3']: return 'STANDARD' - elif tier in ['P1', 'P2', 'P3', 'P1V2', 'P2V2', 'P3V2']: + elif tier in ['P1', 'P2', 'P3']: return 'PREMIUM' + elif tier in ['P1V2', 'P2V2', 'P3V2']: + return 'PREMIUMV2' else: raise CLIError("Invalid sku(pricing tier), please refer to command help for valid values") @@ -1556,7 +1558,13 @@ def _validate_and_get_connection_string(resource_group_name, storage_account): def list_consumption_locations(): client = web_client_factory() regions = client.list_geo_regions(sku='Dynamic') - return [{'name': x.name.lower().replace(" ", "")} for x in regions] + return [{'name': x.name.lower().replace(' ', '')} for x in regions] + + +def list_locations(sku, linux_workers_enabled=None): + client = web_client_factory() + full_sku = _get_sku_name(sku) + return client.list_geo_regions(full_sku, linux_workers_enabled) def enable_zip_deploy(resource_group_name, name, src, slot=None):