|
1 | 1 | ---
|
2 |
| -title: Manage Azure Cache for Redis using Azure classic CLI |
3 |
| -description: Learn how to install the Azure classic CLI on any platform, how to use it to connect to your Azure account, and how to create and manage an Azure Cache for Redis from the classic CLI. |
| 2 | +title: Azure CLI links |
| 3 | +description: See links to articles about how to create and manage Azure Cache for Redis resources by using the Azure CLI. |
4 | 4 |
|
5 | 5 |
|
6 | 6 |
|
7 | 7 |
|
8 | 8 | ms.topic: conceptual
|
9 |
| -ms.date: 05/25/2021 |
| 9 | +ms.date: 04/15/2025 |
10 | 10 | appliesto:
|
11 | 11 | - ✅ Azure Cache for Redis
|
12 | 12 |
|
13 | 13 | ms.custom: engagement-fy23
|
14 | 14 | ---
|
15 |
| -# How to create and manage Azure Cache for Redis using the Azure classic CLI |
| 15 | +# Manage Azure Cache for Redis using the Azure CLI |
16 | 16 |
|
17 |
| -> [!div class="op_single_selector"] |
18 |
| -> * [PowerShell](../redis/how-to-manage-redis-cache-powershell.md) |
19 |
| -> * [Azure classic CLI](cache-manage-cli.md) |
20 |
| -> |
21 |
| -
|
22 |
| -The Azure classic CLI is a great way to manage your Azure infrastructure from any platform. This article shows how to create and manage your Azure Cache for Redis instances using the Azure classic CLI. |
23 |
| - |
24 |
| -[!INCLUDE [outdated-cli-content](../../includes/contains-classic-cli-content.md)] |
25 |
| - |
26 |
| -> [!NOTE] |
27 |
| -> For the latest Azure CLI sample scripts, see [Azure CLI Azure Cache for Redis samples](cli-samples.md). |
28 |
| -
|
29 |
| -## Prerequisites |
30 |
| - |
31 |
| -To create and manage Azure Cache for Redis instances using Azure classic CLI, you must complete the following steps. |
32 |
| - |
33 |
| -* You must have an Azure account. If you don't have one, you can create a [free account](https://azure.microsoft.com/pricing/free-trial/) in just a few moments. |
34 |
| -* [Install the Azure classic CLI](/cli/azure/install-classic-cli). |
35 |
| -* Connect your Azure CLI installation with a personal Azure account, or with a work or school Azure account, and sign in from the classic CLI using the `azure login` command. |
36 |
| -* Before running any of the following commands, switch the classic CLI into Resource Manager mode by running the `azure config mode arm` command. For more information, see [Use the Azure classic CLI to manage Azure resources and resource groups](../azure-resource-manager/management/manage-resources-cli.md). |
37 |
| - |
38 |
| -## Azure Cache for Redis properties |
39 |
| - |
40 |
| -The following properties are used when creating and updating Azure Cache for Redis instances. |
41 |
| - |
42 |
| -| Property | Switch | Description | |
43 |
| -| --- | --- | --- | |
44 |
| -| name |-n, --name |Name of the Azure Cache for Redis. | |
45 |
| -| resource group |-g, --resource-group |Name of the Resource Group. | |
46 |
| -| location |-l, --location |Location to create cache. | |
47 |
| -| size |-z, --size |Size of the Azure Cache for Redis. Valid values: [C0, C1, C2, C3, C4, C5, C6, P1, P2, P3, P4] | |
48 |
| -| sku |-x, --sku |Redis SKU. Should be one of: [Basic, Standard, Premium] | |
49 |
| -| EnableNonSslPort |-e, --enable-non-ssl-port |EnableNonSslPort property of the Azure Cache for Redis. Add this flag if you want to enable the non-TLS/SSL Port for your cache | |
50 |
| -| Redis Configuration |-c, --redis-configuration |Redis Configuration. Enter a JSON formatted string of configuration keys and values here. Format:"{"":"","":""}" | |
51 |
| -| Redis Configuration |-f, --redis-configuration-file |Redis Configuration. Enter the path of a file containing configuration keys and values here. Format for the file entry: {"":"","":""} | |
52 |
| -| Shard Count |-r, --shard-count |Number of Shards to create on a Premium Cluster Cache with clustering. | |
53 |
| -| Virtual Network |-v, --virtual-network |When hosting your cache in a VNET, specifies the exact Resource Manager resource ID of the virtual network to deploy the Azure Cache for Redis in. Example format: /subscriptions/{subid}/resourceGroups/{resourceGroupName}/Microsoft.ClassicNetwork/VirtualNetworks/vnet1 | |
54 |
| -| key type |-t, --key-type |Type of key to renew. Valid values: [Primary, Secondary] | |
55 |
| -| StaticIP |-p, --static-ip \<static-ip\> |When hosting your cache in a VNET, specifies a unique IP address in the subnet for the cache. If not provided, one is chosen for you from the subnet. | |
56 |
| -| Subnet |t, --subnet \<subnet\> |When hosting your cache in a VNET, specifies the name of the subnet in which to deploy the cache. | |
57 |
| -| VirtualNetwork |-v, --virtual-network \<virtual-network\> |When hosting your cache in a VNET, specifies the exact Resource Manager resource ID of the virtual network to deploy the Azure Cache for Redis in. Example format: /subscriptions/{subid}/resourceGroups/{resourceGroupName}/Microsoft.ClassicNetwork/VirtualNetworks/vnet1 | |
58 |
| -| Subscription |-s, --subscription |The subscription identifier. | |
59 |
| - |
60 |
| -## See all Azure Cache for Redis commands |
61 |
| - |
62 |
| -To see all Azure Cache for Redis commands and their parameters, use the `azure rediscache -h` command. |
63 |
| - |
64 |
| -```azurecli |
65 |
| -C:\>azure rediscache -h |
66 |
| -help: Commands to manage your Azure Cache for Redis(s) |
67 |
| -help: |
68 |
| -help: Create an Azure Cache for Redis |
69 |
| -help: rediscache create [--name <name> --resource-group <resource-group> --location <location> [options]] |
70 |
| -help: |
71 |
| -help: Delete an existing Azure Cache for Redis |
72 |
| -help: rediscache delete [--name <name> --resource-group <resource-group> ] |
73 |
| -help: |
74 |
| -help: List all Azure Cache for Redis within your Subscription or Resource Group |
75 |
| -help: rediscache list [options] |
76 |
| -help: |
77 |
| -help: Show properties of an existing Azure Cache for Redis |
78 |
| -help: rediscache show [--name <name> --resource-group <resource-group>] |
79 |
| -help: |
80 |
| -help: Change settings of an existing Azure Cache for Redis |
81 |
| -help: rediscache set [--name <name> --resource-group <resource-group> --redis-configuration <redis-configuration>/--redis-configuration-file <redisConfigurationFile>] |
82 |
| -help: |
83 |
| -help: Renew the authentication key for an existing Azure Cache for Redis |
84 |
| -help: rediscache renew-key [--name <name> --resource-group <resource-group> ] |
85 |
| -help: |
86 |
| -help: Lists Primary and Secondary key of an existing Azure Cache for Redis |
87 |
| -help: rediscache list-keys [--name <name> --resource-group <resource-group>] |
88 |
| -help: |
89 |
| -help: Options: |
90 |
| -help: -h, --help output usage information |
91 |
| -help: |
92 |
| -help: Current Mode: arm (Azure Resource Management) |
93 |
| -``` |
94 |
| - |
95 |
| -## Create an Azure Cache for Redis |
96 |
| - |
97 |
| -To create an Azure Cache for Redis, use the following command: |
98 |
| - |
99 |
| -```azurecli |
100 |
| - azure rediscache create [--name <name> --resource-group <resource-group> --location <location> [options]] |
101 |
| -``` |
102 |
| - |
103 |
| -For more information about this command, run the `azure rediscache create -h` command. |
104 |
| - |
105 |
| -```azurecli |
106 |
| -C:\>azure rediscache create -h |
107 |
| -help: Create an Azure Cache for Redis |
108 |
| -help: |
109 |
| -help: Usage: rediscache create [--name <name> --resource-group <resource-group> --location <location> [options]] |
110 |
| -help: |
111 |
| -help: Options: |
112 |
| -help: -h, --help output usage information |
113 |
| -help: -v, --verbose use verbose output |
114 |
| -help: -vv more verbose with debug output |
115 |
| -help: --json use json output |
116 |
| -help: -n, --name <name> Name of the Azure Cache for Redis. |
117 |
| -help: -g, --resource-group <resource-group> Name of the Resource Group |
118 |
| -help: -l, --location <location> Location to create cache. |
119 |
| -help: -z, --size <size> Size of the Azure Cache for Redis. Valid values: [C0, C1, C2, C3, C4, C5, C6, P1, P2, P3, P4] |
120 |
| -help: -x, --sku <sku> Redis SKU. Should be one of : [Basic, Standard, Premium] |
121 |
| -help: -e, --enable-non-ssl-port EnableNonSslPort property of the Azure Cache for Redis. Add this flag if you want to enable the non-TLS/SSL Port for your cache |
122 |
| -help: -c, --redis-configuration <redis-configuration> Redis Configuration. Enter a JSON formatted string of configuration keys and values here. Format:"{"<key1>":"<value1>","<key2>":"<value2>"}" |
123 |
| -help: -f, --redis-configuration-file <redisConfigurationFile> Redis Configuration. Enter the path of a file containing configuration keys and values here. Format for the file entry: {"<key1>":"<value1>","<key2>":"<value2>"} |
124 |
| -help: -r, --shard-count <shard-count> Number of Shards to create on a Premium Cluster Cache |
125 |
| -help: -v, --virtual-network <virtual-network> The exact ARM resource ID of the virtual network to deploy the Azure Cache for Redis in. Example format: /subscriptions/{subid}/resourceGroups/{resourceGroupName}/Microsoft.ClassicNetwork/VirtualNetworks/vnet1 |
126 |
| -help: -t, --subnet <subnet> Required when deploying an Azure Cache for Redis inside an existing Azure Virtual Network |
127 |
| -help: -p, --static-ip <static-ip> Required when deploying an Azure Cache for Redis inside an existing Azure Virtual Network |
128 |
| -help: -s, --subscription <id> the subscription identifier |
129 |
| -help: |
130 |
| -help: Current Mode: arm (Azure Resource Management) |
131 |
| -``` |
132 |
| - |
133 |
| -## Delete an existing Azure Cache for Redis |
134 |
| - |
135 |
| -To delete an Azure Cache for Redis, use the following command: |
136 |
| - |
137 |
| -```azurecli |
138 |
| - azure rediscache delete [--name <name> --resource-group <resource-group> ] |
139 |
| -``` |
140 |
| - |
141 |
| -For more information about this command, run the `azure rediscache delete -h` command. |
142 |
| - |
143 |
| -```azurecli |
144 |
| -C:\>azure rediscache delete -h |
145 |
| -help: Delete an existing Azure Cache for Redis |
146 |
| -help: |
147 |
| -help: Usage: rediscache delete [--name <name> --resource-group <resource-group> ] |
148 |
| -help: |
149 |
| -help: Options: |
150 |
| -help: -h, --help output usage information |
151 |
| -help: -v, --verbose use verbose output |
152 |
| -help: -vv more verbose with debug output |
153 |
| -help: --json use json output |
154 |
| -help: -n, --name <name> Name of the Azure Cache for Redis. |
155 |
| -help: -g, --resource-group <resource-group> Name of the Resource Group under which the cache exists |
156 |
| -help: -s, --subscription <subscription> the subscription identifier |
157 |
| -help: |
158 |
| -help: Current Mode: arm (Azure Resource Management) |
159 |
| -``` |
160 |
| - |
161 |
| -## List all Azure Cache for Redis within your Subscription or Resource Group |
162 |
| - |
163 |
| -To list all Azure Cache for Redis within your Subscription or Resource Group, use the following command: |
164 |
| - |
165 |
| -```azurecli |
166 |
| - azure rediscache list [options] |
167 |
| -``` |
168 |
| - |
169 |
| -For more information about this command, run the `azure rediscache list -h` command. |
170 |
| - |
171 |
| -```azurecli |
172 |
| -C:\>azure rediscache list -h |
173 |
| -help: List all Azure Cache for Redis within your Subscription or Resource Group |
174 |
| -help: |
175 |
| -help: Usage: rediscache list [options] |
176 |
| -help: |
177 |
| -help: Options: |
178 |
| -help: -h, --help output usage information |
179 |
| -help: -v, --verbose use verbose output |
180 |
| -help: -vv more verbose with debug output |
181 |
| -help: --json use json output |
182 |
| -help: -g, --resource-group <resource-group> Name of the Resource Group |
183 |
| -help: -s, --subscription <subscription> the subscription identifier |
184 |
| -help: |
185 |
| -help: Current Mode: arm (Azure Resource Management) |
186 |
| -``` |
187 |
| - |
188 |
| -## Show properties of an existing Azure Cache for Redis |
189 |
| - |
190 |
| -To show properties of an existing Azure Cache for Redis, use the following command: |
191 |
| - |
192 |
| -```azurecli |
193 |
| - azure rediscache show [--name <name> --resource-group <resource-group>] |
194 |
| -``` |
195 |
| - |
196 |
| -For more information about this command, run the `azure rediscache show -h` command. |
197 |
| - |
198 |
| -```azurecli |
199 |
| -C:\>azure rediscache show -h |
200 |
| -help: Show properties of an existing Azure Cache for Redis |
201 |
| -help: |
202 |
| -help: Usage: rediscache show [--name <name> --resource-group <resource-group>] |
203 |
| -help: |
204 |
| -help: Options: |
205 |
| -help: -h, --help output usage information |
206 |
| -help: -v, --verbose use verbose output |
207 |
| -help: -vv more verbose with debug output |
208 |
| -help: --json use json output |
209 |
| -help: -n, --name <name> Name of the Azure Cache for Redis. |
210 |
| -help: -g, --resource-group <resource-group> Name of the Resource Group |
211 |
| -help: -s, --subscription <subscription> the subscription identifier |
212 |
| -help: |
213 |
| -help: Current Mode: arm (Azure Resource Management) |
214 |
| -``` |
215 | 17 |
|
216 | 18 | <a name="scale"></a>
|
| 19 | +For Azure CLI sample scripts for Azure Cache for Redis, see the following articles: |
217 | 20 |
|
218 |
| -## Change settings of an existing Azure Cache for Redis |
219 |
| - |
220 |
| -To change settings of an existing Azure Cache for Redis, use the following command: |
221 |
| - |
222 |
| -```azurecli |
223 |
| - azure rediscache set [--name <name> --resource-group <resource-group> --redis-configuration <redis-configuration>/--redis-configuration-file <redisConfigurationFile>] |
224 |
| -``` |
225 |
| - |
226 |
| -For more information about this command, run the `azure rediscache set -h` command. |
227 |
| - |
228 |
| -```azurecli |
229 |
| -C:\>azure rediscache set -h |
230 |
| -help: Change settings of an existing Azure Cache for Redis |
231 |
| -help: |
232 |
| -help: Usage: rediscache set [--name <name> --resource-group <resource-group> --redis-configuration <redis-configuration>/--redis-configuration-file <redisConfigurationFile>] |
233 |
| -help: |
234 |
| -help: Options: |
235 |
| -help: -h, --help output usage information |
236 |
| -help: -v, --verbose use verbose output |
237 |
| -help: -vv more verbose with debug output |
238 |
| -help: --json use json output |
239 |
| -help: -n, --name <name> Name of the Azure Cache for Redis. |
240 |
| -help: -g, --resource-group <resource-group> Name of the Resource Group |
241 |
| -help: -c, --redis-configuration <redis-configuration> Redis Configuration. Enter a JSON formatted string of configuration keys and values here. |
242 |
| -help: -f, --redis-configuration-file <redisConfigurationFile> Redis Configuration. Enter the path of a file containing configuration keys and values here. |
243 |
| -help: -s, --subscription <subscription> the subscription identifier |
244 |
| -help: |
245 |
| -help: Current Mode: arm (Azure Resource Management) |
246 |
| -``` |
247 |
| - |
248 |
| -## Renew the authentication key for an existing Azure Cache for Redis |
249 |
| - |
250 |
| -To renew the authentication key for an existing Azure Cache for Redis, use the following command: |
251 |
| - |
252 |
| -```azurecli |
253 |
| - azure rediscache renew-key [--name <name> --resource-group <resource-group> --key-type <key-type>] |
254 |
| -``` |
255 |
| - |
256 |
| -Specify `Primary` or `Secondary` for `key-type`. |
257 |
| - |
258 |
| -For more information about this command, run the `azure rediscache renew-key -h` command. |
259 |
| - |
260 |
| -```azurecli |
261 |
| -C:\>azure rediscache renew-key -h |
262 |
| -help: Renew the authentication key for an existing Azure Cache for Redis |
263 |
| -help: |
264 |
| -help: Usage: rediscache renew-key [--name <name> --resource-group <resource-group> ] |
265 |
| -help: |
266 |
| -help: Options: |
267 |
| -help: -h, --help output usage information |
268 |
| -help: -v, --verbose use verbose output |
269 |
| -help: -vv more verbose with debug output |
270 |
| -help: --json use json output |
271 |
| -help: -n, --name <name> Name of the Azure Cache for Redis. |
272 |
| -help: -g, --resource-group <resource-group> Name of the Resource Group under which cache exists |
273 |
| -help: -t, --key-type <key-type> type of key to renew. Valid values are: 'Primary', 'Secondary'. |
274 |
| -help: -s, --subscription <subscription> the subscription identifier |
275 |
| -help: |
276 |
| -help: Current Mode: arm (Azure Resource Management) |
277 |
| -``` |
278 |
| - |
279 |
| -## List Primary and Secondary keys of an existing Azure Cache for Redis |
| 21 | +- [Create and manage a cache](/azure/redis/scripts/create-manage-cache?pivots=azure-cache-redis) |
| 22 | + 1. Creates a resource group and a Basic tier Azure Redis cache. |
| 23 | + 1. Gets cache details, including provisioning status, the hostname, ports, and keys. |
| 24 | + 1. Deletes the cache. |
280 | 25 |
|
281 |
| -To list Primary and Secondary keys of an existing Azure Cache for Redis, use the following command: |
| 26 | +- [Create and manage a premium cache with clustering](scripts/create-manage-premium-cache-cluster.md) |
| 27 | + 1. Creates a resource group and a Premium tier Azure Redis cache with clustering enabled. |
| 28 | + 1. Gets cache details, including provisioning status, the hostname, ports, and keys. |
| 29 | + 1. Deletes the cache. |
282 | 30 |
|
283 |
| -```azurecli |
284 |
| - azure rediscache list-keys [--name <name> --resource-group <resource-group>] |
285 |
| -``` |
| 31 | +- To install the current Azure CLI, see [Install Azure CLI](/cli/azure/install-azure-cli). |
| 32 | +- For more information about using the Azure CLI, see [Get started with Azure CLI](/cli/azure/get-started-with-azure-cli). |
| 33 | +- For an Azure CLI command reference for Azure Redis caches, see [az redis](/cli/azure/redis) and [az redisenterprise](/cli/azure/redisenterprise). |
286 | 34 |
|
287 |
| -For more information about this command, run the `azure rediscache list-keys -h` command. |
| 35 | +>[!NOTE] |
| 36 | +>The current article contained content about the Azure classic CLI, an older version of Azure CLI that is no longer available. The Azure classic CLI could be used only with the discontinued Azure classic deployment model. |
288 | 37 |
|
289 |
| -```azurecli |
290 |
| -C:\>azure rediscache list-keys -h |
291 |
| -help: Lists Primary and Secondary key of an existing Azure Cache for Redis |
292 |
| -help: |
293 |
| -help: Usage: rediscache list-keys [--name <name> --resource-group <resource-group>] |
294 |
| -help: |
295 |
| -help: Options: |
296 |
| -help: -h, --help output usage information |
297 |
| -help: -v, --verbose use verbose output |
298 |
| -help: -vv more verbose with debug output |
299 |
| -help: --json use json output |
300 |
| -help: -n, --name <name> Name of the Azure Cache for Redis. |
301 |
| -help: -g, --resource-group <resource-group> Name of the Resource Group under which Cache exists |
302 |
| -help: -s, --subscription <subscription> the subscription identifier |
303 |
| -help: |
304 |
| -help: Current Mode: arm (Azure Resource Management) |
305 |
| -``` |
0 commit comments