You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1. Add the authentication logic with environment variables set by Service Connector. For more information, see [Microsoft.Azure.StackExchangeRedis Extension](https://github.com/Azure/Microsoft.Azure.StackExchangeRedis).
17
-
18
-
19
+
19
20
```csharp
20
21
using StackExchange.Redis;
21
22
var cacheHostName = Environment.GetEnvironmentVariable("AZURE_REDIS_HOST");
@@ -38,10 +39,11 @@ ms.author: xiaofanzhou
38
39
39
40
var connectionMultiplexer = await ConnectionMultiplexer.ConnectAsync(configurationOptions);
40
41
```
41
-
42
+
42
43
#### [Java](#tab/java)
43
44
44
45
1. Add the following dependency in your `pom.xml` file:
1. Add the authentication logic with environment variables set by Service Connector. For more information, see [Azure-AAD-Authentication-With-Jedis](https://aka.ms/redis/aad/sample-code/java-jedis).
1. Add the authentication logic with environment variables set by Service Connector. For more information, see [azure-aad-auth-with-redis-py](https://aka.ms/redis/aad/sample-code/python).
122
+
116
123
```python
117
124
import os
118
125
import time
@@ -206,11 +213,13 @@ ms.author: xiaofanzhou
206
213
#### [Node.js](#tab/nodejs)
207
214
208
215
1. Install dependencies.
216
+
209
217
```bash
210
218
npm install redis @azure/identity
211
219
```
220
+
212
221
1. Add the authentication logic with environment variables set by Service Connector. For more information, see [Azure Cache for Redis: Microsoft Entra ID with node-redis client library](https://aka.ms/redis/aad/sample-code/js-noderedis).
213
-
222
+
214
223
```javascript
215
224
import { createClient } from "redis";
216
225
import { DefaultAzureCredential } from "@azure/identity";
@@ -275,4 +284,4 @@ ms.author: xiaofanzhou
275
284
276
285
### [Other](#tab/none)
277
286
278
-
For other languages, you can use the Azure Identity client library (and connection information that Service Connector sets to the environment variables) to connect to Azure Cache for Redis.
287
+
For other languages, you can use the Azure Identity client library (and connection information that Service Connector sets to the environment variables) to connect to Azure Cache for Redis.
0 commit comments