Skip to content

Commit f26ed5d

Browse files
committed
edits
1 parent c0566a9 commit f26ed5d

File tree

3 files changed

+24
-19
lines changed

3 files changed

+24
-19
lines changed

articles/azure-cache-for-redis/cache-how-to-redis-cli-tool.md

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: Learn how to use redis-cli as a command-line tool for interacting w
55

66

77
ms.topic: how-to
8-
ms.date: 01/04/2024
8+
ms.date: 04/04/2025
99
appliesto:
1010
- ✅ Azure Cache for Redis
1111
---
@@ -19,7 +19,7 @@ Access to an Azure Cache for Redis server instance.
1919

2020
## Install redis-cli
2121

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.
2323

2424
### Install on Linux
2525

@@ -32,7 +32,7 @@ sudo apt-get install redis
3232

3333
### Install on Windows
3434

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).
3636

3737
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/).
3838

@@ -48,17 +48,16 @@ The following section describes how to get these values from the Azure portal.
4848

4949
[!INCLUDE [redis-cache-create](includes/redis-cache-access-keys.md)]
5050

51-
### Gather cache information
51+
### Get other cache information
5252

53-
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:
5454

5555
- **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.
5857

5958
### Run the redis-cli connection command
6059

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.
6261

6362
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.
6463

@@ -74,7 +73,7 @@ Run one of the following command lines, depending on your TLS, port, and cluster
7473
redis-cli -p 6379 -h <cache name>.redis.cache.windows.net -a <access key>
7574
```
7675

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:
7877

7978
```console
8079
redis-cli -p 6380 -h <cache name>.redis.cache.windows.net -a <access key> --tls -c
@@ -96,27 +95,29 @@ You're now connected to your Azure Redis cache instance.
9695

9796
## Use redis-cli commands with your Azure Redis cache
9897

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.
100101

101102
```console
102-
<cache name>.redis.cache.windows.net:6380> PING
103+
contoso.redis.cache.windows.net:6380> PING
103104
PONG
104105
```
105106

106107
You can also run commands like `SET` and `GET`.
107108

108109
```console
109-
<cache name>.redis.cache.windows.net:6380> SET hello world
110+
contoso.redis.cache.windows.net:6380> SET hello world
110111
OK
111-
<cache name>.redis.cache.windows.net:6380> GET hello
112+
contoso.redis.cache.windows.net:6380> GET hello
112113
"world"
113114
```
114115

115116
## Alternatives to redis-cli
116117

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:
118119

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.
120121
- [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.
121122

122123
## Related content
-94 Bytes
Loading

articles/azure-cache-for-redis/includes/redis-cache-access-keys.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,18 @@ ms.custom: ignite-2024
66

77
### Get cache host name, port, and access keys from the Azure portal
88

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).
1010

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`.
1212

13-
:::image type="content" source="media/redis-cache-access-keys/redis-cache-hostname-ports.png" alt-text="Screenshot showing Azure Redis cache properties.":::
13+
- 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**.
1416

15-
- To get the access keys, select **Show access keys** on the **Overview** page. The **CacheKeys** pane shows the keys.
17+
:::image type="content" source="media/redis-cache-access-keys/redis-cache-hostname-ports.png" alt-text="Screenshot showing Azure Redis cache properties.":::
1618

19+
The **CacheKeys** pane displays the keys.
20+
1721
:::image type="content" source="media/redis-cache-access-keys/redis-cache-keys-pane.png" alt-text="Screenshot showing Azure Redis cache access keys pane.":::
1822

1923
You can also select **Authentication** under **Settings** in the left navigation menu, and then select the **Access keys** tab.

0 commit comments

Comments
 (0)