-
Notifications
You must be signed in to change notification settings - Fork 3.5k
az resource wait --custom returns exit code 0 when condition times out #34004
Copy link
Copy link
Open
Labels
ARMaz resource/group/lock/tag/deployment/policy/managementapp/account management-groupaz resource/group/lock/tag/deployment/policy/managementapp/account management-groupAuto-AssignAuto assign by botAuto assign by botAzure CLI TeamThe command of the issue is owned by Azure CLI teamThe command of the issue is owned by Azure CLI teamact-identity-squadcustomer-reportedIssues that are reported by GitHub users external to the Azure organization.Issues that are reported by GitHub users external to the Azure organization.questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as thatThe issue doesn't require a change to the product in order to be resolved. Most issues start as that
Milestone
Description
Activity
Metadata
Metadata
Assignees
Labels
ARMaz resource/group/lock/tag/deployment/policy/managementapp/account management-groupaz resource/group/lock/tag/deployment/policy/managementapp/account management-groupAuto-AssignAuto assign by botAuto assign by botAzure CLI TeamThe command of the issue is owned by Azure CLI teamThe command of the issue is owned by Azure CLI teamact-identity-squadcustomer-reportedIssues that are reported by GitHub users external to the Azure organization.Issues that are reported by GitHub users external to the Azure organization.questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as thatThe issue doesn't require a change to the product in order to be resolved. Most issues start as that
Describe the bug
az resource wait --customhonors--timeout, but when the custom condition remains false for the entire timeout, the command prints{}and exits with code0.A true condition also exits with code
0, so scripts and CI systems cannot distinguish condition satisfaction from timeout.The current
devsource still contains the apparent root cause insrc/azure-cli-core/azure/cli/core/commands/command_operation.py:WaitCommandOperation.waitreturns aCLIErrorobject on timeout instead of raising it.This appears to affect generic Azure CLI wait commands, not only this resource type.
Related command
Errors
No error is emitted. The timeout result is:
Issue script and debug output
Given an existing ARM resource whose
properties.connectivityStatusisConnected:Result:
{ "connectivityStatus": "Connected", "provisioningState": "Succeeded" }Positive control - true condition:
Observed:
Negative test - false condition:
Observed:
Impossible-condition test:
Observed:
The impossible value rules out a transient state transition. No resource identifiers or debug output are included because they are unnecessary for reproduction.
Expected behavior
When
--timeoutexpires before--customevaluates to true, the command should:Wait operation timed-out after <seconds> secondsor another clear timeout error.Environment Summary
The same timeout code path remains present on current
devcommitb92a89e7781c11a5ee8437a84ef4b8fd9edab4f0(August 27, 2026).Additional context
Related but not duplicate:
0on failure.