@@ -217,6 +217,67 @@ function Test-CreateElasticPoolWithMaintenanceConfigurationId
217
217
}
218
218
}
219
219
220
+ <#
221
+ . SYNOPSIS
222
+ Tests creating a Hyperscale elastic pool
223
+ #>
224
+ function Test-CreateHyperscaleElasticPool
225
+ {
226
+ # Setup
227
+ $location = " north europe"
228
+ $rg = " PowershellTestsNE"
229
+ $server = " hs-ep-powershelltests"
230
+
231
+ try
232
+ {
233
+ # # Create Hyperscale pool with 2 high availability replicas
234
+ $poolName = Get-ElasticPoolName
235
+ $job = New-AzSqlElasticPool - ServerName $server - ResourceGroupName $rg `
236
+ - ElasticPoolName $poolName - VCore 4 - Edition Hyperscale - ComputeGeneration Gen5 - AsJob
237
+ $job | Wait-Job
238
+ $ep1 = $job.Output
239
+
240
+ Assert-NotNull $ep1
241
+ Assert-AreEqual Hyperscale $ep1.Edition
242
+ Assert-AreEqual 4 $ep1.Capacity
243
+ Assert-AreEqual 1 $ep1.HighAvailabilityReplicaCount # Default number of high availability replicas
244
+ }
245
+ finally
246
+ {
247
+ Remove-AzSqlElasticPool - ElasticPoolName $poolName - ResourceGroupName $rg - ServerName $server
248
+ }
249
+ }
250
+
251
+ <#
252
+ . SYNOPSIS
253
+ Tests creating a Hyperscale elastic pool with 2 high availability replicas
254
+ #>
255
+ function Test-CreateHyperscaleElasticPoolWithReplica
256
+ {
257
+ # Setup
258
+ $location = " north europe"
259
+ $rg = " PowershellTestsNE"
260
+ $server = " hs-ep-powershelltests"
261
+
262
+ try
263
+ {
264
+ # # Create Hyperscale pool with 2 high availability replicas
265
+ $poolName = Get-ElasticPoolName
266
+ $job = New-AzSqlElasticPool - ServerName $server - ResourceGroupName $rg `
267
+ - ElasticPoolName $poolName - VCore 4 - Edition Hyperscale - ComputeGeneration Gen5 - HighAvailabilityReplicaCount 2 - AsJob
268
+ $job | Wait-Job
269
+ $ep1 = $job.Output
270
+
271
+ Assert-NotNull $ep1
272
+ Assert-AreEqual Hyperscale $ep1.Edition
273
+ Assert-AreEqual 2 $ep1.HighAvailabilityReplicaCount
274
+ }
275
+ finally
276
+ {
277
+ Remove-AzSqlElasticPool - ElasticPoolName $poolName - ResourceGroupName $rg - ServerName $server
278
+ }
279
+ }
280
+
220
281
<#
221
282
. SYNOPSIS
222
283
Tests updating an elastic pool
@@ -445,6 +506,89 @@ function Test-UpdateElasticPoolWithMaintenanceConfigurationId
445
506
}
446
507
}
447
508
509
+ <#
510
+ . SYNOPSIS
511
+ Tests updating a Hyperscale elastic pool's number of high availability replicas
512
+ #>
513
+ function Test-UpdateHyperscaleElasticPoolReplicaCount
514
+ {
515
+ # Setup
516
+ $location = " north europe"
517
+ $rg = " PowershellTestsNE"
518
+ $server = " hs-ep-powershelltests"
519
+
520
+ try
521
+ {
522
+ # Create elastic pool without specifying HighAvailabilityReplicaCount
523
+ $poolName = Get-ElasticPoolName
524
+ $ep1 = New-AzSqlElasticPool - ServerName $server - ResourceGroupName $rg `
525
+ - ElasticPoolName $poolName - VCore 4 - Edition Hyperscale - ComputeGeneration Gen5
526
+
527
+ Assert-NotNull $ep1
528
+ Assert-AreEqual Hyperscale $ep1.Edition
529
+ Assert-AreEqual 4 $ep1.Capacity
530
+ Assert-AreEqual 1 $ep1.HighAvailabilityReplicaCount
531
+
532
+ # Alter pool's HighAvailabilityReplicaCount
533
+ $sep1 = Set-AzSqlElasticPool - ResourceGroupName $ep1.ResourceGroupName - ServerName $ep1.ServerName - ElasticPoolName $ep1.ElasticPoolName `
534
+ - HighAvailabilityReplicaCount 2
535
+
536
+ Assert-AreEqual $sep1.ElasticPoolName $poolName
537
+ Assert-AreEqual Hyperscale $sep1.Edition
538
+ Assert-AreEqual 4 $sep1.Capacity
539
+ Assert-AreEqual 2 $sep1.HighAvailabilityReplicaCount
540
+ }
541
+ finally
542
+ {
543
+ Remove-AzSqlElasticPool - ElasticPoolName $poolName - ResourceGroupName $rg - ServerName $server
544
+ }
545
+ }
546
+
547
+ <#
548
+ . SYNOPSIS
549
+ Tests moving a database out of a Hyperscale elastic pool
550
+ #>
551
+ function Test-MoveDatabaseOutHyperscaleElasticPool
552
+ {
553
+ # Setup
554
+ $location = " north europe"
555
+ $rg = " PowershellTestsNE"
556
+ $server = " hs-ep-powershelltests"
557
+
558
+ try
559
+ {
560
+ # Create Hyperscale elastic pool
561
+ $poolName = Get-ElasticPoolName
562
+ $ep1 = New-AzSqlElasticPool - ServerName $server - ResourceGroupName $rg `
563
+ - ElasticPoolName $poolName - VCore 4 - Edition Hyperscale - ComputeGeneration Gen5 - HighAvailabilityReplicaCount 2
564
+
565
+ Assert-NotNull $ep1
566
+ Assert-AreEqual Hyperscale $ep1.Edition
567
+ Assert-AreEqual 4 $ep1.Capacity
568
+ Assert-AreEqual 2 $ep1.HighAvailabilityReplicaCount
569
+
570
+ # Create database inside pool
571
+ $databaseName = Get-DatabaseName
572
+ $db = New-AzSqlDatabase - ResourceGroupName $rg - ServerName $server - DatabaseName $databaseName - ElasticPoolName $poolName
573
+
574
+ Assert-NotNull $db
575
+ Assert-AreEqual Hyperscale $db.Edition
576
+ Assert-AreEqual 2 $db.HighAvailabilityReplicaCount
577
+
578
+ # Move database out of elastic pool
579
+ $db = Set-AzSqlDatabase - ResourceGroupName $rg - ServerName $server - DatabaseName $databaseName - Edition " Hyperscale" - Vcore 4 - ComputeGeneration " Gen5"
580
+ Assert-NotNull $db
581
+ Assert-AreEqual Hyperscale $db.Edition
582
+ Assert-AreEqual 4 $db.Capacity
583
+ Assert-AreEqual 2 $db.HighAvailabilityReplicaCount
584
+ }
585
+ finally
586
+ {
587
+ Remove-AzSqlDatabase - ResourceGroupName $rg - ServerName $server - DatabaseName $databaseName
588
+ Remove-AzSqlElasticPool - ElasticPoolName $poolName - ResourceGroupName $rg - ServerName $server
589
+ }
590
+ }
591
+
448
592
<#
449
593
. SYNOPSIS
450
594
Tests getting an elastic pool
@@ -577,6 +721,38 @@ function Test-GetElasticPoolWithMaintenanceConfigurationId
577
721
}
578
722
}
579
723
724
+ <#
725
+ . SYNOPSIS
726
+ Tests getting a hyperscale elastic pool
727
+ #>
728
+ function Test-GetHyperscaleElasticPool
729
+ {
730
+ # Setup
731
+ $location = " north europe"
732
+ $rg = " PowershellTestsNE"
733
+ $server = " hs-ep-powershelltests"
734
+
735
+ try
736
+ {
737
+ # Create Hyperscale elastic pool
738
+ $poolName = Get-ElasticPoolName
739
+ New-AzSqlElasticPool - ServerName $server - ResourceGroupName $rg `
740
+ - ElasticPoolName $poolName - VCore 4 - Edition Hyperscale - ComputeGeneration Gen5 - HighAvailabilityReplicaCount 2
741
+
742
+ # Get Hyperscale elastic pool
743
+ $ep1 = Get-AzSqlElasticPool - ServerName $server - ResourceGroupName $rg - ElasticPoolName $poolName
744
+
745
+ Assert-NotNull $ep1
746
+ Assert-AreEqual Hyperscale $ep1.Edition
747
+ Assert-AreEqual 4 $ep1.Capacity
748
+ Assert-AreEqual 2 $ep1.HighAvailabilityReplicaCount
749
+ }
750
+ finally
751
+ {
752
+ Remove-AzSqlElasticPool - ElasticPoolName $poolName - ResourceGroupName $rg - ServerName $server
753
+ }
754
+ }
755
+
580
756
<#
581
757
. SYNOPSIS
582
758
Tests removing an elastic pool
0 commit comments