IoT Edge Module commuincation using SignlR service

Dhanavath Vishnu 366 Reputation points
2023-01-03T15:13:40.437+00:00

Hi Team,
we are working on a solution, using SignalR service. The scenario is we are having two IoT edge modules, one is Backend (.NET) and other is Frontend (angular). When there is an event is raised by Backend Module it needs to be captured by the frontend module on IoT Edge Environment. for this we have chosen the SignalR service, because our frontend module is non-IoT edge module, just a simple docker container deployed on IoTEdge.

Local Setup:
In the local setup, the Backend module is deployed on IoTEdgeVM, using a port binding with host VM and Backend module able to create URL to integrate with that frontend angular code on local host. In this setup, event raise by the backend module is able to capture by the frontend angular UI, able to switch the screen according to the event.

IoTEdgeSetup:
Both modules deployed on the IoTEdge, this time the URL coded in the frontend code is the backend module name, hope it raise the event can be captured by the frontend module, but the frontend UI is not responding to that event.

Want to check with all of you, is this the right way to use the SignalR service, if not please suggest a right way to use it. If you know any alternative way to do this, please suggest.

Thanks for your valuable time and response.

D. Vishnu

Azure IoT Edge
Azure IoT Edge
An Azure service that is used to deploy cloud workloads to run on internet of things (IoT) edge devices via standard containers.
557 questions
Azure IoT Hub
Azure IoT Hub
An Azure service that enables bidirectional communication between internet of things (IoT) devices and applications.
1,149 questions
Azure SignalR Service
Azure SignalR Service
An Azure service that is used for adding real-time communications to web applications.
131 questions
{count} vote

Accepted answer
  1. LeelaRajeshSayana-MSFT 13,951 Reputation points
    2023-01-04T16:01:26.563+00:00

    Hi @Dhanavath Vishnu , thank you for your response. This URL mapping on the angular end depends on the way the SignalR hub is mapped on the back end .Net Program.cs file.

    For instance, if you have a SignalR class named "BaseHub" on the .Net application, your mapping on the Program.cs file might look something like the following

    app.MapHub<BaseHub>("hubs/basehub")  
    

    If your mapping is similar to above, your BaseSignalrHubUrl should be http://localhost:<port on which .net app runs>/hubs/.

    If the mapping on Program.cs file is similar to app.MapHub<BaseHub>("basehub"), then your BaseSignalrHubUrl should be http://localhost:<port on which .net app runs>/

    If this approach does not work, please let us know the configuration that worked for your local set up approach.

    Please keep us posted and let us know if you run into any issues.


    • Kindly accept answer or upvote if the response is helpful so that it would benefit other community members facing the same issue.
    • Original posters help the community find answers faster by identifying the correct answer. Here is how
    • I highly appreciate your contribution to the community.
    0 comments No comments

0 additional answers

Sort by: Most helpful