Skip to content

Commit 6023a41

Browse files
authored
[App Service] az webapp create: Add --domain-name-scope parameter to support DNL scopes during site creation (#31863)
1 parent 13a94a6 commit 6023a41

4 files changed

Lines changed: 857 additions & 3 deletions

File tree

src/azure-cli/azure/cli/command_modules/appservice/_params.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
get_three_state_flag, get_enum_type, tags_type)
1313
from azure.cli.core.local_context import LocalContextAttribute, LocalContextAction
1414
from azure.cli.command_modules.appservice._appservice_utils import MSI_LOCAL_ID
15-
from azure.mgmt.web.models import DatabaseType, ConnectionStringType, BuiltInAuthenticationProvider, AzureStorageType
15+
from azure.mgmt.web.models import (DatabaseType, ConnectionStringType, BuiltInAuthenticationProvider,
16+
AzureStorageType, AutoGeneratedDomainNameLabelScope)
1617

1718
from ._completers import get_hostname_completion_list
1819
from ._constants import (FUNCTIONS_VERSIONS, LOGICAPPS_NODE_RUNTIME_VERSIONS, WINDOWS_OS_NAME, LINUX_OS_NAME,
@@ -166,6 +167,7 @@ def load_arguments(self, _):
166167
c.argument('acr_identity', help='Accept system or user assigned identity which will be set for acr image pull. '
167168
'Use \'[system]\' to refer system assigned identity, or a resource id to refer user assigned identity.')
168169
c.argument('basic_auth', help='Enable or disable basic auth for both SCM and FTP Basic Auth Publishing Credentials. Defaults to Enabled if not specified. See https://aka.ms/app-service-basic-auth to learn more.', arg_type=get_enum_type(BASIC_AUTH_TYPES))
170+
c.argument('auto_generated_domain_name_label_scope', options_list=['--domain-name-scope'], help="Specify the scope of uniqueness for the default hostname during resource creation.", arg_type=get_enum_type(AutoGeneratedDomainNameLabelScope))
169171
c.ignore('language')
170172
c.ignore('using_webapp_up')
171173

src/azure-cli/azure/cli/command_modules/appservice/custom.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,8 @@ def create_webapp(cmd, resource_group_name, name, plan, runtime=None, startup_fi
115115
multicontainer_config_type=None, multicontainer_config_file=None, tags=None,
116116
using_webapp_up=False, language=None, assign_identities=None,
117117
role='Contributor', scope=None, vnet=None, subnet=None, https_only=False,
118-
public_network_access=None, acr_use_identity=False, acr_identity=None, basic_auth=""):
118+
public_network_access=None, acr_use_identity=False, acr_identity=None, basic_auth="",
119+
auto_generated_domain_name_label_scope=None):
119120
from azure.mgmt.web.models import Site
120121
from azure.core.exceptions import ResourceNotFoundError as _ResourceNotFoundError
121122
SiteConfig, SkuDescription, NameValuePair = cmd.get_models(
@@ -221,7 +222,8 @@ def create_webapp(cmd, resource_group_name, name, plan, runtime=None, startup_fi
221222

222223
webapp_def = Site(location=location, site_config=site_config, server_farm_id=plan_info.id, tags=tags,
223224
https_only=https_only, virtual_network_subnet_id=subnet_resource_id,
224-
public_network_access=public_network_access, vnet_route_all_enabled=vnet_route_all_enabled)
225+
public_network_access=public_network_access, vnet_route_all_enabled=vnet_route_all_enabled,
226+
auto_generated_domain_name_label_scope=auto_generated_domain_name_label_scope)
225227
if runtime:
226228
runtime = _StackRuntimeHelper.remove_delimiters(runtime)
227229

0 commit comments

Comments
 (0)