Skip to content

Commit bc8019c

Browse files
committed
RedisCache breaking changes
1 parent f8ac7aa commit bc8019c

File tree

6 files changed

+43
-134
lines changed

6 files changed

+43
-134
lines changed

src/ResourceManager/RedisCache/ChangeLog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
-->
2020
## Current Release
2121
* Set minimum dependency of module to PowerShell 5.0
22+
* Introduced multiple breaking changes
23+
- Please refer to the migration guide for more information
2224

2325
## Version 4.1.2
2426
* Updated to the latest version of the Azure ClientRuntime

src/ResourceManager/RedisCache/Commands.RedisCache/Commands/NewAzureRedisCache.cs

Lines changed: 2 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,6 @@ public class NewAzureRedisCache : RedisCacheCmdletBase
4141
[ValidateNotNullOrEmpty]
4242
public string Location { get; set; }
4343

44-
[Parameter(ValueFromPipelineByPropertyName = true, Mandatory = false, HelpMessage = "Redis version.")]
45-
public string RedisVersion { get; set; }
46-
4744
[Parameter(ValueFromPipelineByPropertyName = true, Mandatory = false, HelpMessage = "Size of redis cache. Valid values: P1,P2, P3, P4, C0, C1, C2, C3, C4, C5, C6, 250MB, 1GB, 2.5GB, 6GB, 13GB, 26GB, 53GB")]
4845
[ValidateSet(SizeConverter.P1String, SizeConverter.P2String, SizeConverter.P3String, SizeConverter.P4String,
4946
SizeConverter.C0String, SizeConverter.C1String, SizeConverter.C2String, SizeConverter.C3String, SizeConverter.C4String, SizeConverter.C5String, SizeConverter.C6String,
@@ -54,9 +51,6 @@ public class NewAzureRedisCache : RedisCacheCmdletBase
5451
[ValidateSet(SkuStrings.Basic, SkuStrings.Standard, SkuStrings.Premium, IgnoreCase = false)]
5552
public string Sku { get; set; }
5653

57-
[Parameter(ValueFromPipelineByPropertyName = true, Mandatory = false, HelpMessage = "MaxMemoryPolicy is deprecated. Please use RedisConfiguration instead.")]
58-
public string MaxMemoryPolicy { get; set; }
59-
6054
[Parameter(ValueFromPipelineByPropertyName = true, Mandatory = false, HelpMessage = "A hash table which represents redis configuration properties.")]
6155
public Hashtable RedisConfiguration { get; set; }
6256

@@ -69,12 +63,6 @@ public class NewAzureRedisCache : RedisCacheCmdletBase
6963
[Parameter(ValueFromPipelineByPropertyName = true, Mandatory = false, HelpMessage = "The number of shards to create on a Premium Cluster Cache.")]
7064
public int? ShardCount { get; set; }
7165

72-
[Parameter(ValueFromPipelineByPropertyName = true, Mandatory = false, HelpMessage = "VirtualNetwork is deprecated. Please use SubnetId instead.")]
73-
public string VirtualNetwork { get; set; }
74-
75-
[Parameter(ValueFromPipelineByPropertyName = true, Mandatory = false, HelpMessage = "Subnet is deprecated. Please use SubnetId instead.")]
76-
public string Subnet { get; set; }
77-
7866
[Parameter(ValueFromPipelineByPropertyName = true, Mandatory = false, HelpMessage = "The full resource ID of a subnet in a virtual network to deploy the redis cache in. Example format: /subscriptions/{subid}/resourceGroups/{resourceGroupName}/Microsoft.{Network|ClassicNetwork}/VirtualNetworks/vnet1/subnets/subnet1")]
7967
public string SubnetId { get; set; }
8068

@@ -90,25 +78,6 @@ public class NewAzureRedisCache : RedisCacheCmdletBase
9078
public override void ExecuteCmdlet()
9179
{
9280
Utility.ValidateResourceGroupAndResourceName(ResourceGroupName, Name);
93-
if (!string.IsNullOrEmpty(RedisVersion))
94-
{
95-
WriteWarning("The RedisVersion parameter has been deprecated. As such, it is no longer necessary to provide this parameter and any value specified is ignored.");
96-
}
97-
98-
if (!string.IsNullOrEmpty(VirtualNetwork) || !string.IsNullOrEmpty(Subnet))
99-
{
100-
WriteWarning("Parameters 'VirtualNetwork' and 'Subnet' are deprecated. Please use SubnetId instead.");
101-
if (string.IsNullOrEmpty(SubnetId))
102-
{
103-
SubnetId = string.Format("{0}/subnets/{1}", VirtualNetwork, Subnet);
104-
}
105-
}
106-
107-
if (!string.IsNullOrEmpty(MaxMemoryPolicy))
108-
{
109-
throw new ArgumentException(Resources.MaxMemoryPolicyException);
110-
}
111-
11281
if (string.IsNullOrEmpty(Sku))
11382
{
11483
Sku = SkuStrings.Standard;
@@ -159,9 +128,9 @@ public override void ExecuteCmdlet()
159128
ConfirmAction(
160129
string.Format(Resources.CreateRedisCache, Name),
161130
Name,
162-
() =>
131+
() =>
163132
{
164-
var redisResource = CacheClient.CreateCache(ResourceGroupName, Name, Location, skuFamily, skuCapacity, Sku,
133+
var redisResource = CacheClient.CreateCache(ResourceGroupName, Name, Location, skuFamily, skuCapacity, Sku,
165134
RedisConfiguration, EnableNonSslPort, TenantSettings, ShardCount, SubnetId, StaticIP, Tag, Zone);
166135
var redisAccessKeys = CacheClient.GetAccessKeys(ResourceGroupName, Name);
167136
WriteObject(new RedisCacheAttributesWithAccessKeys(redisResource, redisAccessKeys, ResourceGroupName));

src/ResourceManager/RedisCache/Commands.RedisCache/Commands/SetAzureRedisCache.cs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,6 @@ public class SetAzureRedisCache : RedisCacheCmdletBase
4545
[ValidateSet(SkuStrings.Basic, SkuStrings.Standard, SkuStrings.Premium, IgnoreCase = false)]
4646
public string Sku { get; set; }
4747

48-
[Parameter(ValueFromPipelineByPropertyName = true, Mandatory = false, HelpMessage = "MaxMemoryPolicy is deprecated. Please use RedisConfiguration instead.")]
49-
public string MaxMemoryPolicy { get; set; }
50-
5148
[Parameter(ValueFromPipelineByPropertyName = true, Mandatory = false, HelpMessage = "A hash table which represents redis configuration properties.")]
5249
public Hashtable RedisConfiguration { get; set; }
5350

@@ -66,11 +63,6 @@ public class SetAzureRedisCache : RedisCacheCmdletBase
6663
public override void ExecuteCmdlet()
6764
{
6865
Utility.ValidateResourceGroupAndResourceName(ResourceGroupName, Name);
69-
if (!string.IsNullOrEmpty(MaxMemoryPolicy))
70-
{
71-
throw new ArgumentException(Resources.MaxMemoryPolicyException);
72-
}
73-
7466
RedisResource response = null;
7567
if (string.IsNullOrEmpty(ResourceGroupName))
7668
{
@@ -117,7 +109,7 @@ public override void ExecuteCmdlet()
117109
Name,
118110
() =>
119111
{
120-
var redisResource = CacheClient.UpdateCache(ResourceGroupName, Name, skuFamily, skuCapacity,
112+
var redisResource = CacheClient.UpdateCache(ResourceGroupName, Name, skuFamily, skuCapacity,
121113
skuName, RedisConfiguration, EnableNonSslPort, TenantSettings, ShardCount, Tag);
122114
var redisAccessKeys = CacheClient.GetAccessKeys(ResourceGroupName, Name);
123115
WriteObject(new RedisCacheAttributesWithAccessKeys(redisResource, redisAccessKeys, ResourceGroupName));

src/ResourceManager/RedisCache/Commands.RedisCache/help/New-AzureRmRedisCache.md

Lines changed: 5 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ Creates a Redis Cache.
1414
## SYNTAX
1515

1616
```
17-
New-AzureRmRedisCache -ResourceGroupName <String> -Name <String> -Location <String> [-RedisVersion <String>]
18-
[-Size <String>] [-Sku <String>] [-MaxMemoryPolicy <String>] [-RedisConfiguration <Hashtable>]
19-
[-EnableNonSslPort <Boolean>] [-TenantSettings <Hashtable>] [-ShardCount <Int32>] [-VirtualNetwork <String>]
20-
[-Subnet <String>] [-SubnetId <String>] [-StaticIP <String>] [-Tag <Hashtable>] [-Zone <String[]>]
21-
[-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
17+
New-AzureRmRedisCache -ResourceGroupName <String> -Name <String> -Location <String> [-Size <String>]
18+
[-Sku <String>] [-RedisConfiguration <Hashtable>] [-EnableNonSslPort <Boolean>]
19+
[-TenantSettings <Hashtable>] [-ShardCount <Int32>] [-SubnetId <String>] [-StaticIP <String>]
20+
[-Tag <Hashtable>] [-Zone <String[]>] [-DefaultProfile <IAzureContextContainer>] [-WhatIf]
21+
[-Confirm] [<CommonParameters>]
2222
```
2323

2424
## DESCRIPTION
@@ -143,25 +143,6 @@ Accept pipeline input: True (ByPropertyName)
143143
Accept wildcard characters: False
144144
```
145145
146-
### -MaxMemoryPolicy
147-
This parameter has been deprecated.
148-
Use the *RedisConfiguration* parameter to set maxmemory-policy.
149-
For example:
150-
151-
`-RedisConfiguration @{"maxmemory-policy" = "allkeys-lru"}`
152-
153-
```yaml
154-
Type: String
155-
Parameter Sets: (All)
156-
Aliases:
157-
158-
Required: False
159-
Position: Named
160-
Default value: None
161-
Accept pipeline input: True (ByPropertyName)
162-
Accept wildcard characters: False
163-
```
164-
165146
### -Name
166147
Specifies the name of the Redis Cache to create.
167148
@@ -233,21 +214,6 @@ Accept pipeline input: True (ByPropertyName)
233214
Accept wildcard characters: False
234215
```
235216
236-
### -RedisVersion
237-
This parameter is deprecated and will be removed from future releases.
238-
239-
```yaml
240-
Type: String
241-
Parameter Sets: (All)
242-
Aliases:
243-
244-
Required: False
245-
Position: Named
246-
Default value: None
247-
Accept pipeline input: True (ByPropertyName)
248-
Accept wildcard characters: False
249-
```
250-
251217
### -ResourceGroupName
252218
Specifies the name of the resource group in which to create the Redis Cache.
253219
@@ -368,21 +334,6 @@ Accept pipeline input: True (ByPropertyName)
368334
Accept wildcard characters: False
369335
```
370336
371-
### -Subnet
372-
Specifies the name of the subnet in which to deploy the Redis Cache.
373-
374-
```yaml
375-
Type: String
376-
Parameter Sets: (All)
377-
Aliases:
378-
379-
Required: False
380-
Position: Named
381-
Default value: None
382-
Accept pipeline input: True (ByPropertyName)
383-
Accept wildcard characters: False
384-
```
385-
386337
### -SubnetId
387338
```yaml
388339
Type: String
@@ -426,21 +377,6 @@ Accept pipeline input: True (ByPropertyName)
426377
Accept wildcard characters: False
427378
```
428379
429-
### -VirtualNetwork
430-
Specifies the resource ID of the virtual network in which to deploy the Redis Cache.
431-
432-
```yaml
433-
Type: String
434-
Parameter Sets: (All)
435-
Aliases:
436-
437-
Required: False
438-
Position: Named
439-
Default value: None
440-
Accept pipeline input: True (ByPropertyName)
441-
Accept wildcard characters: False
442-
```
443-
444380
### -Zone
445381
List of zones.
446382

src/ResourceManager/RedisCache/Commands.RedisCache/help/Set-AzureRmRedisCache.md

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ Modifies a Redis Cache.
1515

1616
```
1717
Set-AzureRmRedisCache [-ResourceGroupName <String>] -Name <String> [-Size <String>] [-Sku <String>]
18-
[-MaxMemoryPolicy <String>] [-RedisConfiguration <Hashtable>] [-EnableNonSslPort <Boolean>]
19-
[-TenantSettings <Hashtable>] [-ShardCount <Int32>] [-Tag <Hashtable>]
20-
[-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
18+
[-RedisConfiguration <Hashtable>] [-EnableNonSslPort <Boolean>] [-TenantSettings <Hashtable>]
19+
[-ShardCount <Int32>] [-Tag <Hashtable>] [-DefaultProfile <IAzureContextContainer>]
20+
[-WhatIf] [-Confirm] [<CommonParameters>]
2121
```
2222

2323
## DESCRIPTION
@@ -84,25 +84,6 @@ Accept pipeline input: True (ByPropertyName)
8484
Accept wildcard characters: False
8585
```
8686
87-
### -MaxMemoryPolicy
88-
This parameter has been deprecated.
89-
Use the *RedisConfiguration* parameter to set maxmemory-policy.
90-
For example:
91-
92-
`-RedisConfiguration @{"maxmemory-policy" = "allkeys-lru"}`
93-
94-
```yaml
95-
Type: String
96-
Parameter Sets: (All)
97-
Aliases:
98-
99-
Required: False
100-
Position: Named
101-
Default value: None
102-
Accept pipeline input: True (ByPropertyName)
103-
Accept wildcard characters: False
104-
```
105-
10687
### -Name
10788
Specifies the name of the Redis Cache to update.
10889

src/ResourceManager/RedisCache/documentation/current-breaking-changes.md

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,33 @@
3838
https://github.com/Azure/azure-powershell/blob/dev/documentation/breaking-changes/breaking-change-template.md
3939
-->
4040

41-
## Current Breaking Changes
41+
## Current Breaking Changes
42+
43+
### Release 5.0.0 - May 2018
44+
45+
The following cmdlets were affected this release:
46+
47+
**New-AzureRmRedisCache**
48+
- The parameter `MaxMemoryPolicy` is being removed in favor of `RedisConfiguration`
49+
50+
```powershell
51+
# Old
52+
New-AzureRmRedisCache -ResourceGroupName "MyRG" -Name "MyRedisCache" -Location "North Central US" -MaxMemoryPolicy "allkeys-lru"
53+
54+
# New
55+
New-AzureRmRedisCache -ResourceGroupName "MyRG" -Name "MyRedisCache" -Location "North Central US" -RedisConfiguration @{"maxmemory-policy" = "allkeys-lru"}
56+
```
57+
58+
- The parameters `Subnet` and `VirtualNetwork` are being removed in favor of `SubnetId`
59+
- The parameter `RedisVersion` is being removed
60+
61+
**Set-AzureRmRedisCache**
62+
- The parameter `MaxMemoryPolicy` is being removed in favor of `RedisConfiguration`
63+
64+
```powershell
65+
# Old
66+
Set-AzureRmRedisCache -ResourceGroupName "MyRG" -Name "MyRedisCache" -MaxMemoryPolicy "allkeys-lru"
67+
68+
# New
69+
Set-AzureRmRedisCache -ResourceGroupName "MyRG" -Name "MyRedisCache" -RedisConfiguration @{"maxmemory-policy" = "allkeys-lru"}
70+
```

0 commit comments

Comments
 (0)