azure-signalr icon indicating copy to clipboard operation
azure-signalr copied to clipboard

Improve diagnostic information and steps for upstream 404 failures.

Open oadrian2 opened this issue 4 years ago • 1 comments

I have setup an upstream connection targeting my JavaScript Azure Function app. The problem is between the library and the Azure SignalR logs, all it's telling me is that I have a 404, but I'm not sure what to do next. The system connects and functions via direct posts to function endpoints, but the connection.invoke(<messageName>, ...args) doesn't. I am currently at a loss and the libraries nor the documentation seem to show what to do in this particular case in terms of next steps.

The function name matches the invoke call. The function works when hit directly via post. The endpoint is using the signalr_extension key. When given the wrong key, I get a 401, instead. The SignalR logs show that a 404 happened.

If there are common missteps, it would be nice if the error messages would suggest fixes. E.g.: Invocation failed, status code 404 isn't very helpful compared to something like:

Warning: Each child in a list should have a unique "key" prop.
Check the render method of `Supply`. See https://reactjs.org/link/warning-keys for more information.

oadrian2 avatar Jan 19 '21 19:01 oadrian2

I eventually figured out the issue, but there are currently two different supported syntaxes for SignalR. One uses the new trigger syntax for SignalR with upstream configuration. The other still supports SignalR + Azure Functions, but uses a different syntax. And since both are currently supported, neither indicates that it is out-of-date.

One particular help might be if no endpoint actions were detected using upstream, giving a warning. Understandably that might not be advisable if discovery would open up security vulnerabilities. Another possibility might be a migration page showing how to migrate from pre-upstream HTTP triggers to SignalR triggers.

Ultimately, only one !Note box shows how to handle upstream. And searching via Google (or other search engine) is just as likely to pull up the older pre-upstream syntax.

oadrian2 avatar Jan 21 '21 00:01 oadrian2