17

Due to some issue where I need to clear all the cache data on the Redis cache hosted on the Azure.In other words by using the Azure portal.Not by using my application.One option I can think of is,Delete the Redis cache instance and recreate it.But do you know better way for doing that ? I'm using StackExchange.Redis.dll

Update 2 :

Could you tell me how to get public key in PEM format ? On the doc here it says this The easiest way to run this command in Windows - MSYS2.I don't have any idea about that.

enter image description here

Update 1 :

Could you tell me why this is happening when I use the redis-cli ?

enter image description here

Sampath
  • 63,341
  • 64
  • 307
  • 441
  • I don't think it's possible in Azure Portal. However, you can use [redis-cli](http://redis.io/topics/rediscli) to issue [FLUSHDB](http://redis.io/commands/FLUSHDB) command. See This answer: http://stackoverflow.com/questions/6851909/how-do-i-delete-everything-in-redis. – qbik May 14 '16 at 15:57
  • @qbik Yes,but how can I run those commands on azure portal ? How to connect redis db on the azure from my local machine ? Is there any GUI where I can use it ? – Sampath May 14 '16 at 16:13

2 Answers2

32

For Azure's Redis service, the Azure portal has a built-in console (which is in Preview):

console button

At this point, it's as simple as executing a flushall command:

flushall

If you're running Redis in, say, a VM, you'll need to use a tool to connect remotely to the cache and run the flushall command.

David Makogon
  • 69,407
  • 21
  • 141
  • 189
  • for me it's disabled.do you know why ? – Sampath May 14 '16 at 23:48
  • @Sampath The console is available for Standard and Premium tiers. If yours is disabled, you're likely running Basic tier. Here's the [faq](https://azure.microsoft.com/en-us/documentation/articles/cache-faq/) which calls this out. As I stated in my answer - if you use a local redis tool on your computer that supports console, you can then issue commands that way, just by connecting to your Azure Redis cache with credentials provided in the portal. – David Makogon May 15 '16 at 00:51
  • This is really BAD.The Basic tier is for the Development and Testing.We need `console` mostly on that stage.But you guys have disabled it for the most needed tier.Which is disappointing :( Anyway I have updated the question.Can I have a feedback for that too ? – Sampath May 15 '16 at 01:08
  • 2
    @Sampath First: I'm not part of "you guys" - I don't work on the Azure product team. Second: The feature you seek is freely available via desktop tool (a simple search for `redis desktop manager` should enlighten you) - there is nothing stopping you from doing what you need to do, today, without a portal-based console. – David Makogon May 15 '16 at 01:11
  • Aha..I thought you're also a member of that product team.Anyway thanks for the clarification :) I have updated the question. Please see the `Update 2` section. – Sampath May 15 '16 at 01:37
  • 2
    This must have changed at some point as the console is currently available for me in the basic tier. – Steve Sanders Sep 26 '17 at 19:58
0

You can use

https://marketplace.visualstudio.com/items?itemName=gbnz.redis-cache-clear

which is a basic devops extension. Use '*' in the value, it will flush all redis data