Closed afangster closed 1 year ago
Can you first try running the az iot hub monitor-events
command with the repair flag (--repair
). This should reinstall uamqp to the correct version. You can also do pip freeze
to check the uamqp version installed.
Also for curiosity, can you let me know what version of uamqp you currently have installed (before running the command with the repair flag).
Running az iot hub monitor-events -n iothub --repair true
still resulted in:
Dependency update (uamqp 1.2) required for IoT extension version: 0.21.3.
Continue? (y/n) -> y
Updating required dependency...
Update complete. Executing command...
Starting event monitor, use ctrl-c to stop...
ErrorCodes.UnknownError: Connection in an unexpected error state.
Error in sys.excepthook:
Original exception was:
Error in sys.excepthook:
Original exception was:
Error in sys.excepthook:
Original exception was:
Error in sys.excepthook:
Original exception was:
Error in sys.excepthook:
Original exception was:
Error in sys.excepthook:
Original exception was:
Error in sys.excepthook:
Original exception was:
Error in sys.excepthook:
Original exception was:
I am not sure what version I had installed. Running pip freeze
yielded no output.
I have more questions:
--login
with the connection string for auth? What auth type did you use for the Azure Cloud Shell?az iot hub device-identity list -n {iothub_name}
)You can also do a sanity check by creating a new hub with az iot hub create
and running the monitor-events command with that hub.
--login
. I usually just use -n iothub_name
. There are 3 authentication types for the CLI for now:
a. --login
in which you would provide the connection string for the IoT Hub. We would want this connection string to be one that has the shared access key name as iothubowner. You can get the connection string with az iot hub connection-string show -n {hub_name} --pn iothubowner
b. --auth-type key
in which the CLI retrieves the necessary connection string for you.
c. --auth-type login
in which the CLI uses your credentials against RBAC permissions.
You can assign defaults to --auth-type
, which you can check using az configure -l
Do other uamqp dependent commands work for you too (ex: az iot hub monitor-feedback
)?
The easiest way is to check from the portal, you should go to your hub information and click on networking. If there is any IP filter rules, then Selected IP ranges would be checked (with a list of IP's that the Hub accepts). For Private Endpoints, you need to go to the Private Access tab and check if there are any endpoints. Here are images of my test hub (that has no network configurations enabled that could affect connection).
If this does not work, we recommend opening an Azure support ticket for a more focused investigation of your environment.
az configure -l
on both the cloud shell and on my local powershell just outputs []. I just run az iot hub monitor-events -n iothub
on the cloud shell for output. I don't use --login
. In my original post, I was running az iot hub monitor-events --login {connection string}
with the connection string for iothubowner.az iot hub monitor-feedback
works for me. It just says
Starting C2D feedback monitor, use ctrl-c to stop...
without any error messages.
az iot device simulate
)az iot device send-d2c-message
)You can open a support ticket by going to your hub's page in portal and scrolling all the way down on the left menu. There should be a New Support Request link under Support + troubleshooting
Thank you for the help! Honestly have no idea why only this command is not working.
Turns out it was indeed a network issue.
I will close this issue then. If you see any other issues, feel free to create a new issue within this repo.
Describe the bug Command used:
Errors:
More details when run
az iot hub monitor-events --login {connection string}
:I have run this command in my Azure Cloud Shell and it works fine there. However, it fails when I run it locally as given above.
To Reproduce Steps to reproduce the behavior:
az iot hub monitor-events -n {iothub_name}
Expected behavior I expected to see a live updated list of my sensor data as I did when running it on Azure Cloud Shell. Example as follows:
Environment (please complete the following information):
Additional context Add any other context about the problem here.