Description
Related command
az webapp deploy \
--debug \
--name "$APP_NAME" \
--resource-group "$AZURE_RESOURCE_GROUP_NAME" \
--slot "$SLOT_NAME" \
--src-path files.zip \
--type zip \
--output json
Describe the bug
This issue is new in Azure CLI 2.48.1
. It does not happen in 2.48.0
or earlier. It happens when issuing a az webapp deploy
The deployment is of type zip, and the zip contains two things: The New Relic Agent (newrelic-agent.jar
) and the Spring Boot application (app.jar
).
When it comes to the POST that pressumibly uploads the zip file, it fails with a HTTP 400 error and no further message or information: POST https://xxx-dev-temp.scm.azurewebsites.net:443 "POST /api/publish?type=zip HTTP/1.1" 400 0
The stacktrace is pasted below.
It's important to mention, that we double and triple checked that the error happens with AZ CLI 2.48.1
and it does not happen for AZ CLI 2.48.0
or earlier.
To Reproduce
- You are running an Azure
Web App
- Create a deployment slot (
az webapp deployment slot create
) - Run deploy with the
az webapp deploy
command stated above.- This command fails with the error described
Expected behavior
The deployment is successful as it is with versions of the Azure CLI <= 2.48.0
Environment summary
Execution method: Docker image mcr.microsoft.com/azure-cli:2.48.1
docker run -i mcr.microsoft.com/azure-cli:2.48.1 az --version
azure-cli 2.48.1
core 2.48.1
telemetry 1.0.8
Dependencies:
msal 1.20.0
azure-mgmt-resource 22.0.0
Python location '/usr/local/bin/python'
Extensions directory '/root/.azure/cliextensions'
Python (Linux) 3.10.11 (main, Apr 5 2023, 23:58:40) [GCC 12.2.1 20220924]
Legal docs and information: aka.ms/AzureCliLegal
Your CLI is up-to-date.
Additional context
This is the stacktrace we get running in --debug
mode. The real domain has been substituted by xxx
:
INFO: cli.azure.cli.command_modules.appservice.custom: Deployment API: https://xxx-temp.scm.azurewebsites.net/api/publish?type=zip
DEBUG: urllib3.connectionpool: Starting new HTTPS connection (1): xxx-temp.scm.azurewebsites.net:443
DEBUG: urllib3.connectionpool: https://xxx-dev-temp.scm.azurewebsites.net:443 "POST /api/publish?type=zip HTTP/1.1" 400 0
DEBUG: cli.azure.cli.core.azclierror: Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/knack/cli.py", line 233, in invoke
cmd_result = self.invocation.execute(args)
File "/usr/local/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 663, in execute
raise ex
File "/usr/local/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 726, in _run_jobs_serially
results.append(self._run_job(expanded_arg, cmd_copy))
File "/usr/local/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 697, in _run_job
result = cmd_copy(params)
File "/usr/local/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 333, in __call__
return self.handler(*args, **kwargs)
File "/usr/local/lib/python3.10/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler
return op(**command_args)
File "/usr/local/lib/python3.10/site-packages/azure/cli/command_modules/appservice/custom.py", line 4965, in perform_onedeploy
return _perform_onedeploy_internal(params)
File "/usr/local/lib/python3.10/site-packages/azure/cli/command_modules/appservice/custom.py", line 5107, in _perform_onedeploy_internal
response = _make_onedeploy_request(params)
File "/usr/local/lib/python3.10/site-packages/azure/cli/command_modules/appservice/custom.py", line 5095, in _make_onedeploy_request
raise CLIError("An error occured during deployment. Status Code: {}, Details: {}"
knack.util.CLIError: An error occured during deployment. Status Code: 400, Details:
ERROR: cli.azure.cli.core.azclierror: An error occured during deployment. Status Code: 400, Details:
ERROR: az_command_data_logger: An error occured during deployment. Status Code: 400, Details:
DEBUG: cli.knack.cli: Event: Cli.PostExecute [<function AzCliLogging.deinit_cmd_metadata_logging at 0x7fd6e3d1e560>]
INFO: az_command_data_logger: exit code: 1
INFO: cli.__main__: Command ran in 16.726 seconds (init: 0.203, invoke: 16.523)
INFO: telemetry.main: Begin splitting cli events and extra events, total events: 1
INFO: telemetry.client: Accumulated 0 events. Flush the clients.
INFO: telemetry.main: Finish splitting cli events and extra events, cli events: 1
INFO: telemetry.save: Save telemetry record of length 3710 in cache