Using Azure Redis Cache for storing Session data, and for SignalR Backplane

554 views Asked by At

So, I'm preparing an older enterprise level ASP.net solution for a shift to Azure. We wanted to use a single Azure Redis Cache for both session state and for a SignalR Backplane.

As a new member of the team, unfamiliar with SignalR, I built the tutorial here as a starting place. From there, I set up the Session-State provider and was able to get that working. I did a blog post about it, but I don't have enough reputation to share yet. :/

But when it came time to implement the SignalR Redis backplane, I had no success.

Here is the code I tried:

using System;
using System.Configuration;
using Microsoft.AspNet.SignalR;
using Owin;
using Microsoft.Owin;
[assembly: OwinStartup(typeof(SignalRChat.Startup))]
namespace SignalRChat

{
    public class Startup
    {
        public void Configuration(IAppBuilder app)
        {
            if (ConfigurationManager.AppSettings["redis.enabled"] != null &&
                bool.Parse(ConfigurationManager.AppSettings["redis.enabled"]))
            {
                GlobalHost.DependencyResolver.UseRedis(ConfigurationManager.AppSettings["RedisCacheUrl"], 6380, ConfigurationManager.AppSettings["RedisCachePassword"], "Chat");
                app.MapSignalR();
            }
       }
    }       
}

This is an example of the error I get when firing up the website, and navigate to the page where SignalR calls are being made.

Is anyone successfully doing this?

0

There are 0 answers