Skip to content

[VM] Fix az vm create --no-wait JSON decode failure in no-wait LRO path#33356

Draft
Copilot wants to merge 6 commits into
devfrom
copilot/fix-az-vm-create-json-parsing-error
Draft

[VM] Fix az vm create --no-wait JSON decode failure in no-wait LRO path#33356
Copilot wants to merge 6 commits into
devfrom
copilot/fix-az-vm-create-json-parsing-error

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 12, 2026

Related command
az vm create --no-wait

Description
az vm create --no-wait started failing with Extra data: line 1 column 4 (char 3) after continuation-token format changes in newer azure-core/azure-mgmt-core interactions.
This PR hardens CLI no-wait invocation by falling back to original polling settings when forced polling=False triggers JSON decode failure.

  • No-wait invocation resilience (azure-cli-core)

    • Updated sdk_no_wait to:
      • attempt no-wait call with polling=False (existing behavior),
      • catch json.JSONDecodeError,
      • retry once with original polling kwargs restored.
    • Added debug logging when fallback is activated.
  • Focused unit coverage

    • Added tests for:
      • forced polling=False behavior,
      • retry path after JSON decode failure,
      • restoration of caller-provided polling value on retry.
def sdk_no_wait(no_wait, func, *args, **kwargs):
    if no_wait:
        original_polling = kwargs.get('polling', None)
        has_polling = 'polling' in kwargs
        kwargs.update({'polling': False})
        try:
            return func(*args, **kwargs)
        except json.JSONDecodeError:
            logger.debug("Retrying no-wait operation with original polling settings after JSON decode failure.",
                         exc_info=True)
            if has_polling:
                kwargs['polling'] = original_polling
            else:
                kwargs.pop('polling', None)
            return func(*args, **kwargs)
    return func(*args, **kwargs)

Testing Guide
N/A

History Notes
[VM] az vm create: Improve --no-wait robustness by retrying with original polling settings on JSON decode failure


