Azure / Azure/azure-iot-cli-extension
[bug] Issue sending device to cloud messages
- Dominant language
- Python
- Stars
- 88
- Forks
- 78
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 9
Description
**Describe the bug**
I am having an issue sending device to cloud message (send-d2c-message) to my iot hub.
**To Reproduce**
The following commands fails
`az iot device send-d2c-message -n 'hub-name' --data 'hello' -d 'device-name' --verbose`
With the following message:
```
Using policy 'iothubowner' for IoT Hub interaction.
[WinError 10054] An existing connection was forcibly closed by the remote host
Command ran in 2.898 seconds (init: 0.232, invoke: 2.665)
```
If I change the hub name, it fails with the following message:
```
Unable to find IoT Hub: XXXX in current subscription SSSS.
Command ran in 1.583 seconds (init: 0.289, invoke: 1.294)
```
So it's not a incorrect hub name
If I change the device id to one that is not registered, then it fails with the same message, so I can't confirm whether or not that is the issue. Although I am copy-pasting from the device overview tab in the hub.
**Expected behavior**
Expect the message to be sent through
**Environment (please complete the following information):**
- OS Name: Microsoft Windows 10 Enterprise
- OS Version: 10.0.19042 N/A Build 19042
- Shell: Powershell
- Az CLI version: 2.21.0
- IoT extension version: 0.10.10
- Python version (if pip installed): python 3.9, pip 21.0.1
Contributor guide
Assessment
This issue has not been assessed yet.