Hello @Stoyan Jordanov,
Are you sure you use the right Azure IoT Device Client SDK?
The latest stable version is:
Microsoft.Azure.Devices.Client -Version 1.41.3
Note: the 2.0 version is in preview.
I see an EventHubClient mentioned.
You should use the device client:
var client = DeviceClient.CreateFromConnectionString("");
Else, it could be the network.
can you check if the IoT Hub still allows public access from any location?
If this is a non-production site, you could try switching a few times between these settings, just to be sure the underlying logic is running as expected.
Next to that, the network your device is on, does it support access to the internet (check for outbound firewall rules, proxy settings, etc.)?
Finally, you can also try to see if you can reach the IoT Hub using a telnet session:
Here, I can telnet to the iot hub over the MQTT and AMQP ports (connected). The 5672 is not working (for comparison).
Note: I'm only interested in Connected or Trying. The telnet itself does nothing.
-
If the response helped, do "Accept Answer". If it doesn't work, please let us know the progress. All community members with similar issues will benefit by doing so. Your contribution is highly appreciated.