@@ -4979,12 +4979,18 @@ def is_async_response(poller, timeout_seconds=30):
49794979 return status_code == 202
49804980
49814981
4982- def create_app_service_plan(cmd, resource_group_name, name, is_linux, hyper_v, per_site_scaling=False,
4982+ def create_app_service_plan(cmd, resource_group_name, name, is_linux, hyper_v, per_site_scaling=False, # pylint: disable=too-many-branches
49834983 app_service_environment=None, sku=None, number_of_workers=None, location=None,
49844984 tags=None, no_wait=False, zone_redundant=False, async_scaling_enabled=None,
49854985 is_managed_instance=None, mi_system_assigned=None, mi_user_assigned=None,
49864986 default_identity=None, rdp_enabled=None, vnet=None, subnet=None,
49874987 registry_adapters=None, install_scripts=None, storage_mounts=None):
4988+ if is_linux is None:
4989+ is_linux = not hyper_v
4990+ elif is_linux and hyper_v:
4991+ raise MutuallyExclusiveArgumentError('--hyper-v creates a Windows container plan and cannot be combined '
4992+ 'with --is-linux true. Omit --is-linux or use "--is-linux false".')
4993+
49884994 if sku is None:
49894995 sku = 'P0V3' if is_linux else 'B1'
49904996
@@ -5073,6 +5079,9 @@ def pre_operations(self):
50735079 args = self.ctx.args
50745080 args.no_wait = no_wait
50755081
5082+ os_type = 'Linux' if is_linux else ('Hyper-V' if hyper_v else 'Windows')
5083+ logger.warning("Creating App Service Plan '%s' (%s, SKU: %s).", name, os_type, sku)
5084+
50765085 poller = AppServicePlanCreateWithNoWait(cli_ctx=cmd.cli_ctx)(command_args={
50775086 "name": name,
50785087 "resource_group": resource_group_name,
@@ -5098,9 +5107,6 @@ def pre_operations(self):
50985107 "storage_mounts": storage_mounts,
50995108 })
51005109
5101- os_type = 'Linux' if is_linux else ('Hyper-V' if hyper_v else 'Windows')
5102- logger.warning("Creating App Service Plan '%s' (%s).", name, os_type)
5103-
51045110 if no_wait:
51055111 return poller.result()
51065112
0 commit comments