Skip to content

Commit 5bbb2e0

Browse files
committed
integrate-azure-cache-for-redis-with-service-connector
1 parent 128760e commit 5bbb2e0

File tree

3 files changed

+55
-54
lines changed

3 files changed

+55
-54
lines changed
Lines changed: 47 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
title: Integrate Azure Cache for Redis and Azure Cache Redis Enterprise with Service Connector
3-
description: Integrate Azure Cache for Redis and Azure Cache Redis Enterprise into your application with Service Connector
2+
title: Integrate Azure Cache for Redis with Service Connector
3+
description: Learn how to integrate Azure Cache for Redis and Azure Cache for Redis Enterprise into your application with Service Connector.
44
author: maud-lv
55
ms.author: malev
66
ms.service: service-connector
@@ -10,21 +10,21 @@ ms.date: 02/02/2024
1010

1111
# Integrate Azure Cache for Redis with Service Connector
1212

13-
This page shows supported authentication methods and clients, and shows sample code you can use to connect Azure Cache for Redis to other cloud services using Service Connector. You might still be able to connect to Azure Cache for Redis in other programming languages without using Service Connector. This page also shows default environment variable names and values (or Spring Boot configuration) you get when you create the service connection.
13+
Learn about the supported authentication methods and clients you can use with Service Connector to connect Azure Cache for Redis to other cloud services, and get sample code. Plus, find out about the default environment variable names and values (or Spring Boot configuration) you get when you create the service connection. (Note that you might still be able to connect to Azure Cache for Redis in other programming languages without using Service Connector.)
1414

1515
## Supported compute services
1616

17-
Service Connector can be used to connect the following compute services to Azure Cache for Redis:
17+
You can use Service Connector to connect the following compute services to Azure Cache for Redis:
1818

1919
- Azure App Service
2020
- Azure Container Apps
2121
- Azure Functions
2222
- Azure Kubernetes Service (AKS)
2323
- Azure Spring Apps
2424

25-
## Supported Authentication types and client types
25+
## Supported authentication and client types
2626

27-
The table below shows which combinations of authentication methods and clients are supported for connecting your compute service to Azure Cache for Redis using Service Connector. A “Yes” indicates that the combination is supported, while a “No” indicates that it is not supported.
27+
Find out which combinations of authentication methods and clients are supported for connecting your compute service to Azure Cache for Redis using Service Connector in the following table. "Yes" means that the combination is supported, while "No" means that it's not supported.
2828

2929
| Client type | System-assigned managed identity | User-assigned managed identity | Secret / connection string | Service principal |
3030
|--------------------|----------------------------------|--------------------------------|----------------------------|-------------------|
@@ -36,114 +36,115 @@ The table below shows which combinations of authentication methods and clients a
3636
| Python | Yes | Yes | Yes | Yes |
3737
| None | Yes | Yes | Yes | Yes |
3838

39-
This table indicates that the only supported authentication method for all client types in the table is the Secret / connection string method. Other authentication methods are not supported for any of the client types to connect to Azure Cache for Redis using Service Connector.
39+
This table shows that the only supported authentication method for the listed client types is secret / connection string. No other authentication methods are supported for the listed client types to connect to Azure Cache for Redis using Service Connector.
4040

4141
## Default environment variable names or application properties and sample code
4242

43-
Use the environment variable names and application properties listed below to connect compute services to Redis Server. For each example below, replace the placeholder texts `<redis-server-name>`, and `<redis-key>` with your own Redis server name and key. For more information about naming conventions, check the [Service Connector internals](concept-service-connector-internals.md#configuration-naming-convention) article.
43+
Use the following environment variable names and application properties to connect compute services to your Redis server. For each example, replace the placeholders `<redis-server-name>`, and `<redis-key>` with your own Redis server name and key. Check the [Service Connector internals](concept-service-connector-internals.md#configuration-naming-convention) article to learn more about naming conventions.
4444

4545
### System-assigned managed identity
4646

4747
| Default environment variable name | Description | Sample value |
4848
| ---------------------------------------- | --------------------- | -------------------------------------------------- |
49-
| AZURE_REDIS_HOST | Redis Endpoint | `<RedisName>.redis.cache.windows.net` |
49+
| `AZURE_REDIS_HOST` | Redis endpoint | `<RedisName>.redis.cache.windows.net` |
5050

5151
#### Sample code
5252

53-
Refer to the steps and code below to connect to Redis using a system-assigned managed identity.
53+
The following steps and code show you how to use a system-assigned managed identity to connect to Redis.
5454
[!INCLUDE [code sample for redis](./includes/code-redis-me-id.md)]
5555

5656
### User-assigned managed identity
5757

5858
| Default environment variable name | Description | Sample value |
5959
| ---------------------------------------- | --------------------- | -------------------------------------------------- |
60-
| AZURE_REDIS_HOST | Redis Endpoint | `<RedisName>.redis.cache.windows.net` |
61-
| AZURE_REDIS_CLIENTID | managed identity client ID | `<client-ID>` |
60+
| `AZURE_REDIS_HOST` | Redis endpoint | `<RedisName>.redis.cache.windows.net` |
61+
| `AZURE_REDIS_CLIENTID` | Managed-identity client ID | `<client-ID>` |
6262

6363
#### Sample code
6464

65-
Refer to the steps and code below to connect to Redis using a user-assigned managed identity.
65+
The following steps and code show you how to use a user-assigned managed identity to connect to Redis.
6666
[!INCLUDE [code sample for Redis](./includes/code-redis-me-id.md)]
6767

68-
### Connection String
68+
### Connection string
6969

7070
> [!WARNING]
71-
> Microsoft recommends that you use the most secure authentication flow available. The authentication flow described in this procedure requires a very high degree of trust in the application, and carries risks that are not present in other flows. You should only use this flow when other more secure flows, such as managed identities, aren't viable.
71+
> We recommend that you use the most secure authentication flow available. The authentication flow described here requires a very high degree of trust in the application, and carries risks that are not present in other flows. You should only use this flow when more secure flows, such as managed identities, aren't viable.
7272
73-
#### [.NET](#tab/dotnet)
73+
#### [.NET](#tab/dotnet)
7474

7575
| Default environment variable name | Description | Example value |
7676
| --------------------------------- | -------------------------------------- | ---------------------------------------------------------------------------------------------------- |
77-
| AZURE_REDIS_CONNECTIONSTRING | StackExchange. Redis connection string | `<redis-server-name>.redis.cache.windows.net:6380,password=<redis-key>,ssl=True,defaultDatabase=0` |
77+
| AZURE_REDIS_CONNECTIONSTRING | `StackExchange.Redis` connection string | `<redis-server-name>.redis.cache.windows.net:6380,password=<redis-key>,ssl=True,defaultDatabase=0` |
7878

79-
#### [Java](#tab/java)
79+
#### [Java](#tab/java)
8080

8181
| Default environment variable name | Description | Example value |
8282
| --------------------------------- | ----------------------- | ---------------------------------------------------------------------------- |
83-
| AZURE_REDIS_CONNECTIONSTRING | Jedis connection string | `rediss://:<redis-key>@<redis-server-name>.redis.cache.windows.net:6380/0` |
83+
| `AZURE_REDIS_CONNECTIONSTRING` | Jedis connection string | `rediss://:<redis-key>@<redis-server-name>.redis.cache.windows.net:6380/0` |
8484

85-
#### [SpringBoot](#tab/springBoot)
85+
#### [SpringBoot](#tab/springBoot)
8686

8787
| Application properties | Description | Example value |
8888
| ---------------------- | -------------- | ----------------------------------------------- |
89-
| spring.redis.host | Redis host | `<redis-server-name>.redis.cache.windows.net` |
90-
| spring.redis.port | Redis port | `6380` |
91-
| spring.redis.database | Redis database | `0` |
92-
| spring.redis.password | Redis key | `<redis-key>` |
93-
| spring.redis.ssl | SSL setting | `true` |
89+
| `spring.redis.host` | Redis host | `<redis-server-name>.redis.cache.windows.net` |
90+
| `spring.redis.port` | Redis port | `6380` |
91+
| `spring.redis.database` | Redis database | `0` |
92+
| `spring.redis.password` | Redis key | `<redis-key>` |
93+
| `spring.redis.ssl` | SSL setting | `true` |
9494

95-
#### [Python](#tab/python)
95+
#### [Python](#tab/python)
9696

9797
| Default environment variable name | Description | Example value |
9898
|-----------------------------------|----------------------------|----------------------------------------------------------------------------|
99-
| AZURE_REDIS_CONNECTIONSTRING | redis-py connection string | `rediss://:<redis-key>@<redis-server-name>.redis.cache.windows.net:6380/0` |
99+
| `AZURE_REDIS_CONNECTIONSTRING` | `redis-py` connection string | `rediss://:<redis-key>@<redis-server-name>.redis.cache.windows.net:6380/0` |
100100

101-
#### [Go](#tab/go)
101+
#### [Go](#tab/go)
102102

103103
| Default environment variable name | Description | Example value |
104104
|-----------------------------------|----------------------------|----------------------------------------------------------------------------|
105-
| AZURE_REDIS_CONNECTIONSTRING | redis-py connection string | `rediss://:<redis-key>@<redis-server-name>.redis.cache.windows.net:6380/0` |
105+
| `AZURE_REDIS_CONNECTIONSTRING` | `redis-py` connection string | `rediss://:<redis-key>@<redis-server-name>.redis.cache.windows.net:6380/0` |
106106

107-
#### [NodeJS](#tab/nodejs)
107+
#### [Node.js](#tab/nodejs)
108108

109109
| Default environment variable name | Description | Example value |
110110
| --------------------------------- | ---------------------------- | ---------------------------------------------------------------------------- |
111-
| AZURE_REDIS_CONNECTIONSTRING | node-redis connection string | `rediss://:<redis-key>@<redis-server-name>.redis.cache.windows.net:6380/0` |
111+
| `AZURE_REDIS_CONNECTIONSTRING` | `node-redis` connection string | `rediss://:<redis-key>@<redis-server-name>.redis.cache.windows.net:6380/0` |
112112

113113
#### [Other](#tab/none)
114114

115115
| Default environment variable name | Description | Example value |
116116
| --------------------------------- | -------------- | ----------------------------------------------- |
117-
| AZURE_REDIS_HOST | Redis host | `<redis-server-name>.redis.cache.windows.net` |
118-
| AZURE_REDIS_PORT | Redis port | `6380` |
119-
| AZURE_REDIS_DATABASE | Redis database | `0` |
120-
| AZURE_REDIS_PASSWORD | Redis key | `<redis-key>` |
121-
| AZURE_REDIS_SSL | SSL setting | `true` |
117+
| `AZURE_REDIS_HOST` | Redis host | `<redis-server-name>.redis.cache.windows.net` |
118+
| `AZURE_REDIS_PORT` | Redis port | `6380` |
119+
| `AZURE_REDIS_DATABASE` | Redis database | `0` |
120+
| `AZURE_REDIS_PASSWORD` | Redis key | `<redis-key>` |
121+
| `AZURE_REDIS_SSL` | SSL setting | `true` |
122122

123123
---
124124

125125
#### Sample code
126126

127-
Refer to the steps and code below to connect to Azure Cache for Redis using a connection string.
127+
The following steps and code show you how to use a connection string to connect to Azure Cache for Redis.
128128
[!INCLUDE [code for redis](./includes/code-redis-secret.md)]
129129

130-
### Service Principal
130+
### Service principal
131131

132132
| Default environment variable name | Description | Sample value |
133133
| ---------------------------------------- | --------------------- | -------------------------------------------------- |
134-
| AZURE_REDIS_HOST | Redis Endpoint | `<RedisName>.redis.cache.windows.net` |
135-
| AZURE_REDIS_CLIENTID | client ID of service principal | `<client-ID>` |
136-
| AZURE_REDIS_CLIENTSECRET | secret of the service principal | `<client-secret>` |
137-
| AZURE_REDIS_TENANTID | tenant ID of the service principal | `<tenant-id>` |
134+
| `AZURE_REDIS_HOST` | Redis endpoint | `<RedisName>.redis.cache.windows.net` |
135+
| `AZURE_REDIS_CLIENTID` | Client ID of the service principal | `<client-ID>` |
136+
| `AZURE_REDIS_CLIENTSECRET` | Secret of the service principal | `<client-secret>` |
137+
| `AZURE_REDIS_TENANTID` | Tenant ID of the service principal | `<tenant-id>` |
138138

139139
#### Sample code
140140

141-
Refer to the steps and code below to connect to Redis using a Service Principal.
142-
[!INCLUDE [code sample for Redis](./includes/code-redis-me-id.md)]
141+
The following steps and code show you how to use a service principal to connect to Redis.
142+
[!INCLUDE [code sample for Redis](./includes/code-
143+
redis-me-id.md)]
143144

144-
## Next steps
145+
## Next step
145146

146-
Follow the tutorials listed below to learn more about Service Connector.
147+
Read the following tutorial to learn more about Service Connector.
147148

148149
> [!div class="nextstepaction"]
149150
> [Learn about Service Connector concepts](./concept-service-connector-internals.md)

articles/service-connector/includes/code-redis-me-id.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ ms.author: xiaofanzhou
4141
4242
#### [Java](#tab/java)
4343
44-
1. Add the following dependency in your *pom.xml* file:
44+
1. Add the following dependency in your `pom.xml` file:
4545
```xml
4646
<dependency>
4747
<groupId>com.azure</groupId>
@@ -70,7 +70,7 @@ ms.author: xiaofanzhou
7070
// String clientId = System.getenv("AZURE_REDIS_CLIENTID");
7171
// DefaultAzureCredential defaultAzureCredential = new DefaultAzureCredentialBuilder().managedIdentityClientId(clientId).build();
7272
73-
// For AKS workload identity identity.
73+
// For AKS workload identity.
7474
// String clientId = System.getenv("AZURE_REDIS_CLIENTID");
7575
// DefaultAzureCredential defaultAzureCredential = new DefaultAzureCredentialBuilder().workloadIdentityClientId(clientId).build();
7676
@@ -203,13 +203,13 @@ ms.author: xiaofanzhou
203203
re_authentication()
204204
```
205205
206-
#### [NodeJS](#tab/nodejs)
206+
#### [Node.js](#tab/nodejs)
207207
208208
1. Install dependencies.
209209
```bash
210210
npm install redis @azure/identity
211211
```
212-
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].
212+
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).
213213
214214
```javascript
215215
import { createClient } from "redis";
@@ -275,4 +275,4 @@ ms.author: xiaofanzhou
275275
276276
### [Other](#tab/none)
277277
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.
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.

articles/service-connector/includes/code-redis-secret.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ ms.author: wchi
2323

2424
#### [Java](#tab/java)
2525

26-
1. Add the following dependency in your *pom.xml* file:
26+
1. Add the following dependency in your `pom.xml` file:
2727
```xml
2828
<dependency>
2929
<groupId>redis.clients</groupId>
@@ -49,7 +49,7 @@ ms.author: wchi
4949

5050
#### [SpringBoot](#tab/springBoot)
5151

52-
Refer to [Use Azure Redis Cache in Spring](/azure/developer/java/spring-framework/configure-spring-boot-initializer-java-app-with-redis-cache) to set up your Spring application. The configuration properties are added to Spring Apps by Service Connector.
52+
Refer to [Use Azure Redis Cache in Spring](/azure/developer/java/spring-framework/configure-spring-boot-initializer-java-app-with-redis-cache) to set up your Spring application. Service Connector adds the configuration properties to Spring Apps.
5353

5454
#### [Python](#tab/python)
5555

@@ -91,7 +91,7 @@ Refer to [Use Azure Redis Cache in Spring](/azure/developer/java/spring-framewor
9191
client := redis.NewClient(opt)
9292
```
9393
94-
#### [NodeJS](#tab/nodejs)
94+
#### [Node.js](#tab/nodejs)
9595
9696
1. Install dependencies.
9797
```bash

0 commit comments

Comments
 (0)