The right way is to use the IDatabase interface. Also you need to use the GetDatabase() method. This is also mentioned in the Microsoft documentation. Since this is clearly given in the Microsoft documentation, all other options are incorrect. https://docs.microsoft.com/en-us/azure/azure-cache-for-redis/cache-dotnet-how-to-use-azure-redis-cache