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/redis/how-to-manage-redis-cache-powershell.md
+31-28Lines changed: 31 additions & 28 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,52 +26,50 @@ This article shows you how to create, manage, and delete your Azure Redis instan
26
26
27
27
- Make sure you're signed in to Azure with the subscription you want to create your cache under. To use a different subscription than the one you're signed in with, run `Select-AzSubscription -SubscriptionName <SubscriptionName>`.
28
28
29
+
::: zone pivot="azure-managed-redis"
30
+
29
31
>[!NOTE]
30
32
>Azure Cache for Redis Basic, Standard, and Premium tiers use the Azure PowerShell [Az.RedisCache](/powershell/module/az.rediscache) commands.
31
33
>
32
34
>Azure Cache for Redis Enterprise tiers and Azure Managed Redis use the Azure PowerShell [Az.RedisEnterpriseCache](/powershell/module/az.redisenterprisecache) commands.
You create new Azure Managed Redis instances using the [New-AzRedisEnterpriseCache](/powershell/module/az.redisenterprisecache/new-AzRedisEnterpriseCache) cmdlet. `ResourceGroupName`, `Name`, and `Location` are required parameters, but the other parameters are optional and have default values.
37
39
38
-
For a list of all Azure Managed Redis PowerShell parameters and properties for `New-AzRedisEnterpriseCache`, see [New-AzRedisEnterpriseCache](/powershell/module/az.redisenterprisecache/new-azredisenterprisecache). To see a list of available parameters and their descriptions, run the following command.
40
+
For all Azure Managed Redis PowerShell parameters and properties for `New-AzRedisEnterpriseCache`, see [New-AzRedisEnterpriseCache](/powershell/module/az.redisenterprisecache/new-azredisenterprisecache). To output a list of available parameters and their descriptions, run the following command.
39
41
40
42
```azurepowershell
41
43
Get-Help New-AzRedisEnterpriseCache -detailed
42
44
```
43
45
44
-
## Create an Azure Managed Redis cache
45
-
46
-
You create new Azure Managed Redis instances using the [New-AzRedisEnterpriseCache](/powershell/module/az.redisenterprisecache/new-AzRedisEnterpriseCache) cmdlet.
47
-
48
46
> [!IMPORTANT]
49
47
> The first time you create an Azure Managed Redis cache in a subscription, you must first register the `Microsoft.Cache` namespace using the `Register-AzResourceProvider -ProviderNamespace "Microsoft.Cache"` command. Otherwise, cmdlets such as `New-AzRedisEnterpriseCache` and `Get-AzRedisEnterpriseCache` might fail.
50
48
51
-
`ResourceGroupName`, `Name`, and `Location` are required parameters, but the other parameters are optional and have default values. The following example command creates an Azure Managed Redis instance with the specified name, location, and resource group, and default parameters. The instance is 1 GB in size with the non-SSL port disabled.
49
+
The following example command creates an Azure Managed Redis instance with the specified name, location, and resource group, and default parameters. The instance is 1 GB in size with the non-SSL port disabled.
52
50
53
51
```azurepowershell
54
52
New-AzRedisEnterpriseCache -ResourceGroupName myGroup -Name mycache -Location "North Central US"
55
53
```
56
54
57
55
To enable clustering, specify a shard count using the `ShardCount` parameter.
58
56
59
-
To specify values for the `RedisConfiguration` parameter, enclose the values inside `{}` as key/value pairs like `@{"maxmemory-policy" = "allkeys-random", "notify-keyspace-events" = "KEA"}`. The following example creates a 1-GB cache with `allkeys-random` maxmemory policy and keyspace notifications configured with `KEA`. For more information, see [Keyspace notifications (advanced settings)]/azure-cache-for-redis/cache-configure.md#keyspace-notifications-advanced-settings) and [Memory policies]/azure-cache-for-redis/cache-configure.md#memory-policies).
57
+
To specify values for the `RedisConfiguration` parameter, enclose the key-value pairs inside `{}`. The following example creates a 1-GB cache with `@{"maxmemory-policy" = "allkeys-random", "notify-keyspace-events" = "KEA"}`. For more information, see [Keyspace notifications (advanced settings)]/azure-cache-for-redis/cache-configure.md#keyspace-notifications-advanced-settings) and [Memory policies]/azure-cache-for-redis/cache-configure.md#memory-policies).
The `databases` setting can be configured only during cache creation. The following example creates a cache with 48 databases using the [New-AzRedisEnterpriseCache](/powershell/module/az.RedisEnterpriseCache/New-azRedisEnterpriseCache) cmdlet.
66
+
The `databases` setting configures the number of databases and can be set only during cache creation. The following example creates a cache with 48 databases using the [New-AzRedisEnterpriseCache](/powershell/module/az.RedisEnterpriseCache/New-azRedisEnterpriseCache) cmdlet.
For more information on the `databases` property, see [Default Azure Managed Redis server configuration]/azure-cache-for-redis/cache-configure.md#default-redis-server-configuration). For more information on creating an Azure Managed Redis cache, see [New-AzRedisEnterpriseCache](/powershell/module/az.RedisEnterpriseCache/new-azRedisEnterpriseCache).
72
+
For more information on the `databases` property, see [Default Azure Managed Redis server configuration]/azure-cache-for-redis/cache-configure.md#default-redis-server-configuration).
75
73
76
74
<aname="scale"></a>
77
75
## Update an Azure Managed Redis cache
@@ -264,6 +262,11 @@ The following command reboots both nodes of the specified cache.
264
262
265
263
::: zone pivot="azure-cache-redis"
266
264
265
+
>[!NOTE]
266
+
>Azure Cache for Redis Basic, Standard, and Premium tiers use the Azure PowerShell [Az.RedisCache](/powershell/module/az.rediscache) commands.
267
+
>
268
+
>Azure Cache for Redis Enterprise tiers and Azure Managed Redis use the Azure PowerShell [Az.RedisEnterpriseCache](/powershell/module/az.redisenterprisecache) commands.
269
+
267
270
## Azure Cache for Redis PowerShell properties and parameters
268
271
269
272
The following tables show Azure PowerShell properties and descriptions for common Azure Cache for Redis parameters.
@@ -303,49 +306,49 @@ The following tables show Azure PowerShell properties and descriptions for commo
303
306
304
307
## Create an Azure Cache for Redis cache
305
308
306
-
You create new Azure Cache for Redis instances using the [New-AzRedisCache](/powershell/module/az.rediscache/new-azrediscache) cmdlet.
309
+
You create new Azure Cache for Redis instances using the [New-AzRedisCache](/powershell/module/az.rediscache/new-azrediscache) cmdlet.`ResourceGroupName`, `Name`, and `Location` are required parameters, but the other parameters are optional and have default values.
307
310
308
-
> [!IMPORTANT]
309
-
> The first time you create an Azure Cache for Redis in a subscription using the Azure portal, the portal registers the `Microsoft.Cache` namespace for that subscription. If you attempt to create the first Azure Cache for Redis in a subscription using PowerShell, you must first register that namespace using the following command; otherwise cmdlets such as `New-AzRedisCache` and `Get-AzRedisCache` fail.
For a list of all Azure Cache for Redis PowerShell parameters and properties for `New-AzRedisCache`, see [New-AzRedisCache](/powershell/module/az.rediscache/new-azrediscache).
312
312
313
-
To see a list of available parameters and their descriptions for `New-AzRedisCache`, run the following command.
313
+
To output a list of available parameters and their descriptions for `New-AzRedisCache`, run the following command.
314
314
315
315
```azurepowershell
316
316
Get-Help New-AzRedisCache -detailed
317
317
```
318
318
319
-
`ResourceGroupName`, `Name`, and `Location` are required parameters, but the rest are optional and have default values. Running the following command creates a Standard SKU Azure Cache for Redis instance with the specified name, location, and resource group. The instance is 1 GB in size with the non-SSL port disabled.
319
+
> [!IMPORTANT]
320
+
> The first time you create an Azure Cache for Redis in a subscription using the Azure portal, the portal registers the `Microsoft.Cache` namespace for that subscription. If you attempt to create the first Azure Cache for Redis in a subscription using PowerShell, you must first register that namespace using the following command; otherwise cmdlets such as `New-AzRedisCache` and `Get-AzRedisCache` fail.
To create a cache with default parameters, run the following command.
324
+
To create a cache with default parameters, run the following command. The command creates an Azure Cache for Redis Standard SKU instance with the specified name, location, and resource group. The instance is 1 GB in size with the non-SSL port disabled.
322
325
323
326
```azurepowershell
324
-
New-AzRedisCache -ResourceGroupName myGroup -Name mycache -Location "North Central US"
327
+
New-AzRedisCache -ResourceGroupName myGroup -Name mycache -Location "North Central US"
325
328
```
326
329
327
-
To create a Premium cache, specify a size of P1 (6-60 GB), P2 (13-130 GB), P3 (26-260 GB), or P4 (53-530 GB). To enable clustering, specify a shard count using the `ShardCount` parameter. The following example creates a P1 premium cache with three shards. A P1 premium cache is 6 GB in size, and with three shards the total size is 18 GB (3 x 6 GB).
330
+
To create a Premium cache, specify a size of P1 (6-60 GB), P2 (13-130 GB), P3 (26-260 GB), or P4 (53-530 GB). To enable clustering, specify a shard count using the `ShardCount` parameter. The following example creates a P1 Premium cache with three shards. A P1 premium cache is 6 GB in size, and with three shards the total size is 18 GB (3 x 6 GB).
To specify values for the `RedisConfiguration` parameter, enclose the values inside `{}` as key/value pairs like `@{"maxmemory-policy" = "allkeys-random", "notify-keyspace-events" = "KEA"}`. The following example creates a standard 1-GB cache with `allkeys-random` maxmemory policy and keyspace notifications configured with `KEA`. For more information, see [Keyspace notifications (advanced settings)]/azure-cache-for-redis/cache-configure.md#keyspace-notifications-advanced-settings) and [Memory policies]/azure-cache-for-redis/cache-configure.md#memory-policies).
336
+
To specify values for the `RedisConfiguration` parameter, enclose the key-value pairs inside `{}`. The following example creates a 1-GB cache with `@{"maxmemory-policy" = "allkeys-random", "notify-keyspace-events" = "KEA"}`. For more information, see [Keyspace notifications (advanced settings)]/azure-cache-for-redis/cache-configure.md#keyspace-notifications-advanced-settings) and [Memory policies]/azure-cache-for-redis/cache-configure.md#memory-policies).
##To configure the databases setting during cache creation
343
+
### Configure the databases setting
341
344
342
-
The `databases` setting can be configured only during cache creation. The following example creates a premium P3 (26 GB) cache with 48 databases using the [New-AzRedisCache](/powershell/module/az.rediscache/New-azRedisCache) cmdlet.
345
+
The `databases` setting configures the number of databases and can be set only during cache creation. The following example creates a premium P3 (26 GB) cache with 48 databases using the [New-AzRedisCache](/powershell/module/az.rediscache/New-azRedisCache) cmdlet.
For more information on the `databases` property, see [Default Azure Cache for Redis server configuration]/azure-cache-for-redis/cache-configure.md#default-redis-server-configuration). For more information on creating a cache using the [New-AzRedisCache](/powershell/module/az.rediscache/new-azrediscache) cmdlet, see the previous To create an Azure Cache for Redis section.
351
+
For more information on the `databases` property, see [Default Azure Cache for Redis server configuration](../azure-cache-for-redis/cache-configure.md#default-redis-server-configuration.md).
349
352
350
353
## To update an Azure Cache for Redis
351
354
@@ -366,7 +369,7 @@ The following example command updates the `maxmemory-policy` for the Azure Cache
366
369
```
367
370
368
371
<aname="scale"></a>
369
-
## To scale an Azure Cache for Redis
372
+
## To scale an Azure Cache for Redis cache
370
373
371
374
You can use `Set-AzRedisCache` to scale an Azure Cache for Redis instance when you modify the `Size`, `Sku`, or `ShardCount` properties.
0 commit comments