Connecting to a remote (Azure) Redis Console on Windows via Redis CLI

Installing the Redis CLI

You'll need the Chocolatey package manager if you have not yet installed this.

choco install redis-64

Connecting to the remote instance

Find the password/access key on
Azure > Home > Redis Caches > my-redis-db > Access keys>

Then whip out our favourite shell

redis-cli -h my-redis-db.redis.cache.windows.net -p 6379 -a <access key on Azure>

Useful commands

# Show all keys
keys *

# Remove all keys
flushall

# Monitor gets and sets
monitor

# Check server info
info
info clients
info stats

# Filter keys by some pattern
keys *somepattern*

# Remove key
del myKey

# Remove set of keys by pattern
EVAL "return redis.call('del', unpack(redis.call('keys', ARGV[1])))" 0 *some pattern*

# Kill all connected clients
CLIENT KILL TYPE normal
CLIENT KILL TYPE slave
CLIENT KILL TYPE pubsub

# Checking for hits and misses using powershell
redis-cli -h my-redis-db.redis.cache.windows.net -p 6379 -a <access key on Azure> info | select-string -Pattern "keyspace_"

# Read key value of hash type
HGETALL {my-web-www_dtq1wglmrksaiqhgsvrxdour}_Data

# Read key value of string 
MGET "foo"

# Search for big keys
--bigkeys

comments powered by Disqus