Skip to content

[App Service] az webapp create: Add --domain-name-scope parameter to support DNL scopes during site creation#31863

Merged
zhoxing-ms merged 10 commits intoAzure:devfrom
nineela:webapp_dnl_latest
Jul 25, 2025
Merged

[App Service] az webapp create: Add --domain-name-scope parameter to support DNL scopes during site creation#31863
zhoxing-ms merged 10 commits intoAzure:devfrom
nineela:webapp_dnl_latest

Conversation

@nineela
Copy link
Copy Markdown
Contributor

@nineela nineela commented Jul 23, 2025

Related command

az webapp create --domain-name-scope SubscriptionReuse

Description
Add Deterministic Naming Support during App Service Creation. This changes the default hostname format to contain a deterministic hash along with a regionalized URL

Testing Guide
az webapp create --resource-group "cli-rg-test" --plan "cli-asp-test" --name "last-test-nineela101" --runtime "python|3.8" --domain-name-scope SubscriptionReuse

This would create web app with default hostname containing the DNL hash (16 chars) along with the region name.
Example : last-test-nineela101-dmatcmdfbsd4cwhf.eastus-01.azurewebsites.net

History Notes

[Component Name 1] BREAKING CHANGE: az command a: Make some customer-facing breaking change
[Component Name 2] az command b: Add some customer-facing feature


This checklist is used to make sure that common guidelines for a pull request are followed.

Copilot AI review requested due to automatic review settings July 23, 2025 10:54
@azure-client-tools-bot-prd
Copy link
Copy Markdown

azure-client-tools-bot-prd bot commented Jul 23, 2025

