From 6c8e12ad3d1cb3c62e69032b6636f7d980502013 Mon Sep 17 00:00:00 2001 From: Shikha Jha Date: Fri, 25 Sep 2026 16:25:40 +0530 Subject: [PATCH 1/3] Renaming tag to deploymentTag --- .../azure/cli/command_modules/appservice/_params.py | 3 ++- .../azure/cli/command_modules/appservice/custom.py | 8 ++++---- .../tests/latest/test_webapp_commands_thru_mock.py | 6 +++--- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/azure-cli/azure/cli/command_modules/appservice/_params.py b/src/azure-cli/azure/cli/command_modules/appservice/_params.py index 675d17ee4de..e1d30a80a5b 100644 --- a/src/azure-cli/azure/cli/command_modules/appservice/_params.py +++ b/src/azure-cli/azure/cli/command_modules/appservice/_params.py @@ -1146,7 +1146,8 @@ def load_arguments(self, _): c.argument('enriched_errors', options_list=['--enriched-errors'], help='If true, deployment failures will show context-enriched diagnostics with error codes, suggested fixes, and Copilot prompts. Enabled by default; use --enriched-errors false to disable.', arg_type=get_three_state_flag(), default=True) - c.argument('tag', help='Linux only. A friendly name used to identify the deployment.') + c.argument('deployment_tag', options_list=['--deploymentTag'], + help='Linux only. A friendly name used to identify the deployment.') with self.argument_context('functionapp deploy') as c: c.argument('name', options_list=['--name', '-n'], help='Name of the function app to deploy to.') diff --git a/src/azure-cli/azure/cli/command_modules/appservice/custom.py b/src/azure-cli/azure/cli/command_modules/appservice/custom.py index 9601d262676..c16af75741d 100644 --- a/src/azure-cli/azure/cli/command_modules/appservice/custom.py +++ b/src/azure-cli/azure/cli/command_modules/appservice/custom.py @@ -12045,7 +12045,7 @@ def perform_onedeploy_webapp(cmd, track_status=True, enable_kudu_warmup=True, enriched_errors=True, - tag=None): + deployment_tag=None): params = OneDeployParams() params.cmd = cmd @@ -12064,7 +12064,7 @@ def perform_onedeploy_webapp(cmd, params.track_status = track_status params.enable_kudu_warmup = enable_kudu_warmup params.enriched_errors = enriched_errors - params.tag = tag + params.tag = deployment_tag # When a slot is targeted, fetch the slot's Site (not production) so the # cached model matches what every downstream consumer expects — slots have @@ -12073,8 +12073,8 @@ def perform_onedeploy_webapp(cmd, app = _generic_site_operation(cmd.cli_ctx, resource_group_name, name, 'get', slot) params._cached_site = app # pylint: disable=protected-access params.is_linux_webapp = is_linux_webapp(app) - if tag is not None and not params.is_linux_webapp: - logger.warning("--tag is only supported for Linux web apps and will be ignored.") + if deployment_tag is not None and not params.is_linux_webapp: + logger.warning("--deploymentTag is only supported for Linux web apps and will be ignored.") params.tag = None # Warn that zip deploy won't auto-build on Linux diff --git a/src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_webapp_commands_thru_mock.py b/src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_webapp_commands_thru_mock.py index 317283d8839..b8dbed4b9d0 100644 --- a/src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_webapp_commands_thru_mock.py +++ b/src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_webapp_commands_thru_mock.py @@ -1649,14 +1649,14 @@ def test_scm_url_includes_encoded_tag(self): @mock.patch('azure.cli.command_modules.appservice.custom._perform_onedeploy_internal') @mock.patch('azure.cli.command_modules.appservice.custom._generic_site_operation') - def test_webapp_deploy_ignores_tag_for_windows_webapp(self, site_operation_mock, perform_deploy_mock): + def test_webapp_deploy_ignores_deployment_tag_for_windows_webapp(self, site_operation_mock, perform_deploy_mock): from azure.cli.command_modules.appservice.custom import perform_onedeploy_webapp site_operation_mock.return_value = mock.MagicMock(kind='app', reserved=False) with mock.patch('azure.cli.command_modules.appservice.custom.logger.warning') as warning_mock: - perform_onedeploy_webapp(mock.MagicMock(), 'myRG', 'myApp', tag='windows-tag') + perform_onedeploy_webapp(mock.MagicMock(), 'myRG', 'myApp', deployment_tag='windows-tag') - warning_mock.assert_any_call('--tag is only supported for Linux web apps and will be ignored.') + warning_mock.assert_any_call('--deploymentTag is only supported for Linux web apps and will be ignored.') self.assertIsNone(perform_deploy_mock.call_args.args[0].tag) def test_arm_body_includes_tag(self): From 4524bb971df45ca4c0b40fbb54db9a5719ba93ed Mon Sep 17 00:00:00 2001 From: Shikha Jha Date: Fri, 25 Sep 2026 17:14:07 +0530 Subject: [PATCH 2/3] minor code --- .../azure/cli/command_modules/appservice/_params.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/azure-cli/azure/cli/command_modules/appservice/_params.py b/src/azure-cli/azure/cli/command_modules/appservice/_params.py index e1d30a80a5b..ac9a1ce0448 100644 --- a/src/azure-cli/azure/cli/command_modules/appservice/_params.py +++ b/src/azure-cli/azure/cli/command_modules/appservice/_params.py @@ -1146,8 +1146,10 @@ def load_arguments(self, _): c.argument('enriched_errors', options_list=['--enriched-errors'], help='If true, deployment failures will show context-enriched diagnostics with error codes, suggested fixes, and Copilot prompts. Enabled by default; use --enriched-errors false to disable.', arg_type=get_three_state_flag(), default=True) - c.argument('deployment_tag', options_list=['--deploymentTag'], - help='Linux only. A friendly name used to identify the deployment.') + c.argument( + 'deployment_tag', + options_list=['--deploymentTag', c.deprecate(target='--tag', redirect='--deploymentTag')], + help='Linux only. A friendly name used to identify the deployment.') with self.argument_context('functionapp deploy') as c: c.argument('name', options_list=['--name', '-n'], help='Name of the function app to deploy to.') From f0738ff8e0055e6f2c24fb1585f4999a1fff4cdf Mon Sep 17 00:00:00 2001 From: Shikha Jha Date: Fri, 25 Sep 2026 17:43:26 +0530 Subject: [PATCH 3/3] more change --- .../azure/cli/command_modules/appservice/custom.py | 4 ++-- .../tests/latest/test_webapp_commands_thru_mock.py | 10 ++++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/azure-cli/azure/cli/command_modules/appservice/custom.py b/src/azure-cli/azure/cli/command_modules/appservice/custom.py index c16af75741d..beb08acebf6 100644 --- a/src/azure-cli/azure/cli/command_modules/appservice/custom.py +++ b/src/azure-cli/azure/cli/command_modules/appservice/custom.py @@ -12253,7 +12253,7 @@ def _build_onedeploy_scm_url(params): deploy_url = deploy_url + '&path=' + quote(params.target_path) if params.tag is not None: - deploy_url = deploy_url + '&tag=' + quote(params.tag, safe='') + deploy_url = deploy_url + '&deploymentTag=' + quote(params.tag, safe='') return deploy_url @@ -12372,7 +12372,7 @@ def _get_onedeploy_request_body(params): "ignorestack": params.should_ignore_stack, "clean": params.is_clean_deployment, "restart": params.should_restart, - "tag": params.tag, + "deploymentTag": params.tag, } } body = {"properties": {k: v for k, v in body["properties"].items() if v is not None}} diff --git a/src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_webapp_commands_thru_mock.py b/src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_webapp_commands_thru_mock.py index b8dbed4b9d0..518528cbca5 100644 --- a/src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_webapp_commands_thru_mock.py +++ b/src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_webapp_commands_thru_mock.py @@ -1635,7 +1635,7 @@ def __init__(self, status_code): class TestOneDeployTag(unittest.TestCase): - def test_scm_url_includes_encoded_tag(self): + def test_scm_url_includes_encoded_deployment_tag(self): from azure.cli.command_modules.appservice.custom import OneDeployParams, _build_onedeploy_scm_url params = OneDeployParams() params.artifact_type = 'zip' @@ -1645,7 +1645,9 @@ def test_scm_url_includes_encoded_tag(self): return_value='https://example.scm.azurewebsites.net'): result = _build_onedeploy_scm_url(params) - self.assertEqual(result, 'https://example.scm.azurewebsites.net/api/publish?type=zip&tag=release%202026%2F08') + self.assertEqual( + result, + 'https://example.scm.azurewebsites.net/api/publish?type=zip&deploymentTag=release%202026%2F08') @mock.patch('azure.cli.command_modules.appservice.custom._perform_onedeploy_internal') @mock.patch('azure.cli.command_modules.appservice.custom._generic_site_operation') @@ -1659,7 +1661,7 @@ def test_webapp_deploy_ignores_deployment_tag_for_windows_webapp(self, site_oper warning_mock.assert_any_call('--deploymentTag is only supported for Linux web apps and will be ignored.') self.assertIsNone(perform_deploy_mock.call_args.args[0].tag) - def test_arm_body_includes_tag(self): + def test_arm_body_includes_deployment_tag(self): import json from azure.cli.command_modules.appservice.custom import OneDeployParams, _get_onedeploy_request_body params = OneDeployParams() @@ -1669,7 +1671,7 @@ def test_arm_body_includes_tag(self): body, file_hash = _get_onedeploy_request_body(params) - self.assertEqual(json.loads(body)['properties']['tag'], 'release-2026-08') + self.assertEqual(json.loads(body)['properties']['deploymentTag'], 'release-2026-08') self.assertIsNone(file_hash)