Skip to content
Closed
Show file tree
Hide file tree
Changes from all 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
14 changes: 9 additions & 5 deletions src/azure-cli-core/azure/cli/core/profiles/_shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ def __init__(self, import_prefix, client_name):
class ResourceType(Enum): # pylint: disable=too-few-public-methods

MGMT_APIMANAGEMENT = ('azure.mgmt.apimanagement', 'ApiManagementClient')
MGMT_APPSERVICE = ('azure.mgmt.web', 'WebSiteManagementClient')
MGMT_KUSTO = ('azure.mgmt.kusto', 'KustoManagementClient')
MGMT_KEYVAULT = ('azure.mgmt.keyvault', 'KeyVaultManagementClient')
MGMT_STORAGE = ('azure.mgmt.storage', 'StorageManagementClient')
Expand Down Expand Up @@ -90,7 +91,6 @@ class ResourceType(Enum): # pylint: disable=too-few-public-methods
MGMT_SQLVM = ('azure.mgmt.sqlvirtualmachine', None)
MGMT_MANAGEDSERVICES = ('azure.mgmt.managedservices', None)
MGMT_NETAPPFILES = ('azure.mgmt.netappfiles', None)
MGMT_APPSERVICE = ('azure.mgmt.web', None)

def __init__(self, import_prefix, client_name):
"""Constructor.
Expand Down Expand Up @@ -174,7 +174,8 @@ def default_api_version(self):
'service_diagnostic_settings': '2016-09-01',
'tenant_activity_logs': '2015-04-01',
'vm_insights': '2018-11-27-preview'
})
}),
ResourceType.MGMT_APPSERVICE: '2019-08-01'
},
'2019-03-01-hybrid': {
ResourceType.MGMT_STORAGE: '2017-10-01',
Expand All @@ -198,7 +199,8 @@ def default_api_version(self):
}),
ResourceType.DATA_KEYVAULT: '2016-10-01',
ResourceType.DATA_STORAGE: '2017-11-09',
ResourceType.DATA_COSMOS_TABLE: '2017-04-17'
ResourceType.DATA_COSMOS_TABLE: '2017-04-17',
ResourceType.MGMT_APPSERVICE: '2018-02-01'
},
'2018-03-01-hybrid': {
ResourceType.MGMT_STORAGE: '2016-01-01',
Expand All @@ -216,7 +218,8 @@ def default_api_version(self):
}),
ResourceType.DATA_KEYVAULT: '2016-10-01',
ResourceType.DATA_STORAGE: '2017-04-17',
ResourceType.DATA_COSMOS_TABLE: '2017-04-17'
ResourceType.DATA_COSMOS_TABLE: '2017-04-17',
ResourceType.MGMT_APPSERVICE: '2018-02-01'
},
'2017-03-09-profile': {
ResourceType.MGMT_STORAGE: '2016-01-01',
Expand All @@ -233,7 +236,8 @@ def default_api_version(self):
'classic_administrators': '2015-06-01'
}),
ResourceType.DATA_KEYVAULT: '2016-10-01',
ResourceType.DATA_STORAGE: '2015-04-05'
ResourceType.DATA_STORAGE: '2015-04-05',
ResourceType.MGMT_APPSERVICE: '2018-02-01'
}
}

Expand Down
6 changes: 6 additions & 0 deletions src/azure-cli/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
Release History
===============

**AppService**

** Updating AppService to use the latest azure-mgt-web SDK version 0.44.0


2.0.80
++++++

Expand All @@ -16,6 +21,7 @@ Release History
* Upgrade azure-mgmt-storage version to 7.1.0
* `az storage account create`: Add `--encryption-key-type-for-table` and `--encryption-key-type-for-queue` to support Table and Queue Encryption Service


2.0.79
++++++

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ def _polish_bad_errors(ex):


def web_client_factory(cli_ctx, **_):
from azure.mgmt.web import WebSiteManagementClient
from azure.cli.core.profiles import ResourceType
from azure.cli.core.commands.client_factory import get_mgmt_service_client
return get_mgmt_service_client(cli_ctx, WebSiteManagementClient)
return get_mgmt_service_client(cli_ctx, ResourceType.MGMT_APPSERVICE)


def cf_plans(cli_ctx, _):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,9 +231,9 @@ def load_arguments(self, _):
c.argument('windows_fx_version', help="A docker image name used for your windows container web app, e.g., microsoft/nanoserver:ltsc2016", is_preview=True)
if scope == 'functionapp':
c.ignore('windows_fx_version')
c.argument('reserved_instance_count', options_list=['--prewarmed-instance-count'], help="Number of pre-warmed instances a function app has")
c.argument('pre_warmed_instance_count', options_list=['--prewarmed-instance-count'], help="Number of pre-warmed instances a function app has")
if scope == 'webapp':
c.ignore('reserved_instance_count')
c.ignore('pre_warmed_instance_count')
c.argument('java_version', help="The version used to run your web app if using Java, e.g., '1.7' for Java 7, '1.8' for Java 8")
c.argument('java_container', help="The java container, e.g., Tomcat, Jetty")
c.argument('java_container_version', help="The version of the java container, e.g., '8.0.23' for Tomcat")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def _polish_bad_errors(ex):
# pylint: disable=too-many-statements
def load_command_table(self, _):
webclient_sdk = CliCommandType(
operations_tmpl='azure.mgmt.web.web_site_management_client#WebSiteManagementClient.{}',
operations_tmpl='azure.mgmt.web.operations#WebSiteManagementClientOperationsMixin.{}',
client_factory=cf_web_client
)
appservice_plan_sdk = CliCommandType(
Expand Down
11 changes: 6 additions & 5 deletions src/azure-cli/azure/cli/command_modules/appservice/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -850,7 +850,8 @@ def _get_linux_multicontainer_encoded_config_from_file(file_name):
# for any modifications to the non-optional parameters, adjust the reflection logic accordingly
# in the method
def update_site_configs(cmd, resource_group_name, name, slot=None, number_of_workers=None,
linux_fx_version=None, windows_fx_version=None, reserved_instance_count=None, php_version=None, # pylint: disable=unused-argument
linux_fx_version=None, windows_fx_version=None, # pylint: disable=unused-argument
pre_warmed_instance_count=None, php_version=None, # pylint: disable=unused-argument
python_version=None, net_framework_version=None, # pylint: disable=unused-argument
java_version=None, java_container=None, java_container_version=None, # pylint: disable=unused-argument
remote_debugging_enabled=None, web_sockets_enabled=None, # pylint: disable=unused-argument
Expand All @@ -870,14 +871,14 @@ def update_site_configs(cmd, resource_group_name, name, slot=None, number_of_wor
else:
delete_app_settings(cmd, resource_group_name, name, ["WEBSITES_ENABLE_APP_SERVICE_STORAGE"])

if reserved_instance_count is not None:
reserved_instance_count = validate_range_of_int_flag('--prewarmed-instance-count', reserved_instance_count,
min_val=0, max_val=20)
if pre_warmed_instance_count is not None:
pre_warmed_instance_count = validate_range_of_int_flag('--prewarmed-instance-count', pre_warmed_instance_count,
min_val=0, max_val=20)
import inspect
frame = inspect.currentframe()
bool_flags = ['remote_debugging_enabled', 'web_sockets_enabled', 'always_on',
'auto_heal_enabled', 'use32_bit_worker_process', 'http20_enabled']
int_flags = ['reserved_instance_count', 'number_of_workers']
int_flags = ['pre_warmed_instance_count', 'number_of_workers']
# note: getargvalues is used already in azure.cli.core.commands.
# and no simple functional replacement for this deprecating method for 3.5
args, _, _, values = inspect.getargvalues(frame) # pylint: disable=deprecated-method
Expand Down
Loading