-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not able to monitor by IoT hub with az iot hub monitor-events #81
Comments
Hey @venkin84 , sorry for the extremely delayed response. Is this still an issue with the latest extension? |
Closing issue due to lack of activity. Please try with the latest IoT extension version and we can reopen/revisit if its still a problem. |
This is still an issue |
re-opening issue. @andrewholler can you post the debug output with the latest IoT CLI extension version? Also please include the az version output. |
@vilit1 here are the version and debug logs as requested. I actually seem to have narrowed down the issue. I am testing from a network-restricted IoT Hub and VPN from on-prem environment. After reviewing the logs I suspected I might be dealing with a FW issue since this command only seems to use AMQP connections. I disconnected from the VPN, I disabled my proxy environment variables, and opened the IoT Hub to "All networks". I re-ran the monitor-events command and started successfully reading the IoT Hub. I sent some messages to the IoT Hub from node.js generated code from the IOT Hub VS Code extension and saw them come through my monitor-events command in the CLI. The issue I suspect, was a firewall issue attempting to egress my company firewall on port 5671. I don't know the specifics and if IoT Hub supports monitoring incoming messages with HTTPS, but if it did, it would be a useful to specify which protocol is used for the monitor-events command. In that case, traffic could egress through my company proxy instead of requiring a firewall rule.
|
We use uamqp in the CLI (https://github.com/Azure/azure-iot-cli-extension/blob/dev/azext_iot/monitor/telemetry.py#L102). This is the only supported protocol for reading messages from the hub as of now: https://learn.microsoft.com/en-us/azure/iot-hub/iot-hub-devguide-messages-read-builtin |
AMQP over WebSockets on port 443 would work just as well for the purposes of acceptable proxy traffic. Any traffic over 443 would work with most proxies. If we were able to toggle which protocol to use, that would be useful. |
I have added this feature request to the backlog but it is pending prioritization. For now, please use the workaround you found. |
I am not able to monitor my IoT hub with the Azure CLI command...
az iot hub monitor-events -n "IoT hub name" --login "Connect String"
When I try to do the same I get the following error...
Starting
event monitor, use ctrl-c to stop...Failed to open Message Receiver. Please confirm credentials and target URI.
The command failed with an unexpected error. Here is the traceback:
Failed to open Message Receiver. Please confirm credentials and target URI.
Traceback (most recent call last):
File "C:\Users\VSSADM
1\AppData\Local\Temp\pip-install-76yvurxi\knack\knack\cli.py", line 206, in invoke1\AppData\Local\Temp\pip-install-76yvurxi\azure-cli-core\azure\cli\core\commands_init_.py", line 575, in executeFile "C:\Users\VSSADM
File "C:\Users\VSSADM
1\AppData\Local\Temp\pip-install-76yvurxi\azure-cli-core\azure\cli\core\commands_init_.py", line 633, in _run_jobs_serially1\AppData\Local\Temp\pip-install-76yvurxi\azure-cli-core\azure\cli\core\commands_init_.py", line 626, in run_jobFile "C:\Users\VSSADM
File "C:\Users\VSSADM
1\AppData\Local\Temp\pip-install-76yvurxi\six\six.py", line 693, in reraise1\AppData\Local\Temp\pip-install-76yvurxi\azure-cli-core\azure\cli\core\commands_init.py", line 603, in run_jobFile "C:\Users\VSSADM
File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-install-76yvurxi\azure-cli-core\azure\cli\core\commands_init.py", line 305, in call
File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-install-76yvurxi\azure-cli-core\azure\cli\core_init_.py", line 470, in default_command_handler
File "C:\Users\e452034.azure\cliextensions\azure-cli-iot-ext\azext_iot\operations\hub.py", line 1332, in iot_hub_monitor_events
devices=device_ids)
File "C:\Users\e452034.azure\cliextensions\azure-cli-iot-ext\azext_iot\operations\events3_events.py", line 66, in executor
raise RuntimeError(error)
RuntimeError: Failed to open Message Receiver. Please confirm credentials and target URI.`
Note: I have also tried to monitor my IoT hub via iothub-explorer and Service bus explorer. But I am also not able to monitor with them as well.
I am able to do other things though hence there seems to be no issue with the connection string I am using.
The text was updated successfully, but these errors were encountered: