IOT HUB Ip has been prevented to connect to the endpoint

59453771 0 Reputation points
2023-02-02T15:21:42.6433333+00:00

Hello,

All of a sudden IOT HUB service endpoint stopped working.

I am getting following error

<Error>

<Code>401</Code>

<Detail>Ip has been prevented to connect to the endpoint. For more information see: Virtual Network service endpoints: Event Hubs: https://go.microsoft.com/fwlink/?linkid=2044192 Service Bus: https://go.microsoft.com/fwlink/?linkid=2044235 IP Filters: Event Hubs: https://go.microsoft.com/fwlink/?linkid=2044428 Service Bus: https://go.microsoft.com/fwlink/?linkid=2044183 TrackingId:5c238b25-a0c2-46b5-a6f0-ec17a3f2e39e_G2S2, SystemTracker:iothub-ns-flowbird-t-17196010-26c0b098ac.servicebus.windows.net:, Timestamp:2023-02-02T15:15:50</Detail>

</Error>

When trying to connect the EventHubClient.CreateFromConnectionString

All was fine yesterday and now it just stopped

Any ideas?

Best regards:
Stoyan

Azure IoT Hub
Azure IoT Hub
An Azure service that enables bidirectional communication between internet of things (IoT) devices and applications.
1,078 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Sander van de Velde 26,796 Reputation points MVP
    2023-02-02T16:27:10.3833333+00:00

    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?

    User's image

    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:

    User's image

    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.