GET /blog/typos-in-azure-redis-cache-access-keys-can-result.md text/markdown back to the human version
---
title:        "Typos in Azure Redis Cache access keys can result in headaches"
description:  "Have you ever encountered the following error: StackExchange.Redis.RedisConnectionException? With this post I hope to save you time that I lost in my struggle finding the answer."
url:          https://www.jeroenfurst.nl/blog/typos-in-azure-redis-cache-access-keys-can-result
date:         2015-07-02
category:     Azure and cloud hosting
tags:         [Azure and cloud hosting]
reading_time: 1
---

# Typos in Azure Redis Cache access keys can result in headaches

> Have you ever encountered the following error: StackExchange.Redis.RedisConnectionException? With this post I hope to save you time that I lost in my struggle finding the answer.

A few weeks ago I ran across a big yellow screen exception stating:

**StackExchange.Redis.RedisConnectionException: No connection is available to service this operation: EVAL**

After some Googling I was heading in the complete wrong direction assuming that the Redis Cache was somehow corrupted and required to be flushed. So the next thing I did is login into the Azure Portal desperately looking for a way to restart or flush the Redis Cache. I guess it was not my lucky day :)

Because I already had yellow belt Powershell skills, I decided to look for a programmatic way of flushing the Redis Cache. Jackpot! Check out the following article from Aaron Saikovski containing the script: [How to flush the Azure Redis Cache with PowerShell](https://aaronsaikovski.wordpress.com/2015/05/18/how-to-flush-the-azure-redis-cache-with-powershell).

I copied the code, added the host and key from the web.config, ran the script and BAM:

**Exception calling "Connect" with "2" argument(s): "It was not possible to connect to the redis server(s); to create a disconnected multiplexer, disable AbortOnConnectFail. SocketFailure on PING"**

Back to the drawing board! The most logical solution to me at this time was to delete the Redis Cache and recreate it. To make a long story short, I noticed after creating the new Redis Cache that the access key that I used previously had a small typo (missing the equals sign at the end). After correctly copy/pasting the key all started working again!

I guess that is why in Azure portal they have these nice little buttons to copy the keys :)

![Copy key](~/getContentAsset/b7be667c-aed3-4f95-8181-1843321712a2/310c1ea5-13ca-4d75-95a0-620f51989b44/6ac3c1cb_copy_key.png.png)