Alternative title: Note to self, read the fucking manual
I am working on a piece of software that requires access to a redis instance in order to store a "local" copy of some information. Since the application I am working on is hosted on Azure it seemed only natural that I would use the Azure Redis Cache. So I read a little about it, and got started provisioning a cache. I have not used it before, and I expected the experience to be smooth.
But it didn't work
The cache was live but I could not access it using the StackExchange.Redis library. It kept giving me errors like this.
Additional information: It was not possible to connect to the redis server(s); to create a disconnected multiplexer, disable AbortOnConnectFail. UnableToResolvePhysicalConnection on PING
and when I looked more closely.
myshinynewcache.cache.windows.net:6379 faulted: SocketFailure on PING
I tried a bunch of different things.
- Dropping the cache and creating a new one
- Changing the connect timeout properties of the connection to something unrealistically large
- Creating a cache in Southeast Asia rather than West Europe (since I am in the Philippines ATM)
- Animal sacrifices and crying
Nothing seemed to work, and I started to grow a bit frustrated..
Then I sat down and read the manual
I had thought the process of setting up a cache so straightforward that I only rushed through the basics of Azure Caching before provisioning my first instance. Completely ignoring a crucial piece of information: There are two different kinds of Azure caching.
Before I created my first cache instance this is what the Azure Management Portal looked like.
And this is what my mind picked up when scanning the page.
So I went on to click the button that took me to the page about how to provision an Azure Managed Cache Service instance using command line tools. Unfortunately for me, this is not the same as an Azure Redis Cache instance.
The two different options do, however, share enough similarity that I continued to use the Azure Managed Cache Service instance as if it had been an Azure Redis Cache instance. No wonder it didn't work!
So here I am
After having spend my morning not really achieving anything, except perhaps slightly higher blood pressure, I finally got it to work simply by logging in to the new Azure Portal where, unlike the old management portal, you can actually provision a Redis Cache instance from the interface.
Judging from the many hits on the error messages I googled along the way, I am not the only one to have made this mistake. I hope this blog post will help others who are barking up the wrong cache.
For me, I am just glad I got it working. Although it is a bit embarassing to have spent a couple of hours running in the wrong direction when the headline of the page in Azure is "Looking for the new Azure Redis Cache?".
Note to self: Stop, and take the time to read the manual.