From cfd029a6172a5953a988c8aff008d87f9fb75669 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 1 Jul 2026 08:28:28 +0000 Subject: [PATCH 1/3] Initial plan From fe8263daa6b929e225b2b6558942b165906cfe21 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 1 Jul 2026 08:34:20 +0000 Subject: [PATCH 2/3] [AppService] Fix zip deploy content-type header --- .../cli/command_modules/appservice/custom.py | 5 +++- .../latest/test_webapp_commands_thru_mock.py | 30 +++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) 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 fe3ec65ac8b..571c333645a 100644 --- a/src/azure-cli/azure/cli/command_modules/appservice/custom.py +++ b/src/azure-cli/azure/cli/command_modules/appservice/custom.py @@ -11361,7 +11361,10 @@ def _build_deploymentstatus_url(cmd, resource_group_name, webapp_name, slot, dep def _get_ondeploy_headers(params): if params.src_path: - content_type = 'application/octet-stream' + if params.artifact_type == 'zip': + content_type = 'application/zip' + else: + content_type = 'application/octet-stream' elif params.src_url: content_type = 'application/json' else: 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 cc19fbcb865..22c56edfad5 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 @@ -1088,6 +1088,36 @@ def _make_params(self): params.slot = None return params + @mock.patch('azure.cli.command_modules.appservice.custom._populate_cached_scm_headers') + @mock.patch('azure.cli.command_modules.appservice.custom.get_scm_site_headers', return_value={}) + def test_get_ondeploy_headers_uses_zip_content_type_for_zip_artifact( + self, get_scm_site_headers_mock, _populate_cached_headers_mock): + from azure.cli.command_modules.appservice.custom import _get_ondeploy_headers + params = self._make_params() + params.src_path = '/tmp/package.zip' + params.artifact_type = 'zip' + + _get_ondeploy_headers(params) + + sent_additional_headers = get_scm_site_headers_mock.call_args.kwargs['additional_headers'] + self.assertEqual(sent_additional_headers['Content-Type'], 'application/zip') + self.assertEqual(sent_additional_headers['Cache-Control'], 'no-cache') + + @mock.patch('azure.cli.command_modules.appservice.custom._populate_cached_scm_headers') + @mock.patch('azure.cli.command_modules.appservice.custom.get_scm_site_headers', return_value={}) + def test_get_ondeploy_headers_keeps_octet_stream_for_non_zip_artifact( + self, get_scm_site_headers_mock, _populate_cached_headers_mock): + from azure.cli.command_modules.appservice.custom import _get_ondeploy_headers + params = self._make_params() + params.src_path = '/tmp/package.war' + params.artifact_type = 'war' + + _get_ondeploy_headers(params) + + sent_additional_headers = get_scm_site_headers_mock.call_args.kwargs['additional_headers'] + self.assertEqual(sent_additional_headers['Content-Type'], 'application/octet-stream') + self.assertEqual(sent_additional_headers['Cache-Control'], 'no-cache') + def test_get_or_fetch_scm_url_derives_from_cached_site(self): from azure.cli.command_modules.appservice.custom import _get_or_fetch_scm_url from azure.mgmt.web.models import HostType From 65741d412f5b579b8a447ae13f16f852a60c7d05 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 1 Jul 2026 10:39:31 +0000 Subject: [PATCH 3/3] [AppService] Re-run CI after flaky Homebrew timeout