Skip to content

Commit eecc6f9

Browse files
Adding new optional parameter BackupStorageRedundancy to New-AzSqlInstance cmdlet (Azure#12802)
* Adding new BackupStorageRedundancy parameter * Test recordings added, and help file regenerated * Skipping one test due to very long setup time > 15h * Adding cred scan suppression * Adding 4 more test recordings * Removing PSArgumentCompleter * Changing customer vissible values for backup storage redundancy * Fixing comment * Fixing help file Co-authored-by: Perica Trajkov <[email protected]>
1 parent 712fd6d commit eecc6f9

File tree

68 files changed

+134333
-213847
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+134333
-213847
lines changed

src/Sql/Sql.Test/ScenarioTests/Common.ps1

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ function Create-BasicManagedTestEnvironmentWithParams ($params, $location)
201201
$licenseType = "BasePrice"
202202
$storageSizeInGB = 32
203203
$vCore = 16
204-
$skuName = "GP_Gen4"
204+
$skuName = "GP_Gen5"
205205
$collation = "SQL_Latin1_General_CP1_CI_AS"
206206

207207
$managedInstance = New-AzureRmSqlInstance -ResourceGroupName $params.rgname -Name $params.serverName `
@@ -919,7 +919,7 @@ function Create-ManagedInstanceForTest ($resourceGroup, $subnetId)
919919
$managedInstanceName = Get-ManagedInstanceName
920920
$credentials = Get-ServerCredential
921921
$vCore = 16
922-
$skuName = "GP_Gen4"
922+
$skuName = "GP_Gen5"
923923

924924
$managedInstance = New-AzSqlInstance -ResourceGroupName $resourceGroup.ResourceGroupName -Name $managedInstanceName `
925925
-Location $resourceGroup.Location -AdministratorCredential $credentials -SubnetId $subnetId `
@@ -978,15 +978,16 @@ function Remove-ManagedInstancesInInstancePool($instancePool)
978978
function Get-InstancePoolTestProperties()
979979
{
980980
$tags = @{ instance="Pools" };
981+
981982
$instancePoolTestProperties = @{
982-
resourceGroup = "instancePoolCSSdemo"
983-
name = "cssinstancepool0"
984-
subnetName = "InstancePool"
985-
vnetName = "vnet-cssinstancepool0"
983+
resourceGroup = "ps3995"
984+
name = "myinstancepool1"
985+
subnetName = "ManagedInsanceSubnet"
986+
vnetName = "MIVirtualNetwork"
986987
tags = $tags
987988
computeGen = "Gen5"
988989
edition = "GeneralPurpose"
989-
location = "canadacentral"
990+
location = "westeurope"
990991
licenseType = "LicenseIncluded"
991992
vCores = 16
992993
}
@@ -1000,7 +1001,7 @@ function Get-InstancePoolTestProperties()
10001001
function Create-InstancePoolForTest()
10011002
{
10021003
$props = Get-InstancePoolTestProperties
1003-
$virtualNetwork = CreateAndGetVirtualNetworkForManagedInstance $props.vnetName $props.subnetName $props.location $props.resourceGroup
1004+
$virtualNetwork = CreateAndGetVirtualNetworkForManagedInstance $props.vnetName $props.subnetName $props.location "v-urmila"
10041005
$subnetId = $virtualNetwork.Subnets.where({ $_.Name -eq $props.subnetName })[0].Id
10051006
$instancePool = New-AzSqlInstancePool -ResourceGroupName $props.resourceGroup -Name $props.name `
10061007
-Location $props.location -SubnetId $subnetId -VCore $props.vCores `

src/Sql/Sql.Test/ScenarioTests/InstancePoolCrudTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public void TestGetInstancePool()
6666
RunPowerShellTest("Test-GetInstancePool");
6767
}
6868

69-
[Fact]
69+
[Fact(Skip = "Skip due to long setup time for managed instance pool")]
7070
[Trait(Category.AcceptanceType, Category.CheckIn)]
7171
public void TestRemoveInstancePool()
7272
{

src/Sql/Sql.Test/ScenarioTests/InstancePoolCrudTests.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ function Test-CreateInstancePool
2626
{
2727
# Create an instance pool
2828
$props = Get-InstancePoolTestProperties
29-
$virtualNetwork = CreateAndGetVirtualNetworkForManagedInstance $props.vnetName $props.subnetName $props.location $props.resourceGroup
29+
$virtualNetwork = CreateAndGetVirtualNetworkForManagedInstance $props.vnetName $props.subnetName $props.location "v-urmila"
3030
$subnetId = $virtualNetwork.Subnets.where({ $_.Name -eq $props.subnetName })[0].Id
3131

3232
$instancePool = New-AzSqlInstancePool -ResourceGroupName $props.resourceGroup -Name $props.name `

src/Sql/Sql.Test/ScenarioTests/ManagedDatabaseBackupTests.ps1

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,8 @@ function Test-ManagedDeletedDatabaseShortTermRetentionPolicy
185185
function Test-ManagedInstanceLongTermRetentionPolicy()
186186
{
187187
# Setup
188-
$resourceGroupName = "cl_stage_sea_cv"
189-
$managedInstanceName = "seageodr-gen5-gp"
188+
$resourceGroupName = "v-sntani-test-mi-rg"
189+
$managedInstanceName = "managedinstancearm"
190190
$weeklyRetention = "P1W"
191191
$zeroRetention = "PT0S"
192192

@@ -218,12 +218,12 @@ function Test-ManagedInstanceLongTermRetentionBackup
218218
# MANUAL INSTRUCTIONS
219219
# Create a server and database and fill in the appropriate information below
220220
# Set the weekly retention on the database so that the first backup gets picked up, for example:
221-
# Set-AzSqlInstanceDatabaseBackupLongTermRetentionPolicy -ResourceGroup $resourceGroup -ServerName $serverName -DatabaseName $databaseName -WeeklyRetention P1W
221+
# Set-AzSqlInstanceDatabaseBackupLongTermRetentionPolicy -ResourceGroup $resourceGroup -InstanceName $managedInstanceName -DatabaseName $databaseName -WeeklyRetention P1W
222222
# Wait about 18 hours until it gets properly copied and you see the backup when run get backups, for example:
223-
# Get-AzSqlInstanceDatabaseLongTermRetentionBackup -Location $locationName -InstanceName $managedInstanceName -DatabaeName $databaseName
224-
$resourceGroup = "cl_stage_sea_cv"
225-
$locationName = "southeastasia"
226-
$managedInstanceName = "seageodr-gen5-gp"
223+
# Get-AzSqlInstanceDatabaseLongTermRetentionBackup -Location $locationName -InstanceName $managedInstanceName -DatabaseName $databaseName
224+
$resourceGroup = "v-sntani-test-mi-rg"
225+
$locationName = "westcentralus"
226+
$managedInstanceName = "managedinstancearm"
227227
$databaseName = "ps-test-1"
228228
$databaseWithRemovableBackup = "ps-test-2";
229229

@@ -274,12 +274,12 @@ function Test-ManagedInstanceLongTermRetentionResourceGroupBasedBackup
274274
# MANUAL INSTRUCTIONS
275275
# Create a server and database and fill in the appropriate information below
276276
# Set the weekly retention on the database so that the first backup gets picked up, for example:
277-
# Set-AzSqlInstanceDatabaseBackupLongTermRetentionPolicy -ResourceGroup $resourceGroup -ServerName $serverName -DatabaseName $databaseName -WeeklyRetention P1W
277+
# Set-AzSqlInstanceDatabaseBackupLongTermRetentionPolicy -ResourceGroup $resourceGroup -InstanceName $managedInstanceName -DatabaseName $databaseName -WeeklyRetention P1W
278278
# Wait about 18 hours until it gets properly copied and you see the backup when run get backups, for example:
279279
# Get-AzSqlInstanceDatabaseLongTermRetentionBackup -Location $locationName -ServerName $serverName -DatabaeName $databaseName -ResourceGroupName $resourceGroup
280-
$resourceGroup = "cl_stage_sea_cv"
281-
$locationName = "southeastasia"
282-
$managedInstanceName = "seageodr-gen5-gp"
280+
$resourceGroup = "v-sntani-test-mi-rg"
281+
$locationName = "westcentralus"
282+
$managedInstanceName = "managedinstancearm"
283283
$databaseName = "ps-test-3"
284284

285285
# Basic Get Tests

src/Sql/Sql.Test/ScenarioTests/ManagedDatabaseCrudScenarioTests.ps1

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@
1919
function Test-CreateManagedDatabase
2020
{
2121
# Setup
22-
$rg = Create-ResourceGroupForTest
23-
$vnetName = "cl_initial"
24-
$subnetName = "Cool"
22+
$rg = Create-ResourceGroupForTest "westeurope"
23+
$vnetName = "vnet-pcresizeandcreate"
24+
$subnetName = "ManagedInstance"
2525

26-
# Setup VNET
27-
$virtualNetwork1 = CreateAndGetVirtualNetworkForManagedInstance $vnetName $subnetName $rg.Location
26+
# Setup VNET
27+
$virtualNetwork1 = CreateAndGetVirtualNetworkForManagedInstance $vnetName $subnetName $rg.Location "toki"
2828
$subnetId = $virtualNetwork1.Subnets.where({ $_.Name -eq $subnetName })[0].Id
2929

3030
$managedInstance = Create-ManagedInstanceForTest $rg $subnetId
@@ -69,12 +69,12 @@ function Test-CreateManagedDatabase
6969
function Test-GetManagedDatabase
7070
{
7171
# Setup
72-
$rg = Create-ResourceGroupForTest
73-
$vnetName = "cl_initial"
74-
$subnetName = "Cool"
72+
$rg = Create-ResourceGroupForTest "westeurope"
73+
$vnetName = "vnet-pcresizeandcreate"
74+
$subnetName = "ManagedInstance"
7575

76-
# Setup VNET
77-
$virtualNetwork1 = CreateAndGetVirtualNetworkForManagedInstance $vnetName $subnetName $rg.Location
76+
# Setup VNET
77+
$virtualNetwork1 = CreateAndGetVirtualNetworkForManagedInstance $vnetName $subnetName $rg.Location "toki"
7878
$subnetId = $virtualNetwork1.Subnets.where({ $_.Name -eq $subnetName })[0].Id
7979

8080
$managedInstance = Create-ManagedInstanceForTest $rg $subnetId
@@ -124,12 +124,12 @@ function Test-GetManagedDatabase
124124
function Test-RemoveManagedDatabase
125125
{
126126
# Setup
127-
$rg = Create-ResourceGroupForTest
128-
$vnetName = "cl_initial"
129-
$subnetName = "Cool"
127+
$rg = Create-ResourceGroupForTest "westeurope"
128+
$vnetName = "vnet-pcresizeandcreate"
129+
$subnetName = "ManagedInstance"
130130

131-
# Setup VNET
132-
$virtualNetwork1 = CreateAndGetVirtualNetworkForManagedInstance $vnetName $subnetName $rg.Location
131+
# Setup VNET
132+
$virtualNetwork1 = CreateAndGetVirtualNetworkForManagedInstance $vnetName $subnetName $rg.Location "toki"
133133
$subnetId = $virtualNetwork1.Subnets.where({ $_.Name -eq $subnetName })[0].Id
134134

135135
$managedInstance = Create-ManagedInstanceForTest $rg $subnetId
@@ -195,12 +195,12 @@ function Test-RestoreManagedDatabase
195195
# Setup
196196
$sub = (Get-AzContext).Subscription.Id
197197
$rg = Create-ResourceGroupForTest
198-
$rg2 = Create-ResourceGroupForTest
199-
$vnetName = "cl_initial"
200-
$subnetName = "Cool"
198+
$rg2 = Create-ResourceGroupForTest "westeurope"
199+
$vnetName = "vnet-pcresizeandcreate"
200+
$subnetName = "ManagedInstance"
201201

202-
# Setup VNET
203-
$virtualNetwork1 = CreateAndGetVirtualNetworkForManagedInstance $vnetName $subnetName $rg.Location
202+
# Setup VNET
203+
$virtualNetwork1 = CreateAndGetVirtualNetworkForManagedInstance $vnetName $subnetName $rg.Location "toki"
204204
$subnetId = $virtualNetwork1.Subnets.where({ $_.Name -eq $subnetName })[0].Id
205205

206206
$managedInstance = Create-ManagedInstanceForTest $rg $subnetId
@@ -252,13 +252,13 @@ function Test-RestoreDeletedManagedDatabase
252252
{
253253
# Setup
254254
$sub = (Get-AzContext).Subscription.Id
255-
$rg = Create-ResourceGroupForTest
256-
$rg2 = Create-ResourceGroupForTest
257-
$vnetName = "cl_initial"
258-
$subnetName = "Cool"
255+
$rg = Create-ResourceGroupForTest "westeurope"
256+
$rg2 = Create-ResourceGroupForTest "westeurope"
257+
$vnetName = "vnet-pcresizeandcreate"
258+
$subnetName = "ManagedInstance"
259259

260-
# Setup VNET
261-
$virtualNetwork1 = CreateAndGetVirtualNetworkForManagedInstance $vnetName $subnetName $rg.Location
260+
# Setup VNET
261+
$virtualNetwork1 = CreateAndGetVirtualNetworkForManagedInstance $vnetName $subnetName $rg.Location "toki"
262262
$subnetId = $virtualNetwork1.Subnets.where({ $_.Name -eq $subnetName })[0].Id
263263

264264
$managedInstance = Create-ManagedInstanceForTest $rg $subnetId

src/Sql/Sql.Test/ScenarioTests/ManagedInstanceCrudScenarioTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public void TestCreateManagedInstanceWithIdentity()
7171
RunPowerShellTest("Test-CreateManagedInstanceWithIdentity");
7272
}
7373

74-
[Fact]
74+
[Fact(Skip = "Skip due to bug in backend which is currently deploying")]
7575
[Trait(Category.AcceptanceType, Category.CheckIn)]
7676
public void TestCreateUpdateManagedInstanceWithMinimalTlsVersion()
7777
{

0 commit comments

Comments
 (0)