@@ -29,7 +29,7 @@ ms.author: xiaofanzhou
29
29
// var managedIdentityClientId = Environment.GetEnvironmentVariable(" AZURE_REDIS_CLIENTID" );
30
30
// await configurationOptions.ConfigureForAzureWithUserAssignedManagedIdentityAsync(managedIdentityClientId);
31
31
32
- // Service principal secret
32
+ // Service principal secret.
33
33
// var clientId = Environment.GetEnvironmentVariable(" AZURE_REDIS_CLIENTID" );
34
34
// var tenantId = Environment.GetEnvironmentVariable(" AZURE_REDIS_TENANTID" );
35
35
// var secret = Environment.GetEnvironmentVariable(" AZURE_REDIS_CLIENTSECRET" );
@@ -90,8 +90,8 @@ ms.author: xiaofanzhou
90
90
String username = extractUsernameFromToken(token);
91
91
String cacheHostname = System.getenv(" AZURE_REDIS_HOST" );
92
92
93
- // Create Jedis client and connect to the Azure Cache for Redis over the TLS/SSL port using the access token as password.
94
- // Note, Redis Cache Host Name and Port are required below
93
+ // Create Jedis client and connect to Azure Cache for Redis over the TLS/SSL port using the access token as password.
94
+ // Note, Redis Cache host name and port are required below.
95
95
Jedis jedis = new Jedis(cacheHostname, 6380, DefaultJedisClientConfig.builder ()
96
96
.password(token) // Microsoft Entra access token as password is required.
97
97
.user(username) // Username is Required
@@ -246,7 +246,7 @@ ms.author: xiaofanzhou
246
246
console.log(" access Token" , accessToken);
247
247
const host = process.env.AZURE_REDIS_HOST;
248
248
249
- // Create redis client and connect to the Azure Cache for Redis over the TLS port using the access token as password.
249
+ // Create redis client and connect to Azure Cache for Redis over the TLS port using the access token as password.
250
250
const client = createClient({
251
251
username: extractUsernameFromToken(accessToken),
252
252
password: accessToken.token,
@@ -260,9 +260,9 @@ ms.author: xiaofanzhou
260
260
261
261
client.on(" error" , (err) => console.log(" Redis Client Error" , err));
262
262
await client.connect ();
263
- // Set a value against your key in the Azure Redis Cache.
263
+ // Set a value against your key in Azure Redis Cache.
264
264
await client.set(" Az:key" , " value1312" );
265
- // Get value of your key in the Azure Redis Cache.
265
+ // Get value of your key in Azure Redis Cache.
266
266
console.log(" value-" , await client.get(" Az:key" ));
267
267
}
268
268
0 commit comments