Now that we have created our Redis Cache lets connect to it. You can use the most common tool redis cli.exe https://redis.io/download or as I am going to do, use the Azure Portal to use the console directly, this isn’t probably the best way but it’s the easiest for this blog. 2 key points here:
When your cache is part of a VNET, only clients in the VNET can access the cache. Because Redis Console runs in your local browser, which is outside the VNET, it can’t connect to your cache.
Not all Redis commands are supported in Azure Cache for Redis.
Back in Azure right at the top of your Redis page you will see console.
Click it and take note of the warning, don’t get over excited running heavy commands in production.
First command : INFO
Lets set and retrieve a key.
SET mainkey “alpha123”
What about setting a key and expiring it? Here I set this to 100 and after 12 seconds I want to expire it. First time I run get was within 3 seconds thus returned the value, another 10 seconds later NULL.
Obviously, you will want to hook up your web apps to Redis, this was just showing you how to connect to the console.