[App Service] az webapp create: Add --domain-name-scope parameter to support DNL scopes during site creation#31863
Conversation
️✔️AzureCLI-FullTest
|
|
Hi @nineela, |
|
| rule | cmd_name | rule_message | suggest_message |
|---|---|---|---|
| webapp create | cmd webapp create added parameter auto_generated_domain_name_label_scope |
|
Thank you for your contribution! We will review the pull request and get back to you soon. |
|
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). pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>
|
There was a problem hiding this comment.
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-scopeparameter toaz webapp createcommand 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']) |
There was a problem hiding this comment.
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.
| 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']) |
There was a problem hiding this comment.
There is an extra trailing space in the help message before the closing quote. Remove the space after 'creation.'
| 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']) |
--domain-name-scope parameter to support DNL scopes during site creation
--domain-name-scope parameter to support DNL scopes during site creationaz webapp create: Add --domain-name-scope parameter to support DNL scopes during site creation
az webapp create: Add --domain-name-scope parameter to support DNL scopes during site creationaz webapp create: Add --domain-name-scope parameter to support DNL scopes during site creation
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
| :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 |
There was a problem hiding this comment.
| :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 |
There was a problem hiding this comment.
Please use the active voice in the help message
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
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 featureThis checklist is used to make sure that common guidelines for a pull request are followed.
The PR title and description has followed the guideline in Submitting Pull Requests.
I adhere to the Command Guidelines.
I adhere to the Error Handling Guidelines.