Hello Craig Webb,
It sounds like you're trying to connect a C# service on a customer PC to Azure IoT Hub while routing through an Application Gateway.
This isn’t directly supported because the IoT Hub uses specific protocols that the Application Gateway isn't designed to handle effectively, especially with MQTT and WebSocket communications.
Here are a few things you can try:
- Direct Connection: Instead of routing through the Application Gateway, consider allowing direct connections to the IoT Hub from your C# service. This is the simplest way to ensure that the service can communicate effectively using MQTT or MQTT over WebSocket. https://learn.microsoft.com/en-us/azure/iot-hub/iot-hub-devguide-protocols
- Use IoT Edge as field Gateway: If your architecture needs to use an Application Gateway for other reasons (e.g., security, logging), consider deploying an IoT Edge device that can act as a proxy. The IoT Edge device would be responsible for managing the connection from downstream devices to the IoT Hub.
https://learn.microsoft.com/en-us/azure/iot-edge/iot-edge-as-gateway
Hope this helps you get closer to a solution!
Thank you!