Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing appservice list-locations #4846

Merged
merged 3 commits into from
Nov 8, 2017
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/command_modules/azure-cli-appservice/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
++++++
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down Expand Up @@ -1556,7 +1558,16 @@ 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)
regions = client.list_geo_regions(full_sku, linux_workers_enabled)
for x in regions:
x.name = x.name.lower().replace(' ', '')
return regions.current_page


def enable_zip_deploy(resource_group_name, name, src, slot=None):
Expand Down