Skip to content
Open
Show file tree
Hide file tree
Changes from 3 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
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,9 @@ def load_arguments(self, _):
subscription than the app service environment, please use the resource ID for --app-service-environment parameter. ",
local_context_attribute=LocalContextAttribute(name='ase_name', actions=[LocalContextAction.GET]))
c.argument('sku', arg_type=sku_arg_type)
c.argument('is_linux', action='store_true', required=False, help='host web app on Linux worker')
c.argument('is_linux', arg_type=get_three_state_flag(), default=None, required=False,
help='Host web app on Linux worker. Defaults to true unless --hyper-v is specified. '
'Use "--is-linux false" to create a Windows plan.')
c.argument('hyper_v', action='store_true', required=False, help='Host Windows Container Web App on Hyper-V worker.')
c.argument('per_site_scaling', action='store_true', required=False, help='Enable per-app scaling at the '
'App Service plan level to allow for '
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,12 @@ def _validate_asp_sku(sku, app_service_environment, zone_redundant):

def validate_asp_create(namespace):
validate_tags(namespace)
# is_linux is None when not explicitly provided by the user (default).
# Resolve the default: Linux unless --hyper-v is specified.
if namespace.is_linux is None:
namespace.is_linux = not namespace.hyper_v
elif namespace.is_linux and namespace.hyper_v:
raise MutuallyExclusiveArgumentError('Usage error: --is-linux true and --hyper-v cannot be used together.')
if namespace.sku is None:
if namespace.is_linux:
namespace.sku = 'P0V3'
Expand All @@ -120,8 +126,6 @@ def validate_asp_create(namespace):
namespace.sku = 'B1'
sku = _normalize_sku(namespace.sku)
_validate_asp_sku(sku, namespace.app_service_environment, namespace.zone_redundant)
if namespace.is_linux and namespace.hyper_v:
raise MutuallyExclusiveArgumentError('Usage error: --is-linux and --hyper-v cannot be used together.')


def validate_functionapp_asp_create(namespace):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@
retryable_method,
raise_missing_token_suggestion,
_get_location_from_resource_group,
_list_app,
is_functionapp,
is_linux_webapp,
_rename_server_farm_props,
Expand Down Expand Up @@ -4921,6 +4920,13 @@ def create_app_service_plan(cmd, resource_group_name, name, is_linux, hyper_v, p
is_managed_instance=None, mi_system_assigned=None, mi_user_assigned=None,
default_identity=None, rdp_enabled=None, vnet=None, subnet=None,
registry_adapters=None, install_scripts=None, storage_mounts=None):
if is_linux is None:
is_linux = not hyper_v
elif is_linux and hyper_v:
raise MutuallyExclusiveArgumentError('--hyper-v creates a Windows container plan and cannot be combined '
Comment thread
Shi1810 marked this conversation as resolved.
'with --is-linux. Use "--is-linux false --hyper-v" to create a '
'Windows container plan.')

if sku is None:
sku = 'P0V3' if is_linux else 'B1'
Comment thread
Shi1810 marked this conversation as resolved.

Expand Down
Loading