Make clients writen in Unity listen to when my azure function endpoint

jdelaay025 21 Reputation points
2021-07-25T14:36:05.397+00:00

I am writing a simple app. I will have one client make an HTTP request and I want every other client to know that the request was made.
Here is my example:

endpoint: URI exampleURI = new URI("exampleuri.azurewebsites.net/api/shootshot");

Client one on a mobile device anywhere in the world
hits exampleURI via UnityWebRequest and passes
bulletData
{
bulletID: 000000,
bulletPosition:x,y,z
}

All other Clients on whatever device anywhere else in the world
see that the request was made and can see bulletData that was passed to the endpoint.

This works on localhost of course because I can just use the HttpListener class (c#). But when I try to listen to my function app that's hosted in azure, it won't actually track it.

I know this is definitely due to my lack of knowledge of how HTTP listening is done. Now I'm trying to learn

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,978 questions
Azure SignalR Service
Azure SignalR Service
An Azure service that is used for adding real-time communications to web applications.
142 questions
Azure Event Grid
Azure Event Grid
An Azure event routing service designed for high availability, consistent performance, and dynamic scale.
379 questions
0 comments No comments
{count} votes

Accepted answer
  1. Pramod Valavala 20,626 Reputation points Microsoft Employee
    2021-07-26T04:16:48.69+00:00

    @jdelaay025 Azure SignalR is probably the best solution here. You would have all clients connected to Azure SignalR Service and then leverage SignalR Output Bindings to send a message to all other devices when one device makes the request.

    This is better suited since you won't have control over networks across all your clients and in case of SignalR, just outbound connectivity is required on standard ports.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.