Delphi 连接到 Azure Redis 缓存

Delphi Connect To Azure Cache for Redis

我成功设置了 Azure Redis 服务器(按照此步骤 [https://docs.microsoft.com/en-us/azure/azure-cache-for-redis/cache-dotnet-how-to-use-azure-redis-cache][1] )。我的问题是如何将我的 Delphi 应用程序连接到 Azure Redis 缓存?我正在使用 Delphi XE 构建 VCL 应用程序。

我使用了 redis AUTH 命令(参见 https://redis.io/commands/auth),其值来自 Azure 上的访问密钥。

 IdTCPClient1.Host := 'project.redis.cache.windows.net';
 IdTCPClient1.Port := 6379;
 IdTCPClient1.Connect;
 IdTCPClient1.Socket.WriteLn('auth authentication=youraccesskey');