-
Notifications
You must be signed in to change notification settings - Fork 3.4k
az iot ops check fails with KeyError: 'serviceName' in azure-iot-ops extension #31562
Copy link
Copy link
Closed
Labels
Auto-AssignAuto assign by botAuto assign by botIoTIoT/CLIPossible-SolutionService AttentionThis issue is responsible by Azure service team.This issue is responsible by Azure service team.Similar-IssuebugThis 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.
Metadata
Metadata
Assignees
Labels
Auto-AssignAuto assign by botAuto assign by botIoTIoT/CLIPossible-SolutionService AttentionThis issue is responsible by Azure service team.This issue is responsible by Azure service team.Similar-IssuebugThis 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.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Describe the bug
Running the az iot ops check command results in a KeyError: 'serviceName'. The command fails during the evaluation of broker listeners, indicating that the CLI extension expects a serviceName key in the listener spec, which is missing in the actual data.
Related command
az iot ops check --debug
Errors
KeyError: 'serviceName'
File ".../check/mq.py", line 158, in evaluate_broker_listeners
listener_spec_service_name: str = listener_spec["serviceName"]
Issue script & Debug output
az iot ops check --debug
logs7.txt
Expected behavior
The command should handle missing or optional fields gracefully and not crash due to missing keys in the resource spec.
Azure CLI version: az version output:
{
"azure-cli": "2.61.0",
"azure-iot-ops": "1.5.0",
...
}
Environment Summary
Azure CLI Version:
azure-cli 2.73.0
core 2.73.0
telemetry 1.1.0
Extensions:
azure-iot-ops 1.5.0
connectedk8s 1.10.7
Dependencies:
msal 1.32.3
azure-mgmt-resource 23.3.0
Python (Linux) 3.12.8 (main, May 13 2025, 11:04:53) [GCC 13.3.0]
Azure IoT Ops Extension Version: 1.5.0
Operating System: Ubuntu 24.04 tls (running on Azure VM vm3)
Kubernetes Cluster: k3s (lightweight Kubernetes distribution)
Namespace: azure-iot-operations
Cluster Node: vm3
Broker Version: 1.1.7
Additional context
logs7.txt