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-how-to-redis-cli-tool.md
+16-15Lines changed: 16 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ description: Learn how to use redis-cli as a command-line tool for interacting w
5
5
6
6
7
7
ms.topic: how-to
8
-
ms.date: 01/04/2024
8
+
ms.date: 04/04/2025
9
9
appliesto:
10
10
- ✅ Azure Cache for Redis
11
11
---
@@ -19,7 +19,7 @@ Access to an Azure Cache for Redis server instance.
19
19
20
20
## Install redis-cli
21
21
22
-
The redis-cli tool installs automatically with the Redis package, which is available for Linux, macOS, and Windows. For detailed installation instructions for your operating system, see the open-source [Install Redis](https://redis.io/docs/install/install-redis/) guide.
22
+
The redis-cli tool installs automatically with the Redis package, which is available for Linux, macOS, and Windows. For detailed installation instructions, see the open-source [Install Redis](https://redis.io/docs/install/install-redis/) guide.
23
23
24
24
### Install on Linux
25
25
@@ -32,7 +32,7 @@ sudo apt-get install redis
32
32
33
33
### Install on Windows
34
34
35
-
The best way to use redis-cli on Windows is to install the [Windows Subsystem for Linux (WSL)](/windows/wsl/about), which allows you to run Linux tools directly on Windows. To install WSL, see [How to install Linux on Windows with WSL](/windows/wsl/install).
35
+
The best way to use redis-cli on Windows is to install the [Windows Subsystem for Linux](/windows/wsl/about) (WSL), which allows you to run Linux tools directly on Windows. To install WSL, see [How to install Linux on Windows with WSL](/windows/wsl/install).
36
36
37
37
Once installed, use WSL to install a Linux distro, and then install redis-cli by using the available package management for the Linux distro you chose. The default distro for WSL is Ubuntu. For more information, see [Install Redis on Windows](https://redis.io/docs/latest/operate/oss_and_stack/install/install-redis/install-redis-on-windows/).
38
38
@@ -48,17 +48,16 @@ The following section describes how to get these values from the Azure portal.
Before connecting to your cache via redis-cli, determine the following information so you know what command options to use.
53
+
You might also need to specify the following options for redis-cli:
54
54
55
55
-**Transport Layer Security (TLS)**: By default, Azure Redis instances use [TLS](cache-remove-tls-10-11.md) encryption for connections. If the cache uses TLS, you must enable TLS for redis-cli by using the `--tls` option.
56
-
-**Port**: Enterprise and Enterprise Flash tier caches use port `10000`. Basic, Standard, and Premium tier caches use either port `6379` for non-TLS connections or port `6380` for TLS connections.
57
-
-**Clustering**: If you have a Premium tier cache that uses clustering, or an Enterprise or Enterprise Flash tier cache that uses OSS cluster policy, add the `-c` option to ensure all shards can be accessed.
56
+
-**Clustering**: If you have a Premium tier cache that uses clustering, or an Enterprise or Enterprise Flash tier cache that uses OSS cluster policy, add the `-c` option to ensure that all shards can be accessed.
58
57
59
58
### Run the redis-cli connection command
60
59
61
-
Open a shell or terminal on a computer with the Redis package installed. On Windows, you can use WSL with [Windows Terminal](/windows/wsl/install#ways-to-run-multiple-linux-distributions-with-wsl) to open a Linux command line.
60
+
To connect to your cache, open a shell or terminal on a computer with the Redis package installed. On Windows, you can use WSL with [Windows Terminal](/windows/wsl/install#ways-to-run-multiple-linux-distributions-with-wsl) to open a Linux command line.
62
61
63
62
Run one of the following command lines, depending on your TLS, port, and clustering options. Replace the `<cache name>` and `<access key>` placeholders with the values for your cache.
64
63
@@ -74,7 +73,7 @@ Run one of the following command lines, depending on your TLS, port, and cluster
74
73
redis-cli -p 6379 -h <cache name>.redis.cache.windows.net -a <access key>
75
74
```
76
75
77
-
- Connect to a Basic, Standard, or Premium tier Azure Redis instance that uses TLS and clustering:
76
+
- Connect to a Premium tier Azure Redis instance that uses TLS and clustering:
@@ -96,27 +95,29 @@ You're now connected to your Azure Redis cache instance.
96
95
97
96
## Use redis-cli commands with your Azure Redis cache
98
97
99
-
Once you establish the connection, you can issue commands to your Azure Redis instance. One easy way to test the connection is to use the [`PING`](https://redis.io/commands/ping/) command. The following command returns `PONG` in the console.
98
+
Once you establish the connection, you can issue commands to your Azure Redis instance at the redis-cli command prompt. The following examples show a connection to a cache named `contoso` that uses port `6380`.
99
+
100
+
One easy way to test the connection is to use the [`PING`](https://redis.io/commands/ping/) command. The command returns `PONG` in the console.
100
101
101
102
```console
102
-
<cache name>.redis.cache.windows.net:6380> PING
103
+
contoso.redis.cache.windows.net:6380> PING
103
104
PONG
104
105
```
105
106
106
107
You can also run commands like `SET` and `GET`.
107
108
108
109
```console
109
-
<cache name>.redis.cache.windows.net:6380> SET hello world
110
+
contoso.redis.cache.windows.net:6380> SET hello world
110
111
OK
111
-
<cache name>.redis.cache.windows.net:6380> GET hello
112
+
contoso.redis.cache.windows.net:6380> GET hello
112
113
"world"
113
114
```
114
115
115
116
## Alternatives to redis-cli
116
117
117
-
You can also connect to your cache in the following other ways for troubleshooting or testing:
118
+
While the redis-cli is a useful tool, you can also use the following other methods to connect to your cache for troubleshooting or testing:
118
119
119
-
-Azure Cache for Redis offers a [Redis Console](cache-configure.md#redis-console)built into the Azure portal where you can issue commands without needing the command-line tool. The Redis Console feature is currently available only in the Basic, Standard, and Premium tiers.
120
+
-[Redis Console](cache-configure.md#redis-console)lets you issue commands without having to install redis-cli. Redis Console is currently available only for Basic, Standard, and Premium tiers. If Redis Console is available, you can use it by selecting **Console** in the top toolbar of your cache **Overview** page in the Azure portal.
120
121
-[RedisInsight](https://redis.io/insight/) is a rich open-source graphical tool for issuing Redis commands and viewing the contents of a Redis instance. RedisInsight works with Azure Cache for Redis and is supported on Linux, Windows, and macOS.
Copy file name to clipboardExpand all lines: articles/azure-cache-for-redis/includes/redis-cache-access-keys.md
+8-4Lines changed: 8 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,14 +6,18 @@ ms.custom: ignite-2024
6
6
7
7
### Get cache host name, port, and access keys from the Azure portal
8
8
9
-
To connect to your Azure Redis cache, the cache client needs the cache host name, port, and keys. Some clients might refer to these items by slightly different names. Follow these instructions to get the cache host name, port, and keys from the [Azure portal](https://portal.azure.com).
9
+
To connect to your Azure Redis cache, the cache client needs the cache host name, ports, and keys. Some clients might refer to these items by slightly different names. Follow these instructions to get the cache host name, ports, and keys from the [Azure portal](https://portal.azure.com).
10
10
11
-
-Copy the host name and port from the cache **Overview** page in the portal. The host name is of the form `<cachename>.redis.cache.windows.net`.
11
+
-Get the host name from the cache **Overview** page. The host name is of the form `<cachename>.redis.cache.windows.net`.
- Select the link next to **Ports** to get the ports. Enterprise and Enterprise Flash tier caches use port `10000`. Basic, Standard, and Premium tier caches use either port `6379` for non-TLS connections or port `6380` for TLS connections.
14
+
15
+
- To get the access keys, select **Show access keys**.
14
16
15
-
- To get the accesskeys, select **Show access keys** on the **Overview** page. The **CacheKeys** pane shows the keys.
0 commit comments