Skip to content

Commit

Permalink
webapp: fix a bug in deleting a slot (Azure#6222)
Browse files Browse the repository at this point in the history
* webapp: fix a bug in deleting a slot

* update history
  • Loading branch information
yugangw-msft authored and williexu committed Apr 25, 2018
1 parent f06fd5d commit 979854e
Show file tree
Hide file tree
Showing 4 changed files with 429 additions and 605 deletions.
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 @@ -4,6 +4,7 @@ Release History
===============
0.1.32
++++++
* webapp: fix a bug in `az webapp delete` when `--slot` is provided
* webapp: remove `--runtime-version` from `az webapp auth update` as it's not very public ready
* webapp: az webapp config set support for min_tls_version & https2.0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -325,11 +325,16 @@ def delete_function_app(cmd, resource_group_name, name, slot=None):
def delete_webapp(cmd, resource_group_name, name, keep_metrics=None, keep_empty_plan=None,
keep_dns_registration=None, slot=None):
client = web_client_factory(cmd.cli_ctx)
delete_method = getattr(client.web_apps, 'delete' if slot is None else 'delete_slot')
delete_method(resource_group_name, name,
delete_metrics=False if keep_metrics else None,
delete_empty_server_farm=False if keep_empty_plan else None,
skip_dns_registration=False if keep_dns_registration else None)
if slot:
client.web_apps.delete_slot(resource_group_name, name, slot,
delete_metrics=False if keep_metrics else None,
delete_empty_server_farm=False if keep_empty_plan else None,
skip_dns_registration=False if keep_dns_registration else None)
else:
client.web_apps.delete(resource_group_name, name,
delete_metrics=False if keep_metrics else None,
delete_empty_server_farm=False if keep_empty_plan else None,
skip_dns_registration=False if keep_dns_registration else None)


def stop_webapp(cmd, resource_group_name, name, slot=None):
Expand Down
Loading

0 comments on commit 979854e

Please sign in to comment.