@@ -7,7 +7,7 @@ function Test-RedisCache
7
7
# Setup
8
8
$resourceGroupName = " PowerShellTest-1"
9
9
$cacheName = " redisteam001"
10
- $location = " West US"
10
+ $location = Get-Location - providerNamespace " Microsoft.Cache " - resourceType " redis " - preferredLocation " West US"
11
11
12
12
# Create resource group
13
13
New-AzResourceGroup - Name $resourceGroupName - Location $location
@@ -44,14 +44,15 @@ function Test-RedisCache
44
44
}
45
45
46
46
# Updating Cache
47
- $cacheUpdated = Set-AzRedisCache - Name $cacheName - RedisConfiguration @ {" maxmemory-policy" = " allkeys-lru" } - EnableNonSslPort $true
47
+ $cacheUpdated = Set-AzRedisCache - Name $cacheName - RedisConfiguration @ {" maxmemory-policy" = " allkeys-lru" } - EnableNonSslPort $true - MinimumTlsVersion 1.2
48
48
49
49
Assert-AreEqual $cacheName $cacheUpdated.Name
50
50
Assert-AreEqual 6379 $cacheUpdated.Port
51
51
Assert-AreEqual 6380 $cacheUpdated.SslPort
52
52
Assert-AreEqual " succeeded" $cacheUpdated.ProvisioningState
53
53
Assert-AreEqual " allkeys-lru" $cacheUpdated.RedisConfiguration.Item (" maxmemory-policy" )
54
54
Assert-True { $cacheUpdated.EnableNonSslPort }
55
+ Assert-AreEqual " 1.2" $cacheUpdated.MinimumTlsVersion
55
56
56
57
Assert-NotNull $cacheUpdated.PrimaryKey " PrimaryKey do not exists"
57
58
Assert-NotNull $cacheUpdated.SecondaryKey " SecondaryKey do not exists"
@@ -117,7 +118,7 @@ function Test-SetNonExistingRedisCacheTest
117
118
# Setup
118
119
$resourceGroupName = " PowerShellTestNonExisting"
119
120
$cacheName = " nonexistingrediscache"
120
- $location = " West US"
121
+ $location = Get-Location - providerNamespace " Microsoft.Cache " - resourceType " redis " - preferredLocation " West US"
121
122
122
123
# Creating Cache
123
124
Assert-Throws {Set-AzRedisCache - ResourceGroupName $resourceGroupName - Name $cacheName - RedisConfiguration @ {" maxmemory-policy" = " allkeys-random" } }
@@ -132,13 +133,13 @@ function Test-RedisCachePipeline
132
133
# Setup
133
134
$resourceGroupName = " PowerShellTest-2"
134
135
$cacheName = " redisteam002"
135
- $location = " West US"
136
+ $location = Get-Location - providerNamespace " Microsoft.Cache " - resourceType " redis " - preferredLocation " West US"
136
137
137
138
# Create resource group
138
139
New-AzResourceGroup - Name $resourceGroupName - Location $location
139
140
140
141
# Creating Cache
141
- $cacheCreated = New-AzRedisCache - ResourceGroupName $resourceGroupName - Name $cacheName - Location $location - Size 1 GB - Sku Standard - EnableNonSslPort $true
142
+ $cacheCreated = New-AzRedisCache - ResourceGroupName $resourceGroupName - Name $cacheName - Location $location - Size 1 GB - Sku Standard - EnableNonSslPort $true - MinimumTlsVersion 1.2
142
143
143
144
Assert-AreEqual $cacheName $cacheCreated.Name
144
145
Assert-AreEqual $location $cacheCreated.Location
@@ -151,6 +152,7 @@ function Test-RedisCachePipeline
151
152
Assert-AreEqual " 1GB" $cacheCreated.Size
152
153
Assert-AreEqual " Standard" $cacheCreated.Sku
153
154
Assert-True { $cacheCreated.EnableNonSslPort }
155
+ Assert-AreEqual " 1.2" $cacheCreated.MinimumTlsVersion
154
156
155
157
Assert-NotNull $cacheCreated.PrimaryKey " PrimaryKey do not exists"
156
158
Assert-NotNull $cacheCreated.SecondaryKey " SecondaryKey do not exists"
@@ -182,6 +184,7 @@ function Test-RedisCachePipeline
182
184
Assert-AreEqual " Standard" $cacheUpdatedPiped.Sku
183
185
Assert-AreEqual " allkeys-random" $cacheUpdatedPiped.RedisConfiguration.Item (" maxmemory-policy" )
184
186
Assert-False { $cacheUpdatedPiped.EnableNonSslPort }
187
+ Assert-AreEqual " 1.2" $cacheUpdatedPiped.MinimumTlsVersion
185
188
186
189
# Get cache keys
187
190
$cacheKeysBeforeUpdate = Get-AzRedisCache - ResourceGroupName $resourceGroupName - Name $cacheName | Get-AzRedisCacheKey
@@ -209,7 +212,7 @@ function Test-RedisCacheClustering
209
212
# Setup
210
213
$resourceGroupName = " PowerShellTest-3"
211
214
$cacheName = " redisteam003"
212
- $location = " West US"
215
+ $location = Get-Location - providerNamespace " Microsoft.Cache " - resourceType " redis " - preferredLocation " West US"
213
216
214
217
# Create resource group
215
218
New-AzResourceGroup - Name $resourceGroupName - Location $location
@@ -325,7 +328,7 @@ function Test-RedisCachePatchSchedules
325
328
# Setup
326
329
$resourceGroupName = " PowerShellTest-4"
327
330
$cacheName = " redisteam004"
328
- $location = " West US"
331
+ $location = Get-Location - providerNamespace " Microsoft.Cache " - resourceType " redis " - preferredLocation " West US"
329
332
330
333
# ############################ Initial Creation #############################
331
334
# Create resource group
@@ -480,7 +483,7 @@ function Test-ImportExportReboot
480
483
# Setup
481
484
$resourceGroupName = " PowerShellTest-5"
482
485
$cacheName = " redisteam005"
483
- $location = " West US"
486
+ $location = Get-Location - providerNamespace " Microsoft.Cache " - resourceType " redis " - preferredLocation " West US"
484
487
$storageName = " redisteam005s"
485
488
$storageContainerName = " exportimport"
486
489
$prefix = " sunny"
@@ -546,7 +549,7 @@ function Test-DiagnosticOperations
546
549
# Setup
547
550
$resourceGroupName = " PowerShellTest-6"
548
551
$cacheName = " redisteam006"
549
- $location = " West US"
552
+ $location = Get-Location - providerNamespace " Microsoft.Cache " - resourceType " redis " - preferredLocation " West US"
550
553
$storageName = " redisteam006s"
551
554
552
555
# ############################ Initial Creation #############################
@@ -601,8 +604,8 @@ function Test-GeoReplication
601
604
$resourceGroupName = " PowerShellTest-7"
602
605
$cacheName1 = " redisteam0071"
603
606
$cacheName2 = " redisteam0072"
604
- $location1 = " West US"
605
- $location2 = " East US"
607
+ $location1 = Get-Location - providerNamespace " Microsoft.Cache " - resourceType " redis " - preferredLocation " West US"
608
+ $location2 = Get-Location - providerNamespace " Microsoft.Cache " - resourceType " redis " - preferredLocation " East US"
606
609
607
610
# ############################ Initial Creation #############################
608
611
# Create resource group
@@ -707,7 +710,7 @@ function Test-FirewallRule
707
710
# Setup
708
711
$resourceGroupName = " PowerShellTest-8"
709
712
$cacheName = " redisteam008"
710
- $location = " West US"
713
+ $location = Get-Location - providerNamespace " Microsoft.Cache " - resourceType " redis " - preferredLocation " West US"
711
714
$rule1 = " ruleone"
712
715
$rule1StartIp = " 10.0.0.0"
713
716
$rule1EndIp = " 10.0.0.32"
@@ -819,7 +822,7 @@ function Test-Zones
819
822
# Setup
820
823
$resourceGroupName = " PowerShellTest-9"
821
824
$cacheName = " redisteam009"
822
- $location = " East US 2 "
825
+ $location = Get-Location - providerNamespace " Microsoft.Cache " - resourceType " redis " - preferredLocation " East US"
823
826
824
827
# Create resource group
825
828
New-AzResourceGroup - Name $resourceGroupName - Location $location
0 commit comments