-
Notifications
You must be signed in to change notification settings - Fork 3.4k
az aks command does not always honor --output parameter #31157
Copy link
Copy link
Open
Labels
AKSaz aks/acs/openshiftaz aks/acs/openshiftAuto-AssignAuto assign by botAuto assign by botService AttentionThis issue is responsible by Azure service team.This issue is responsible by Azure service team.act-observability-squadbugThis issue requires a change to an existing behavior in the product in order to be resolved.This 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.Issues that are reported by GitHub users external to the Azure organization.
Description
Describe the bug
If I am using az aks command invoke and the related az aks command result, using --output json does not always return JSON content.
Related command
az aks command
Errors
Command output is not in JSON.
Issue script & Debug output
For example, I have a job which I want to wait for completion. I am using the following command:
az aks command invoke --resource-group my-rg --name my-cluster --command 'kubectl wait --for=condition=complete --timeout=10m -n my-namespace jobs/my-job' --no-wait --output jsonThis returns the following output in non-json:
command id: 70f2846682cf4cd38aa36857d4274570, started at: None, status: Running
Please use command "az aks command result -g my-rg -n my-cluster -i 70f2846682cf4cd38aa36857d4274570" to get the future execution resultThen if I check on the status of the command, I see the same issue (note the status is still "running"):
az aks command result --resource-group my-rg --name my-cluster --command-id 70f2846682cf4cd38aa36857d4274570 --output json
command id: 70f2846682cf4cd38aa36857d4274570, started at: 2025-03-30T02:28:31Z, status: Running
Please use command "az aks command result -g my-rg -n my-cluster -i 70f2846682cf4cd38aa36857d4274570" to get the future execution resultHowever, once the job finishes, the command does return JSON as expected:
az aks command result --resource-group my-rg --name my-cluster --command-id 70f2846682cf4cd38aa36857d4274570 --output json
{
"exitCode": 0,
"finishedAt": "2025-03-30T02:31:34+00:00",
"id": "70f2846682cf4cd38aa36857d4274570",
"logs": "job.batch/my-job condition met\n",
"provisioningState": "Succeeded",
"reason": null,
"startedAt": "2025-03-30T02:28:31+00:00"
}Expected behavior
Our expectation is that the command should always return JSON if specified as a parameter.
Environment Summary
az version
{
"azure-cli": "2.70.0",
"azure-cli-core": "2.70.0",
"azure-cli-telemetry": "1.1.0",
"extensions": {}
}Additional context
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
AKSaz aks/acs/openshiftaz aks/acs/openshiftAuto-AssignAuto assign by botAuto assign by botService AttentionThis issue is responsible by Azure service team.This issue is responsible by Azure service team.act-observability-squadbugThis issue requires a change to an existing behavior in the product in order to be resolved.This 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.Issues that are reported by GitHub users external to the Azure organization.