Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,8 @@ def load_arguments(self, _):
local_context_attribute=LocalContextAttribute(name='plan_name', actions=[LocalContextAction.GET]))
c.argument('vnet', help="Name or resource ID of the regional virtual network. If there are multiple vnets of the same name across different resource groups, use vnet resource id to specify which vnet to use. If vnet name is used, by default, the vnet in the same resource group as the webapp will be used. Must be used with --subnet argument.")
c.argument('subnet', help="Name or resource ID of the pre-existing subnet to have the webapp join. The --vnet is argument also needed if specifying subnet by name.")
c.argument('https_only', help="Redirect all traffic made to an app using HTTP to HTTPS.",
arg_type=get_three_state_flag(return_label=True))
c.ignore('language')
c.ignore('using_webapp_up')

Expand Down Expand Up @@ -715,9 +717,7 @@ def load_arguments(self, _):
help="name or resource id of the {} app service plan. Use 'appservice plan create' to get one. If using an App Service plan from a different resource group, the full resource id must be used and not the plan name.".format(scope),
local_context_attribute=LocalContextAttribute(name='plan_name', actions=[LocalContextAction.GET]))
c.argument('name', options_list=['--name', '-n'], help='name of the new {} app'.format(app_type),
local_context_attribute=LocalContextAttribute(name=scope + '_name',
actions=[LocalContextAction.SET],
scopes=[scope]))
local_context_attribute=LocalContextAttribute(name=scope + '_name', actions=[LocalContextAction.SET], scopes=[scope]))
c.argument('storage_account', options_list=['--storage-account', '-s'],
help='Provide a string value of a Storage Account in the provided Resource Group. Or Resource ID of a Storage Account in a different Resource Group',
local_context_attribute=LocalContextAttribute(name='storage_account_name', actions=[LocalContextAction.GET]))
Expand Down Expand Up @@ -871,8 +871,7 @@ def load_arguments(self, _):
c.argument('ignore_missing_vnet_service_endpoint',
options_list=['--ignore-missing-endpoint', '-i'],
help='Create access restriction rule with checking if the subnet has Microsoft.Web service endpoint enabled',
arg_type=get_three_state_flag(),
default=False)
arg_type=get_three_state_flag(), default=False)
c.argument('scm_site', help='True if access restrictions is added for scm site',
arg_type=get_three_state_flag())
c.argument('vnet_resource_group', help='Resource group of virtual network (default is web app resource group)')
Expand Down
11 changes: 7 additions & 4 deletions src/azure-cli/azure/cli/command_modules/appservice/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def create_webapp(cmd, resource_group_name, name, plan, runtime=None, startup_fi
deployment_local_git=None, docker_registry_server_password=None, docker_registry_server_user=None,
multicontainer_config_type=None, multicontainer_config_file=None, tags=None,
using_webapp_up=False, language=None, assign_identities=None,
role='Contributor', scope=None, vnet=None, subnet=None):
role='Contributor', scope=None, vnet=None, subnet=None, https_only=False):
from azure.mgmt.web.models import Site
SiteConfig, SkuDescription, NameValuePair = cmd.get_models(
'SiteConfig', 'SkuDescription', 'NameValuePair')
Expand Down Expand Up @@ -157,8 +157,11 @@ def create_webapp(cmd, resource_group_name, name, plan, runtime=None, startup_fi
else:
subnet_resource_id = None

if using_webapp_up:
https_only = using_webapp_up

webapp_def = Site(location=location, site_config=site_config, server_farm_id=plan_info.id, tags=tags,
https_only=using_webapp_up, virtual_network_subnet_id=subnet_resource_id)
https_only=https_only, virtual_network_subnet_id=subnet_resource_id)
if runtime:
runtime = helper.remove_delimiters(runtime)

Expand Down Expand Up @@ -867,8 +870,8 @@ def list_function_app(cmd, resource_group_name=None):
def _show_app(cmd, resource_group_name, name, cmd_app_type, slot=None):
app = _generic_site_operation(cmd.cli_ctx, resource_group_name, name, 'get', slot)
if not app:
raise ResourceNotFoundError("Unable to find {} '{}', in RG '{}'.".format(
cmd_app_type, name, resource_group_name))
raise ResourceNotFoundError("Unable to find {} '{}', in RG '{}'."
.format(cmd_app_type, name, resource_group_name))
app_type = _kind_to_app_type(app.kind) if app else None
if app_type != cmd_app_type:
raise ResourceNotFoundError(
Expand Down
Loading