Skip to content

Commit f32c4ee

Browse files
committed
.
1 parent cd389eb commit f32c4ee

File tree

1 file changed

+31
-28
lines changed

1 file changed

+31
-28
lines changed

articles/redis/how-to-manage-redis-cache-powershell.md

Lines changed: 31 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -26,52 +26,50 @@ This article shows you how to create, manage, and delete your Azure Redis instan
2626

2727
- 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>`.
2828

29+
::: zone pivot="azure-managed-redis"
30+
2931
>[!NOTE]
3032
>Azure Cache for Redis Basic, Standard, and Premium tiers use the Azure PowerShell [Az.RedisCache](/powershell/module/az.rediscache) commands.
3133
>
3234
>Azure Cache for Redis Enterprise tiers and Azure Managed Redis use the Azure PowerShell [Az.RedisEnterpriseCache](/powershell/module/az.redisenterprisecache) commands.
3335
34-
::: zone pivot="azure-managed-redis"
36+
## Create an Azure Managed Redis cache
3537

36-
## Azure Managed Redis PowerShell parameters and properties
38+
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.
3739

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

4042
```azurepowershell
4143
Get-Help New-AzRedisEnterpriseCache -detailed
4244
```
4345

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-
4846
> [!IMPORTANT]
4947
> 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.
5048
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.
5250

5351
```azurepowershell
5452
New-AzRedisEnterpriseCache -ResourceGroupName myGroup -Name mycache -Location "North Central US"
5553
```
5654

5755
To enable clustering, specify a shard count using the `ShardCount` parameter.
5856

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

6159
```azurepowershell
6260
New-AzRedisEnterpriseCache -ResourceGroupName myGroup -Name mycache -Location "North Central US" -RedisConfiguration @{"maxmemory-policy" = "allkeys-random", "notify-keyspace-events" = "KEA"}
6361
```
6462

6563
<a name="databases"></a>
66-
## Configure the databases setting
64+
### Configure the databases setting
6765

68-
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.
6967

7068
```azurepowershell
7169
New-AzRedisEnterpriseCache -ResourceGroupName myGroup -Name mycache -Location "North Central US" -Sku B1 -RedisConfiguration @{"databases" = "48"}
7270
```
7371

74-
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).
7573

7674
<a name="scale"></a>
7775
## Update an Azure Managed Redis cache
@@ -264,6 +262,11 @@ The following command reboots both nodes of the specified cache.
264262

265263
::: zone pivot="azure-cache-redis"
266264

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+
267270
## Azure Cache for Redis PowerShell properties and parameters
268271

269272
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
303306

304307
## Create an Azure Cache for Redis cache
305308

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

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.
310-
>
311-
> `Register-AzResourceProvider -ProviderNamespace "Microsoft.Cache"`
311+
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).
312312

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

315315
```azurepowershell
316316
Get-Help New-AzRedisCache -detailed
317317
```
318318

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.
321+
>
322+
> `Register-AzResourceProvider -ProviderNamespace "Microsoft.Cache"`
320323
321-
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.
322325

323326
```azurepowershell
324-
New-AzRedisCache -ResourceGroupName myGroup -Name mycache -Location "North Central US"
327+
New-AzRedisCache -ResourceGroupName myGroup -Name mycache -Location "North Central US"
325328
```
326329

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

329332
```azurepowershell
330333
New-AzRedisCache -ResourceGroupName myGroup -Name mycache -Location "North Central US" -Sku Premium -Size P1 -ShardCount 3
331334
```
332335

333-
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).
334337

335338
```azurepowershell
336339
New-AzRedisCache -ResourceGroupName myGroup -Name mycache -Location "North Central US" -RedisConfiguration @{"maxmemory-policy" = "allkeys-random", "notify-keyspace-events" = "KEA"}
337340
```
338341

339342
<a name="databases"></a>
340-
## To configure the databases setting during cache creation
343+
### Configure the databases setting
341344

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

344347
```azurepowershell
345-
New-AzRedisCache -ResourceGroupName myGroup -Name mycache -Location "North Central US" -Sku Premium -Size P3 -RedisConfiguration @{"databases" = "48"}
348+
New-AzRedisCache -ResourceGroupName myGroup -Name mycache -Location "North Central US" -Sku Premium -Size P3 -RedisConfiguration @{"databases" = "48"}
346349
```
347350

348-
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).
349352

350353
## To update an Azure Cache for Redis
351354

@@ -366,7 +369,7 @@ The following example command updates the `maxmemory-policy` for the Azure Cache
366369
```
367370

368371
<a name="scale"></a>
369-
## To scale an Azure Cache for Redis
372+
## To scale an Azure Cache for Redis cache
370373

371374
You can use `Set-AzRedisCache` to scale an Azure Cache for Redis instance when you modify the `Size`, `Sku`, or `ShardCount` properties.
372375

0 commit comments

Comments
 (0)