I have created a project where I implemented the "Negotiate" API to create the SignalR connection.
My client is in JavaScript having reference of "@microsoft/[email protected]".
On the Server side, I have implemented the "Negotiate" API as below.
I am using the following versions of the references:
Microsoft.AspNetCore.Http -> v 8.0 Microsoft.Azure.Functions.Worker -> v 1.21.0 Microsoft.Azure.Functions.Worker.Extensions.SignalRService -> v 1.13.0 Microsoft.Azure.Functions.Worker.Sdk -> v 1.17.0
using Microsoft.AspNetCore.Http;
using Microsoft.Azure.Functions.Worker;
using Microsoft.Extensions.Logging;
namespace TestSignalRProj
{
public class SignalRNegotiate
{
private readonly ILogger<SignalRNegotiate> _logger;
public SignalRNegotiate(ILogger<SignalRNegotiate> logger)
{
_logger = logger;
}
[Function(nameof(Negotiate))]
public static string Negotiate(
[HttpTrigger(AuthorizationLevel.Anonymous, "get", "post")] HttpRequest req,
[SignalRConnectionInfoInput(HubName = "submission")] string connectionInfo)
{
return connectionInfo;
}
}
}
When I tried to get a response from Postman, it did not return any value.
Reference URL I used to implement : Azure Functions SignalR Service input binding


Output:
I have addressed this matter by changing the return type from
stringtoHttpResponseDataclass within theMicrosoft.Azure.Functions.Worker.Httpnamespace. Additionally, I have updated the request object fromHttpRequesttoHttpRequestData, resulting in the following code structure. Reference : Azure SignalR Service