Skip to content

ERROR: Extra data: line 1 column 1253 (char 1252) when running az functionapp deploy with --type zip #32443

Open

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/issues

Issue 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

  1. added
    bugThis issue requires a change to an existing behavior in the product in order to be resolved.
    on Nov 21, 2025
  2. yonzhan commented on Nov 21, 2025

    @yonzhan
    Collaborator

    Thank you for opening this issue, we will look into it.

  3. github-actions commented on Nov 21, 2025

    @github-actions

    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

  4. microsoft-github-policy-service commented on Nov 21, 2025

    @microsoft-github-policy-service
    Contributor

    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).

  5. microsoft-github-policy-service commented on Nov 21, 2025

    @microsoft-github-policy-service
    Contributor

    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).

  6. ashleysommer commented on Nov 21, 2025

    @ashleysommer
    Author

    Here are some similar issues that might help you. Please check if they can solve your problem.
    ...

    Not related.

  7. azclibot commented on Jun 22, 2026

    @azclibot
    Collaborator

    Bug Analysis

    This issue reports a json.decoder.JSONDecodeError: Extra data crash in az functionapp deploy when using --type zip with --src-url.

    Root cause: In azure/cli/command_modules/appservice/custom.py, the function _make_onedeploy_request calls response.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 raises JSONDecodeError instead of being handled gracefully.

    Failing command:

    az functionapp deploy --subscription <sub> --name <fn-app> --resource-group <rg> --type zip --src-url <url> --async false
    

    Fix: In _make_onedeploy_request (and/or _perform_onedeploy_internal), wrap response.json() in a try/except for ValueError/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.py

    PR 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

    • Start with [AppService] — square brackets [] for a customer-facing change (added to HISTORY.rst), curly {} if not. A bug fix is customer-facing, so use [].
    • Then Fix #32443: to link the issue.
    • Then optionally the affected command az <command>:.
    • Then a present-tense, capitalized verb (Fix for bug fixes; Add/Change/Deprecate/Remove otherwise) and a concise summary.
    • Recommended title: [AppService] Fix #32443: az <command>: Fix <concise description of the fix>

    Description — follow the PR template and fill in:

    • Link the issue — start the Description with a closing keyword so the PR auto-links and closes it: Fixes #32443.
    • Related command — the az ... command this affects.
    • Description (mandatory) — why the bug happens, what you changed, and the resulting behavior.
    • Testing Guide — example command(s) showing the fix works.
    • History Notes — leave the title to drive the history note, or add [AppService] az <command>: <note> lines for extra notes.
    • Keep the template checklist and tick the items you've satisfied.

    Posted by agent-assist (autonomous bug-fix pipeline).

  8. added a commit that references this issue on Jun 22, 2026
    4049e67
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Auto-AssignAuto assign by botFunctionsaz functionappPossible-SolutionService AttentionThis issue is responsible by Azure service team.Similar-Issueact-observability-squadbugThis issue requires a change to an existing behavior in the product in order to be resolved.customer-reportedIssues that are reported by GitHub users external to the Azure organization.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions