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
Copy file name to clipboardExpand all lines: articles/azure-cache-for-redis/cache-java-get-started.md
+14-7Lines changed: 14 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,9 +31,9 @@ Clone the repo [Java quickstart](https://github.com/Azure-Samples/azure-cache-re
31
31
32
32
## Set up the working environment
33
33
34
-
Depending on your operating system, add environment variables for your **Host name** and **Primary access key** that you noted previously. Open a command prompt, or a terminal window, and set up the following values:
34
+
The following steps show you how to set up the working environment for the Java app. You can choose to authenticate with Azure Cache for Redis using Microsoft Entra ID(recommended) or access keys.
35
35
36
-
## [Microsoft Entra ID Authentication (recommended)](#tab/entraid)
36
+
###[Microsoft Entra ID Authentication (recommended)](#tab/entraid)
@@ -44,8 +44,15 @@ Replace the placeholders with the following values:
44
44
45
45
-`<your-host-name>`: The DNS host name, obtained from the *Properties* section of your Azure Cache for Redis resource in the Azure portal.
46
46
-`<user-name>`: Object ID of your managed identity or service principal.
47
+
- You can get the user name by using the following steps:
47
48
48
-
## [Access Key Authentication](#tab/accesskey)
49
+
1. In the Azure portal, navigate to your Azure Cache for Redis instance.
50
+
1. On the navigation pane, select **Data Access Configuration**.
51
+
1. On the **Redis Users** tab, find the **Username** column.
52
+
53
+
:::image type="content" source="media/cache-java-redisson-get-started/user-name.png" alt-text="Screenshot of the Azure portal that shows the Azure Cache for Redis Data Access Configuration page with the Redis Users tab and a Username value highlighted." lightbox="media/cache-java-redisson-get-started/user-name.png":::
Copy file name to clipboardExpand all lines: articles/azure-cache-for-redis/cache-java-redisson-get-started.md
+32-68Lines changed: 32 additions & 68 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,74 +33,46 @@ This quickstart uses the Maven archetype feature to generate the scaffolding for
33
33
34
34
## Set up the working environment
35
35
36
-
The steps in this section show you two options for how to select the Azure identity used for the Redis connection. The sample code looks at the value of the `AUTH_TYPE` environment variable and takes action depending on the value.
36
+
The following steps show you how to set up the working environment for the Java app. You can choose to authenticate with Azure Cache for Redis using Microsoft Entra ID(recommended) or access keys.
37
37
38
-
### Identity option 1: Authentication with Redis Key
39
-
40
-
Depending on your operating system, add environment variables for your cache's host name and primary access key. Open a command prompt, or a terminal window, and set up the following values:
41
-
42
-
### [Linux](#tab/bash)
38
+
### [Microsoft Entra ID Authentication (recommended)](#tab/entraid)
set REDIS_CACHE_HOSTNAME=<your-host-name>.redis.cache.windows.net
54
-
set REDIS_CACHE_KEY=<your-primary-access-key>
55
-
set AUTH_TYPE=RedisKey
42
+
export USER_NAME=<user-name>
56
43
```
57
44
58
-
---
59
-
60
45
Replace the placeholders with the following values:
61
46
62
47
-`<your-host-name>`: The DNS host name, obtained from the *Properties* section of your Azure Cache for Redis resource in the Azure portal.
63
-
-`<your-primary-access-key>`: The primary access key, obtained from the *Access keys* section of your Azure Cache for Redis resource in the Azure portal.
48
+
-`<user-name>`: Object ID of your managed identity or service principal.
49
+
- You can get the user name by using the following steps:
64
50
65
-
### Identity option 2: Authentication with Microsoft Entra ID
51
+
1. In the Azure portal, navigate to your Azure Cache for Redis instance.
52
+
1. On the navigation pane, select **Data Access Configuration**.
53
+
1. On the **Redis Users** tab, find the **Username** column.
66
54
67
-
Depending on your operating system, add environment variables for your cache's host name and user name. Open a command prompt, or a terminal window, and set up the following values:
55
+
:::image type="content" source="media/cache-java-redisson-get-started/user-name.png" alt-text="Screenshot of the Azure portal that shows the Azure Cache for Redis Data Access Configuration page with the Redis Users tab and a Username value highlighted." lightbox="media/cache-java-redisson-get-started/user-name.png":::
set REDIS_CACHE_HOSTNAME=<your-host-name>.redis.cache.windows.net
81
-
set USER_NAME=<user-name>
82
-
set AUTH_TYPE=MicrosoftEntraID
61
+
export REDIS_CACHE_KEY=<your-primary-access-key>
83
62
```
84
63
85
-
---
86
-
87
64
Replace the placeholders with the following values:
88
65
89
66
-`<your-host-name>`: The DNS host name, obtained from the *Properties* section of your Azure Cache for Redis resource in the Azure portal.
90
-
-`<user-name>`: Object ID of your managed identity or service principal.
91
-
- You can get the user name by using the following steps:
67
+
-`<your-primary-access-key>`: The primary access key, obtained from the *Access keys* section of your Azure Cache for Redis resource in the Azure portal.
92
68
93
-
1. In the Azure portal, navigate to your Azure Cache for Redis instance.
94
-
1. On the navigation pane, select **Data Access Configuration**.
95
-
1. On the **Redis Users** tab, find the **Username** column.
69
+
---
96
70
97
-
:::image type="content" source="media/cache-java-redisson-get-started/user-name.png" alt-text="Screenshot of the Azure portal that shows the Azure Cache for Redis Data Access Configuration page with the Redis Users tab and a Username value highlighted." lightbox="media/cache-java-redisson-get-started/user-name.png":::
In the following output, you can see that the `Message` key previously had a cached value, which was set in the last run. The app updated that cached value.
0 commit comments