You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Trying to add multiple ServerlessHub in one azure function .NET 5 project.
Having "No job functions found. Try making your job classes and methods public. If you're using binding extensions (e.g. Azure Storage, ServiceBus, Timers, etc.) make sure you've called the registration method for the extension(s) in your startup code (e.g. builder.AddAzureStorage(), builder.AddServiceBus(), builder.AddTimers(), etc.).".
public class ChatHub : ServerlessHub
{
[FunctionName("negotiate")]
public SignalRConnectionInfo Negotiate([HttpTrigger(AuthorizationLevel.Anonymous)] HttpRequest req)
{
return Negotiate(req.Headers["x-ms-signalr-user-id"], GetClaims(req.Headers["Authorization"]));
}
[FunctionName(nameof(OnConnected))]
public async Task OnConnected([SignalRTrigger]InvocationContext invocationContext, ILogger logger)
{
if (invocationContext.Claims.TryGetValue("id", out var groupName))
{
await Groups.AddToGroupAsync(invocationContext.ConnectionId, groupName);
logger.LogInformation($"{invocationContext.ConnectionId} has connected");
}
else
{
logger.LogInformation($"{invocationContext.ConnectionId} does not have id claim");
}
}
[FunctionName(nameof(OnDisconnected))]
public async Task OnDisconnected([SignalRTrigger]InvocationContext invocationContext, ILogger logger)
{
if (invocationContext.Claims.TryGetValue("id", out var groupName))
{
await Groups.RemoveFromGroupAsync(invocationContext.ConnectionId, groupName);
logger.LogInformation($"{invocationContext.ConnectionId} disconnected");
}
else
{
logger.LogInformation($"{invocationContext.ConnectionId} does not have id claim");
}
}
}
The text was updated successfully, but these errors were encountered:
.NET 5 function project has an isolated-process model, and you have to use the package Microsoft.Azure.Functions.Worker.Extensions.SignalRService. ServerlessHub is in Microsoft.Azure.WebJobs.Extensions.SignalRService package, so not supported in .NET 5 function project. We are investigating into how to provide a similar developing experience in isolated-process model.
Trying to add multiple ServerlessHub in one azure function .NET 5 project.
Having "No job functions found. Try making your job classes and methods public. If you're using binding extensions (e.g. Azure Storage, ServiceBus, Timers, etc.) make sure you've called the registration method for the extension(s) in your startup code (e.g. builder.AddAzureStorage(), builder.AddServiceBus(), builder.AddTimers(), etc.).".
The text was updated successfully, but these errors were encountered: