As I have tested, when you fail to connect to the Redis Cache, it doesn't give any error prompt, and its vault is null.
Here is an article about Use Azure Cache for Redis with a .NET application.
The detailed steps are as below:
1.Set connectionstring in app.config
:
<appSettings>
<add key="CacheConnection" value="<cache-name>.redis.cache.windows.net,abortConnect=false,ssl=true,password=<access-key>"/>
</appSettings>
2.Install StackExchange.Redis package.
3.Use the following code to retrieve cache data.
static void Main(string[] args)
{
IDatabase cache = lazyConnection.Value.GetDatabase();
string cacheCommand = "GET Message";
Console.WriteLine("\nCache command : " + cacheCommand + " or StringGet()");
Console.WriteLine("Cache response : " + cache.StringGet("Message").ToString());
lazyConnection.Value.Dispose();
}
After testing fine on local, you could publish the console app as azure webjobs and it will take the cached data as you want.