I am trying to connect to an instance of the Azure Redis Cache (Preview) from a Visual Studio Web Project.
I am getting the following error: "Could not load file or assembly 'Authorization token passed by user Invalid".
I have done the following: 1) Logged into Azure Portal and created a new Redis Cache PREVIEW 2) Opened Visual Studio and created New Project (Web MVC) 3) Manage Nuget Packages - Update All 4) Install Package - "Windows Azure Cache Version 2.2.0.0" 5) Open Web.Config, in dataCacheClients section to the following:
<dataCacheClients>
<dataCacheClient name="default">
<autoDiscover isEnabled="true" identifier="mycache.redis.cache.windows.net" />
<securityProperties mode="Message" sslEnabled="false">
<messageSecurity authorizationInfo="xxxxxxxmykeyxxxxxxxx"/>
</securityProperties>
</dataCacheClient>
</dataCacheClients>
6) Changed HomeController.cs to the following:
using Microsoft.ApplicationServer.Caching;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
namespace CacheRedisTest.Controllers
{
public class HomeController : Controller
{
static DataCacheFactory myFactory;
static DataCache myCache;
public ActionResult Index()
{
if (myCache == null)
{
myFactory = new DataCacheFactory();
myCache = myFactory.GetDefaultCache();
}
return View();
}
}
}
Do I need some other nuget packages specific to Redis? Also where do I put the port number which is mentioned in the Azure console?
Thanks for reading