Azure WebPubSub 404 Error

Felix Gerdes 0 Reputation points
2023-08-18T13:16:35.0933333+00:00

Hi,

i connected my WebPubSub with locally running Azure Functions.

My Validation Function is reached via Http Trigger.

I want to run this function when a new message appears

        [Function("message")]
        [WebPubSubOutput(Hub = "flowmodeller")]
        public SendToAllAction Run(
        [WebPubSubTrigger("flowmodeller", WebPubSubEventType.User, "message")] UserEventRequest request)
        {
            return new SendToAllAction
            {
                Data = BinaryData.FromString($"[{request.ConnectionContext.UserId}] {request.Data.ToString()}"),
                DataType = request.DataType
            };
        }

But the Service throws an 404. What did i wrong?

User's image

Azure Web PubSub
Azure Web PubSub
An Azure service that provides real-time messaging for web applications using WebSockets and the publish-subscribe pattern.
60 questions
Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,283 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. brtrach-MSFT 15,256 Reputation points Microsoft Employee
    2023-08-19T17:50:22.8066667+00:00

    @Anonymous Hello! It seems like you are trying to use Azure Web PubSub with Azure Functions and you are getting a 404 error. The error message you provided indicates that the service is not able to find the endpoint you are trying to access.

    There could be several reasons why you are getting a 404 error. One possible reason is that the endpoint you are trying to access is not configured correctly. Please make sure that you have configured the endpoint correctly and that it is accessible from the internet.

    First, let's check if the endpoint you are trying to access is configured correctly. You can do this by checking the following:

    Make sure that the URL you are using to access the endpoint is correct. Double-check the URL to make sure that it is spelled correctly and that it includes the correct port number if necessary.

    Check that the endpoint is accessible from the internet. You can do this by trying to access the endpoint from a different machine or network. If you are unable to access the endpoint from a different machine or network, then there may be a firewall or network configuration issue that is preventing access.

    Check that the endpoint is running and listening for incoming requests. You can do this by checking the logs for your application or by using a tool like netstat to see if the endpoint is listening on the correct port.

    Another possible reason is that the request is not being routed correctly. Please make sure that you have configured the routing rules correctly and that the request is being routed to the correct endpoint.

    Here are some things to check:

    Make sure that the routing rules are configured correctly. Double-check the routing rules to make sure that they are set up correctly and that they are routing requests to the correct endpoint.

    Check that the routing rules are being applied correctly. You can do this by checking the logs for your application or by using a tool like tcpdump to see if the requests are being routed to the correct endpoint.

    If you have checked all of these items and are still having trouble, then there may be an issue with your code. You can try debugging your code to see if there are any issues that are causing the 404 error.

    If you are still having trouble, please provide more information about your setup and the steps you have taken so far. This will help me provide a more specific answer to your question.