This checklist is used to make sure that common guidelines for a pull request are followed.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • aka.ms
    • Triggering command: /usr/bin/python python -m unittest azure.cli.core.tests.test_util (dns block)
  • azcliprod.blob.core.windows.net
    • Triggering command: /usr/bin/python python -m unittest azure.cli.core.tests.test_util (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

@azure-client-tools-bot-prd
Copy link
Copy Markdown

azure-client-tools-bot-prd Bot commented May 12, 2026

️✔️AzureCLI-FullTest
️✔️acr
️✔️latest
️✔️3.12
️✔️3.13
️✔️acs
️✔️latest
️✔️3.12
️✔️3.13
️✔️advisor
️✔️latest
️✔️3.12
️✔️3.13
️✔️ams
️✔️latest
️✔️3.12
️✔️3.13
️✔️apim
️✔️latest
️✔️3.12
️✔️3.13
️✔️appconfig
️✔️latest
️✔️3.12
️✔️3.13
️✔️appservice
️✔️latest
️✔️3.12
️✔️3.13
️✔️aro
️✔️latest
️✔️3.12
️✔️3.13
️✔️backup
️✔️latest
️✔️3.12
️✔️3.13
️✔️batch
️✔️latest
️✔️3.12
️✔️3.13
️✔️batchai
️✔️latest
️✔️3.12
️✔️3.13
️✔️billing
️✔️latest
️✔️3.12
️✔️3.13
️✔️botservice
️✔️latest
️✔️3.12
️✔️3.13
️✔️cdn
️✔️latest
️✔️3.12
️✔️3.13
️✔️cloud
️✔️latest
️✔️3.12
️✔️3.13
️✔️cognitiveservices
️✔️latest
️✔️3.12
️✔️3.13
️✔️compute_recommender
️✔️latest
️✔️3.12
️✔️3.13
️✔️computefleet
️✔️latest
️✔️3.12
️✔️3.13
️✔️config
️✔️latest
️✔️3.12
️✔️3.13
️✔️configure
️✔️latest
️✔️3.12
️✔️3.13
️✔️consumption
️✔️latest
️✔️3.12
️✔️3.13
️✔️container
️✔️latest
️✔️3.12
️✔️3.13
️✔️containerapp
️✔️latest
️✔️3.12
️✔️3.13
️✔️core
️✔️latest
️✔️3.12
️✔️3.13
️✔️cosmosdb
️✔️latest
️✔️3.12
️✔️3.13
️✔️databoxedge
️✔️latest
️✔️3.12
️✔️3.13
️✔️dls
️✔️latest
️✔️3.12
️✔️3.13
️✔️dms
️✔️latest
️✔️3.12
️✔️3.13
️✔️eventgrid
️✔️latest
️✔️3.12
️✔️3.13
️✔️eventhubs
️✔️latest
️✔️3.12
️✔️3.13
️✔️feedback
️✔️latest
️✔️3.12
️✔️3.13
️✔️find
️✔️latest
️✔️3.12
️✔️3.13
️✔️hdinsight
️✔️latest
️✔️3.12
️✔️3.13
️✔️identity
️✔️latest
️✔️3.12
️✔️3.13
️✔️iot
️✔️latest
️✔️3.12
️✔️3.13
️✔️keyvault
️✔️latest
️✔️3.12
️✔️3.13
️✔️lab
️✔️latest
️✔️3.12
️✔️3.13
️✔️managedservices
️✔️latest
️✔️3.12
️✔️3.13
️✔️maps
️✔️latest
️✔️3.12
️✔️3.13
️✔️marketplaceordering
️✔️latest
️✔️3.12
️✔️3.13
️✔️monitor
️✔️latest
️✔️3.12
️✔️3.13
️✔️mysql
️✔️latest
️✔️3.12
️✔️3.13
️✔️netappfiles
️✔️latest
️✔️3.12
️✔️3.13
️✔️network
️✔️latest
️✔️3.12
️✔️3.13
️✔️policyinsights
️✔️latest
️✔️3.12
️✔️3.13
️✔️postgresql
️✔️latest
️✔️3.12
️✔️3.13
️✔️privatedns
️✔️latest
️✔️3.12
️✔️3.13
️✔️profile
️✔️latest
️✔️3.12
️✔️3.13
️✔️rdbms
️✔️latest
️✔️3.12
️✔️3.13
️✔️redis
️✔️latest
️✔️3.12
️✔️3.13
️✔️relay
️✔️latest
️✔️3.12
️✔️3.13
️✔️resource
️✔️latest
️✔️3.12
️✔️3.13
️✔️role
️✔️latest
️✔️3.12
️✔️3.13
️✔️search
️✔️latest
️✔️3.12
️✔️3.13
️✔️security
️✔️latest
️✔️3.12
️✔️3.13
️✔️servicebus
️✔️latest
️✔️3.12
️✔️3.13
️✔️serviceconnector
️✔️latest
️✔️3.12
️✔️3.13
️✔️servicefabric
️✔️latest
️✔️3.12
️✔️3.13
️✔️signalr
️✔️latest
️✔️3.12
️✔️3.13
️✔️sql
️✔️latest
️✔️3.12
️✔️3.13
️✔️sqlvm
️✔️latest
️✔️3.12
️✔️3.13
️✔️storage
️✔️latest
️✔️3.12
️✔️3.13
️✔️synapse
️✔️latest
️✔️3.12
️✔️3.13
️✔️telemetry
️✔️latest
️✔️3.12
️✔️3.13
️✔️util
️✔️latest
️✔️3.12
️✔️3.13
️✔️vm
️✔️latest
️✔️3.12
️✔️3.13

@azure-client-tools-bot-prd
Copy link
Copy Markdown

azure-client-tools-bot-prd Bot commented May 12, 2026

️✔️AzureCLI-BreakingChangeTest
️✔️Non Breaking Changes

@yonzhan
Copy link
Copy Markdown
Collaborator

yonzhan commented May 12, 2026

VM fix

Copilot AI and others added 5 commits May 12, 2026 04:55
Agent-Logs-Url: https://github.com/Azure/azure-cli/sessions/d1b76e63-afd4-462e-92f9-40626d2cfbee

Co-authored-by: a0x1ab <59631311+a0x1ab@users.noreply.github.com>
Agent-Logs-Url: https://github.com/Azure/azure-cli/sessions/d1b76e63-afd4-462e-92f9-40626d2cfbee

Co-authored-by: a0x1ab <59631311+a0x1ab@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix az vm create --no-wait JSON parsing error [VM] Fix az vm create --no-wait JSON decode failure in no-wait LRO path May 12, 2026
Copilot finished work on behalf of a0x1ab May 12, 2026 04:58
Copilot AI requested a review from a0x1ab May 12, 2026 04:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

act-observability-squad Auto-Assign Auto assign by bot Compute az vm/vmss/image/disk/snapshot

Projects

None yet

Development

Successfully merging this pull request may close these issues.

az vm create --no-wait fails with "Extra data: line 1 column 4 (char 3)"

5 participants