C#C
C#3y ago
Hulkstance

❔ Trying to use Azure SignalR Service as Backplane and for client affinity (Sticky sessions)

Pretty self explanatory title. However, I'm getting CORS issue as you can see in the image.

services.AddSignalR().AddAzureSignalR("Endpoint=https://xxx.signalr.net;AccessKey=xxx;Version=1.0;");

...

app.MapHub<NotificationHub>("/notification");

const connection = new HubConnectionBuilder()
    .withUrl(`${apiRoutes.root}/${HUB_NAME}`, {
        accessTokenFactory: () => authUser.accessToken || ''
    })
    .configureLogging(LogLevel.Information)
    .withAutomaticReconnect()
    .build();

services.AddCors(o => o.AddPolicy("AllowAll", builder =>
    {
        builder.AllowAnyOrigin()
            .AllowAnyMethod()
            .AllowAnyHeader();
    }));
image.png
Was this page helpful?