️✔️AzureCLI-FullTest
️✔️acr
️✔️latest
️✔️3.12
️✔️3.9
️✔️acs
️✔️latest
️✔️3.12
️✔️3.9
️✔️advisor
️✔️latest
️✔️3.12
️✔️3.9
️✔️ams
️✔️latest
️✔️3.12
️✔️3.9
️✔️apim
️✔️latest
️✔️3.12
️✔️3.9
️✔️appconfig
️✔️latest
️✔️3.12
️✔️3.9
️✔️appservice
️✔️latest
️✔️3.12
️✔️3.9
️✔️aro
️✔️latest
️✔️3.12
️✔️3.9
️✔️backup
️✔️latest
️✔️3.12
️✔️3.9
️✔️batch
️✔️latest
️✔️3.12
️✔️3.9
️✔️batchai
️✔️latest
️✔️3.12
️✔️3.9
️✔️billing
️✔️latest
️✔️3.12
️✔️3.9
️✔️botservice
️✔️latest
️✔️3.12
️✔️3.9
️✔️cdn
️✔️latest
️✔️3.12
️✔️3.9
️✔️cloud
️✔️latest
️✔️3.12
️✔️3.9
️✔️cognitiveservices
️✔️latest
️✔️3.12
️✔️3.9
️✔️compute_recommender
️✔️latest
️✔️3.12
️✔️3.9
️✔️computefleet
️✔️latest
️✔️3.12
️✔️3.9
️✔️config
️✔️latest
️✔️3.12
️✔️3.9
️✔️configure
️✔️latest
️✔️3.12
️✔️3.9
️✔️consumption
️✔️latest
️✔️3.12
️✔️3.9
️✔️container
️✔️latest
️✔️3.12
️✔️3.9
️✔️containerapp
️✔️latest
️✔️3.12
️✔️3.9
️✔️core
️✔️latest
️✔️3.12
️✔️3.9
️✔️cosmosdb
️✔️latest
️✔️3.12
️✔️3.9
️✔️databoxedge
️✔️latest
️✔️3.12
️✔️3.9
️✔️dls
️✔️latest
️✔️3.12
️✔️3.9
️✔️dms
️✔️latest
️✔️3.12
️✔️3.9
️✔️eventgrid
️✔️latest
️✔️3.12
️✔️3.9
️✔️eventhubs
️✔️latest
️✔️3.12
️✔️3.9
️✔️feedback
️✔️latest
️✔️3.12
️✔️3.9
️✔️find
️✔️latest
️✔️3.12
️✔️3.9
️✔️hdinsight
️✔️latest
️✔️3.12
️✔️3.9
️✔️identity
️✔️latest
️✔️3.12
️✔️3.9
️✔️iot
️✔️latest
️✔️3.12
️✔️3.9
️✔️keyvault
️✔️latest
️✔️3.12
️✔️3.9
️✔️lab
️✔️latest
️✔️3.12
️✔️3.9
️✔️managedservices
️✔️latest
️✔️3.12
️✔️3.9
️✔️maps
️✔️latest
️✔️3.12
️✔️3.9
️✔️marketplaceordering
️✔️latest
️✔️3.12
️✔️3.9
️✔️monitor
️✔️latest
️✔️3.12
️✔️3.9
️✔️mysql
️✔️latest
️✔️3.12
️✔️3.9
️✔️netappfiles
️✔️latest
️✔️3.12
️✔️3.9
️✔️network
️✔️latest
️✔️3.12
️✔️3.9
️✔️policyinsights
️✔️latest
️✔️3.12
️✔️3.9
️✔️privatedns
️✔️latest
️✔️3.12
️✔️3.9
️✔️profile
️✔️latest
️✔️3.12
️✔️3.9
️✔️rdbms
️✔️latest
️✔️3.12
️✔️3.9
️✔️redis
️✔️latest
️✔️3.12
️✔️3.9
️✔️relay
️✔️latest
️✔️3.12
️✔️3.9
️✔️resource
️✔️latest
️✔️3.12
️✔️3.9
️✔️role
️✔️latest
️✔️3.12
️✔️3.9
️✔️search
️✔️latest
️✔️3.12
️✔️3.9
️✔️security
️✔️latest
️✔️3.12
️✔️3.9
️✔️servicebus
️✔️latest
️✔️3.12
️✔️3.9
️✔️serviceconnector
️✔️latest
️✔️3.12
️✔️3.9
️✔️servicefabric
️✔️latest
️✔️3.12
️✔️3.9
️✔️signalr
️✔️latest
️✔️3.12
️✔️3.9
️✔️sql
️✔️latest
️✔️3.12
️✔️3.9
️✔️sqlvm
️✔️latest
️✔️3.12
️✔️3.9
️✔️storage
️✔️latest
️✔️3.12
️✔️3.9
️✔️synapse
️✔️latest
️✔️3.12
️✔️3.9
️✔️telemetry
️✔️latest
️✔️3.12
️✔️3.9
️✔️util
️✔️latest
️✔️3.12
️✔️3.9
️✔️vm
️✔️latest
️✔️3.12
️✔️3.9

@azure-client-tools-bot-prd
Copy link
Copy Markdown

Hi @nineela,
Since the current milestone time is less than 7 days, this pr will be reviewed in the next milestone.

@azure-client-tools-bot-prd
Copy link
Copy Markdown

azure-client-tools-bot-prd bot commented Jul 23, 2025

⚠️AzureCLI-BreakingChangeTest
⚠️appservice
rule cmd_name rule_message suggest_message
⚠️ 1006 - ParaAdd webapp create cmd webapp create added parameter auto_generated_domain_name_label_scope

@yonzhan
Copy link
Copy Markdown
Collaborator

yonzhan commented Jul 23, 2025

Thank you for your contribution! We will review the pull request and get back to you soon.

@github-actions
Copy link
Copy Markdown

The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR.

Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions).
After that please run the following commands to enable git hooks:

pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for deterministic naming during App Service creation by introducing a new --domain-name-scope parameter that allows users to specify the scope of uniqueness for the default hostname. When this parameter is used, the resulting hostname includes a deterministic hash and regionalized URL format.

  • Adds --domain-name-scope parameter to az webapp create command with four scope options
  • Updates the webapp creation logic to pass the domain name scope to the Azure API
  • Includes comprehensive test coverage for the new DNL (Deterministic Naming) functionality

Reviewed Changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.

File Description
_params.py Adds the new --domain-name-scope parameter definition with help text and choices
custom.py Updates the create_webapp function to accept and use the new parameter
test_webapp_commands.py Adds test class to verify DNL functionality and hostname pattern validation
Comments suppressed due to low confidence (1)

src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_webapp_commands.py:383

  • [nitpick] The test should also verify that the hash part is deterministic by creating another webapp with the same scope and verifying consistent hash generation behavior.
        self.cmd('storage account create -n {} -g {} --location {} --allow-blob-public-access false'.format(storage_Account, resource_group, WINDOWS_ASP_LOCATION_WEBAPP))

c.argument('acr_identity', help='Accept system or user assigned identity which will be set for acr image pull. '
'Use \'[system]\' to refer system assigned identity, or a resource id to refer user assigned identity.')
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))
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. ", choices=['TenantReuse', 'SubscriptionReuse', 'ResourceGroupReuse', 'NoReuse'])
Copy link

Copilot AI Jul 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The help message should start with an active voice verb in first person. Consider changing 'Specify the scope...' to 'Set the scope...' or similar active voice phrasing.

Copilot uses AI. Check for mistakes.
c.argument('acr_identity', help='Accept system or user assigned identity which will be set for acr image pull. '
'Use \'[system]\' to refer system assigned identity, or a resource id to refer user assigned identity.')
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))
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. ", choices=['TenantReuse', 'SubscriptionReuse', 'ResourceGroupReuse', 'NoReuse'])
Copy link

Copilot AI Jul 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is an extra trailing space in the help message before the closing quote. Remove the space after 'creation.'

Suggested change
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. ", choices=['TenantReuse', 'SubscriptionReuse', 'ResourceGroupReuse', 'NoReuse'])
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.", choices=['TenantReuse', 'SubscriptionReuse', 'ResourceGroupReuse', 'NoReuse'])

Copilot uses AI. Check for mistakes.
Comment thread src/azure-cli/azure/cli/command_modules/appservice/_params.py Outdated
@zhoxing-ms zhoxing-ms changed the title [AppServices] az webapp create: Add --domain-name-scope parameter to support DNL scopes during site creation [AppServices] az webapp create: Add --domain-name-scope parameter to support DNL scopes during site creation Jul 24, 2025
@zhoxing-ms zhoxing-ms changed the title [AppServices] az webapp create: Add --domain-name-scope parameter to support DNL scopes during site creation [App Services] az webapp create: Add --domain-name-scope parameter to support DNL scopes during site creation Jul 24, 2025
@zhoxing-ms zhoxing-ms changed the title [App Services] az webapp create: Add --domain-name-scope parameter to support DNL scopes during site creation [App Service] az webapp create: Add --domain-name-scope parameter to support DNL scopes during site creation Jul 24, 2025
zhoxing-ms
zhoxing-ms previously approved these changes Jul 24, 2025
@zhoxing-ms
Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 3 pipeline(s).

Comment on lines +20 to +24
:example: Gets a DeploymentSafeguard resource by managed cluster id
az aks safeguards show --managed-cluster subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/cluster1

:example: Gets a DeploymentSafeguard resource with resourceGroup and clusterName arguments
az aks safeguards show -g rg1 -n cluster1
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
:example: Gets a DeploymentSafeguard resource by managed cluster id
az aks safeguards show --managed-cluster subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/cluster1
:example: Gets a DeploymentSafeguard resource with resourceGroup and clusterName arguments
az aks safeguards show -g rg1 -n cluster1
:example: Get a DeploymentSafeguard resource by managed cluster id
az aks safeguards show --managed-cluster subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/cluster1
:example: Get a DeploymentSafeguard resource with resourceGroup and clusterName arguments
az aks safeguards show -g rg1 -n cluster1

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use the active voice in the help message

@zhoxing-ms
Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 3 pipeline(s).

@zhoxing-ms zhoxing-ms merged commit 6023a41 into Azure:dev Jul 25, 2025
48 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Auto-Assign Auto assign by bot Web Apps az webapp

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants