Repository navigation
ERROR: Extra data: line 1 column 1253 (char 1252) when running az functionapp deploy with --type zip #32443
Description
Describe the bug
Error when running az functionapp deploy with --type zip
ERROR: Extra data: line 1 column 1253 (char 1252)
The CLI tool is getting unexpected content in one the JSON payloads it gets back from one of the deploy endpoints.
I suspect it is related to #30960
Related command
az functionapp deploy --subscription $SUBSCRIPTION_URL --name my-fn-app --resource-group my-real-rg --type zip --src-url $APP_URL --async false
Errors
WARNING: This command is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
WARNING: Initiating deployment
WARNING: Deploying from URL: https://mycontainer.blob.core.windows.net/app-package-my-fn-a3f36a2/released-package.zip?se=2025-11-22T04%3A43%3A51Z&sp=r&sv=2022-11-02&sr=b&skoid=***&sktid=***&skt=2025-11-21T04%3A43%3A58Z&ske=2025-11-22T04%3A43%3A51Z&sks=b&skv=2022-11-02&sig=***
ERROR: The command failed with an unexpected error. Here is the traceback:
ERROR: Extra data: line 1 column 1253 (char 1252)
Traceback (most recent call last):
File "/opt/az/lib/python3.13/site-packages/requests/models.py", line 976, in json
return complexjson.loads(self.text, **kwargs)
~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^
File "/opt/az/lib/python3.13/json/__init__.py", line 346, in loads
return _default_decoder.decode(s)
~~~~~~~~~~~~~~~~~~~~~~~^^^
File "/opt/az/lib/python3.13/json/decoder.py", line 348, in decode
raise JSONDecodeError("Extra data", s, end)
json.decoder.JSONDecodeError: Extra data: line 1 column 1253 (char 1252)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/az/lib/python3.13/site-packages/knack/cli.py", line 233, in invoke
cmd_result = self.invocation.execute(args)
File "/opt/az/lib/python3.13/site-packages/azure/cli/core/commands/__init__.py", line 666, in execute
raise ex
File "/opt/az/lib/python3.13/site-packages/azure/cli/core/commands/__init__.py", line 734, in _run_jobs_serially
results.append(self._run_job(expanded_arg, cmd_copy))
~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/az/lib/python3.13/site-packages/azure/cli/core/commands/__init__.py", line 703, in _run_job
result = cmd_copy(params)
File "/opt/az/lib/python3.13/site-packages/azure/cli/core/commands/__init__.py", line 336, in __call__
return self.handler(*args, **kwargs)
~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
File "/opt/az/lib/python3.13/site-packages/azure/cli/core/commands/command_operation.py", line 120, in handler
return op(**command_args)
File "/opt/az/lib/python3.13/site-packages/azure/cli/command_modules/appservice/custom.py", line 8441, in perform_onedeploy_functionapp
return _perform_onedeploy_internal(params)
File "/opt/az/lib/python3.13/site-packages/azure/cli/command_modules/appservice/custom.py", line 8850, in _perform_onedeploy_internal
response = _make_onedeploy_request(params)
File "/opt/az/lib/python3.13/site-packages/azure/cli/command_modules/appservice/custom.py", line 8813, in _make_onedeploy_request
state = response.json().get("properties", {}).get("provisioningState")
~~~~~~~~~~~~~^^
File "/opt/az/lib/python3.13/site-packages/requests/models.py", line 980, in json
raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Extra data: line 1 column 1253 (char 1252)
To check existing issues, please visit: https://github.com/Azure/azure-cli/issuesIssue script & Debug output
Full debug log showing exact cause is here:
https://gist.github.com/ashleysommer/976b1d90d0e10396bcc4487eea5c9f4a
Expected behavior
I expect the zip file will be deployed to the functionapp.
Environment Summary
az built-in CLI tool in Github Actions
Additional context
This is a similar, related bug: #30960
It shows there is extra HTML being delivered along with the JSON payload from the deploy REST endpoint. I suspect that is the bug that is triggering this CLI error.
Activity
yonzhan commentedon Nov 21, 2025
Thank you for opening this issue, we will look into it.
github-actions commentedon Nov 21, 2025
Here are some similar issues that might help you. Please check if they can solve your problem.
Possible solution (Extracted from existing issue, might be incorrect; please verify carefully)
Solution 1:
Please re-try & let us know if you still see this. I have seen this reported earlier too where sometimes the API that checks for the status of the deployment doesn't return a valid JSON object. I will try to get a repro on our end, & add some error handling.
Reference:
Solution 2:
It looks like for some reason the *.scm.azurewebsites.net service was down. I had to rebuild the whole thing for it to work again.
Reference:
Solution 3:
Can you say what you mean by you had to rebuild the whole thing? It's possible that for a freshly minted site SCM site might have been going through a cold start the first time.
Reference:
Powered by issue-sentinel
microsoft-github-policy-service commentedon Nov 21, 2025
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc Kirstyn Amperiadis (@kamperiadis), Ahmed El Sayed (@amamounelsayed), Khuram Khan (@khkh-ms).
microsoft-github-policy-service commentedon Nov 21, 2025
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc Kirstyn Amperiadis (@kamperiadis), Ahmed El Sayed (@amamounelsayed), Khuram Khan (@khkh-ms).
ashleysommer commentedon Nov 21, 2025
Not related.
azclibot commentedon Jun 22, 2026
Bug Analysis
This issue reports a
json.decoder.JSONDecodeError: Extra datacrash inaz functionapp deploywhen using--type zipwith--src-url.Root cause: In
azure/cli/command_modules/appservice/custom.py, the function_make_onedeploy_requestcallsresponse.json()unconditionally to poll the provisioning state. When the deployment endpoint returns a response with extra data (e.g. HTML appended after JSON), the.json()call raisesJSONDecodeErrorinstead of being handled gracefully.Failing command:
Fix: In
_make_onedeploy_request(and/or_perform_onedeploy_internal), wrapresponse.json()in a try/except forValueError/JSONDecodeError. If parsing fails, either retry, log a warning, or return a safe default rather than surfacing a raw exception to the user. Related to issue #30960 which observed the same extra-HTML response from the deploy endpoint.Relevant file:
src/azure-cli/azure/cli/command_modules/appservice/custom.pyPR title & description format (required)
This repo enforces a PR format (guide). Please author the PR exactly as follows or CI's Check the Format of Pull Request Title and Content will fail.
Title
[AppService]— square brackets[]for a customer-facing change (added toHISTORY.rst), curly{}if not. A bug fix is customer-facing, so use[].Fix #32443:to link the issue.az <command>:.[AppService] Fix #32443: az <command>: Fix <concise description of the fix>Description — follow the PR template and fill in:
Fixes #32443.az ...command this affects.[AppService] az <command>: <note>lines for extra notes.Posted by agent-assist (autonomous bug-fix pipeline).
[AppService] Fix #32443: az functionapp deploy: Fix JSONDecodeError w…