Skip to content

Commit 2e56ab0

Browse files
johnpaulkeeMaddie Clayton
authored andcommitted
Updating pool and database cmdlets to include optional LicenseType param (#6311)
* Initial addition of license type optional param * Initial updates to the markdown files * Initial edits to implementation * Fixing rename param set doc for set-azurermsqldatabase doc * Fixing database crud tests * Removing test * Updating recorded scenario tests * Updating Sql ChangeLog.md * Fixing tabs * Updating cmdlets based on feedback. use constants, remove unnecessary check * Removing default comment * Removing unneccessary check in AzureSqlDatabaseModel * Fixing markdown issues * Fixing references to recorded tests * Updates based on feedback. Get-Location and markdown help files updated * Adding accepted values to other param sets in new-azurermsqldatabase, new-azurermsqlelasticpool, and restore-azurermsqldatabase * Fix positioning of Accepted values in markdown help files
1 parent bd1f44b commit 2e56ab0

File tree

41 files changed

+23886
-3844
lines changed

Some content is hidden

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

41 files changed

+23886
-3844
lines changed

src/ResourceManager/Sql/ChangeLog.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@
1818
- Additional information about change #1
1919
-->
2020
## Current Release
21+
* Updated the following cmdlets with optional LicenseType parameter
22+
- New-AzureRmSqlDatabase; Set-AzureRmSqlDatabase
23+
- New-AzureRmSqlElasticPool; Set-AzureRmSqlElasticPool
24+
- New-AzureRmSqlDatabaseCopy
25+
- New-AzureRmSqlDatabaseSecondary
26+
- Restore-AzureRmSqlDatabase
2127

2228
## Version 4.5.0
2329
* Updated Auditing cmdlets to allow removing AuditActions or AuditActionGroups

src/ResourceManager/Sql/Commands.Sql.Test/Commands.Sql.Test.csproj

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,9 @@
7777
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Network.19.0.0-preview\lib\net452\Microsoft.Azure.Management.Network.dll</HintPath>
7878
</Reference>
7979
<Reference Include="Microsoft.Azure.Management.Sql, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
80-
<SpecificVersion>False</SpecificVersion>
80+
<SpecificVersion>False</SpecificVersion>
8181
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Sql.1.15.0-preview\lib\net452\Microsoft.Azure.Management.Sql.dll</HintPath>
82-
<Private>True</Private>
82+
<Private>True</Private>
8383
</Reference>
8484
<Reference Include="Microsoft.Azure.Management.Storage">
8585
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Storage.2.4.0-preview\lib\net40\Microsoft.Azure.Management.Storage.dll</HintPath>
@@ -639,15 +639,24 @@
639639
<None Include="SessionRecords\Microsoft.Azure.Commands.Sql.Test.ScenarioTests.DatabaseCrudTests\TestDatabaseUpdateWithZoneRedundancyNotSpecified.json">
640640
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
641641
</None>
642-
<None Include="SessionRecords\Microsoft.Azure.Commands.Sql.Test.ScenarioTests.DatabaseCrudTests\TestVcoreDatabaseCreate.json">
642+
<None Include="SessionRecords\Microsoft.Azure.Commands.Sql.Test.ScenarioTests.DatabaseCrudTests\TestVcoreDatabaseCreate.json">
643+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
644+
</None>
645+
<None Include="SessionRecords\Microsoft.Azure.Commands.Sql.Test.ScenarioTests.DatabaseCrudTests\TestVcoreDatabaseUpdate.json">
646+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
647+
</None>
648+
<None Include="SessionRecords\Microsoft.Azure.Commands.Sql.Test.ScenarioTests.DatabaseCrudTests\TestVcoreDatabaseUpdateWithLicenseType.json">
643649
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
644650
</None>
645-
<None Include="SessionRecords\Microsoft.Azure.Commands.Sql.Test.ScenarioTests.DatabaseCrudTests\TestVcoreDatabaseUpdate.json">
651+
<None Include="SessionRecords\Microsoft.Azure.Commands.Sql.Test.ScenarioTests.DatabaseCrudTests\TestVcoreDatabaseCreateWithLicenseType.json">
646652
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
647653
</None>
648654
<None Include="SessionRecords\Microsoft.Azure.Commands.Sql.Test.ScenarioTests.DatabaseReplicationTests\TestCreateDatabaseCopy.json">
649655
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
650656
</None>
657+
<None Include="SessionRecords\Microsoft.Azure.Commands.Sql.Test.ScenarioTests.DatabaseReplicationTests\TestCreateVcoreDatabaseCopy.json">
658+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
659+
</None>
651660
<None Include="SessionRecords\Microsoft.Azure.Commands.Sql.Test.ScenarioTests.DatabaseReplicationTests\TestCreateSecondaryDatabase.json">
652661
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
653662
</None>
@@ -747,10 +756,16 @@
747756
<None Include="SessionRecords\Microsoft.Azure.Commands.Sql.Test.ScenarioTests.ElasticPoolCrudTests\TestElasticPoolCancelOperation.json">
748757
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
749758
</None>
750-
<None Include="SessionRecords\Microsoft.Azure.Commands.Sql.Test.ScenarioTests.ElasticPoolCrudTests\TestVcoreElasticPoolUpdate.json">
759+
<None Include="SessionRecords\Microsoft.Azure.Commands.Sql.Test.ScenarioTests.ElasticPoolCrudTests\TestVcoreElasticPoolUpdate.json">
760+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
761+
</None>
762+
<None Include="SessionRecords\Microsoft.Azure.Commands.Sql.Test.ScenarioTests.ElasticPoolCrudTests\TestVcoreElasticPoolCreate.json">
763+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
764+
</None>
765+
<None Include="SessionRecords\Microsoft.Azure.Commands.Sql.Test.ScenarioTests.ElasticPoolCrudTests\TestVcoreElasticPoolUpdateWithLicenseType.json">
751766
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
752767
</None>
753-
<None Include="SessionRecords\Microsoft.Azure.Commands.Sql.Test.ScenarioTests.ElasticPoolCrudTests\TestVcoreElasticPoolCreate.json">
768+
<None Include="SessionRecords\Microsoft.Azure.Commands.Sql.Test.ScenarioTests.ElasticPoolCrudTests\TestVcoreElasticPoolCreateWithLicenseType.json">
754769
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
755770
</None>
756771
<None Include="SessionRecords\Microsoft.Azure.Commands.Sql.Test.ScenarioTests.FailoverGroupTests\TestCreateFailoverGroup_AutomaticPolicy.json">

src/ResourceManager/Sql/Commands.Sql.Test/ScenarioTests/DatabaseCrudTests.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,13 @@ public void TestVcoreDatabaseCreate()
5252
RunPowerShellTest("Test-CreateVcoreDatabase");
5353
}
5454

55+
[Fact]
56+
[Trait(Category.AcceptanceType, Category.CheckIn)]
57+
public void TestVcoreDatabaseCreateWithLicenseType()
58+
{
59+
RunPowerShellTest("Test-CreateVcoreDatabaseWithLicenseType");
60+
}
61+
5562
[Fact]
5663
[Trait(Category.AcceptanceType, Category.CheckIn)]
5764
public void TestDatabaseCreateWithSampleName()
@@ -80,6 +87,13 @@ public void TestVcoreDatabaseUpdate()
8087
RunPowerShellTest("Test-UpdateVcoreDatabase");
8188
}
8289

90+
[Fact]
91+
[Trait(Category.AcceptanceType, Category.CheckIn)]
92+
public void TestVcoreDatabaseUpdateWithLicenseType()
93+
{
94+
RunPowerShellTest("Test-UpdateVcoreDatabaseLicenseType");
95+
}
96+
8397
[Fact]
8498
[Trait(Category.AcceptanceType, Category.CheckIn)]
8599
public void TestDatabaseUpdateWithZoneRedundancy()

src/ResourceManager/Sql/Commands.Sql.Test/ScenarioTests/DatabaseCrudTests.ps1

Lines changed: 120 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ function Test-CreateDatabaseInternal ($location = "westcentralus")
3939
$job1 | Wait-Job
4040
$db = $job1.Output
4141

42-
Assert-AreEqual $databaseName $db.DatabaseName
42+
Assert-AreEqual $databaseName $db.DatabaseName
4343
Assert-NotNull $db.MaxSizeBytes
4444
Assert-NotNull $db.Edition
4545
Assert-NotNull $db.CurrentServiceObjectiveName
@@ -68,7 +68,7 @@ function Test-CreateDatabaseInternal ($location = "westcentralus")
6868
Assert-AreEqual $dwdb.Edition DataWarehouse
6969
Assert-AreEqual $dwdb.CurrentServiceObjectiveName DW100
7070
Assert-AreEqual $dwdb.CollationName $collationName
71-
71+
7272
# Create with all parameters
7373
$databaseName = Get-DatabaseName
7474
$db = New-AzureRmSqlDatabase -ResourceGroupName $rg.ResourceGroupName -ServerName $server.ServerName -DatabaseName $databaseName `
@@ -107,7 +107,7 @@ function Test-CreateDatabaseInternal ($location = "westcentralus")
107107
#>
108108
function Test-CreateVcoreDatabase
109109
{
110-
# Setup
110+
# Setup
111111
$location = Get-Location "Microsoft.Sql" "operations" "Southeast Asia"
112112
$rg = Create-ResourceGroupForTest $location
113113
$server = Create-ServerForTest $rg $location
@@ -120,7 +120,7 @@ function Test-CreateVcoreDatabase
120120
$job1 | Wait-Job
121121
$db = $job1.Output
122122

123-
Assert-AreEqual $databaseName $db.DatabaseName
123+
Assert-AreEqual $databaseName $db.DatabaseName
124124
Assert-NotNull $db.MaxSizeBytes
125125
Assert-AreEqual GP_Gen4_2 $db.CurrentServiceObjectiveName
126126
Assert-AreEqual 2 $db.Capacity
@@ -132,7 +132,7 @@ function Test-CreateVcoreDatabase
132132
$job1 | Wait-Job
133133
$db = $job1.Output
134134

135-
Assert-AreEqual $databaseName $db.DatabaseName
135+
Assert-AreEqual $databaseName $db.DatabaseName
136136
Assert-NotNull $db.MaxSizeBytes
137137
Assert-AreEqual GP_Gen4_2 $db.CurrentServiceObjectiveName
138138
Assert-AreEqual 2 $db.Capacity
@@ -144,6 +144,45 @@ function Test-CreateVcoreDatabase
144144
}
145145
}
146146

147+
<#
148+
.SYNOPSIS
149+
Tests creating a database with license type.
150+
#>
151+
function Test-CreateVcoreDatabaseWithLicenseType
152+
{
153+
# Setup
154+
$location = Get-Location "Microsoft.Sql" "operations" "West Central US"
155+
$rg = Create-ResourceGroupForTest
156+
$server = Create-ServerForTest $rg $location
157+
158+
try
159+
{
160+
# Create with Edition and RequestedServiceObjectiveName - Base Price
161+
$databaseName = Get-DatabaseName
162+
$db = New-AzureRmSqlDatabase -ResourceGroupName $rg.ResourceGroupName -ServerName $server.ServerName -DatabaseName $databaseName -RequestedServiceObjectiveName GP_Gen4_1 -Edition GeneralPurpose -LicenseType BasePrice
163+
Assert-AreEqual BasePrice $db.LicenseType
164+
165+
# Create with Edition and RequestedServiceObjectiveName - LicenseIncluded
166+
$databaseName = Get-DatabaseName
167+
$db = New-AzureRmSqlDatabase -ResourceGroupName $rg.ResourceGroupName -ServerName $server.ServerName -DatabaseName $databaseName -RequestedServiceObjectiveName GP_Gen4_1 -Edition GeneralPurpose -LicenseType LicenseIncluded
168+
Assert-AreEqual LicenseIncluded $db.LicenseType
169+
170+
# Create with VCore parameter set - BasePrice
171+
$databaseName = Get-DatabaseName
172+
$db = New-AzureRmSqlDatabase -ResourceGroupName $rg.ResourceGroupName -ServerName $server.ServerName -DatabaseName $databaseName -VCore 2 -ComputeGeneration Gen4 -Edition GeneralPurpose -LicenseType BasePrice
173+
Assert-AreEqual BasePrice $db.LicenseType
174+
175+
# Create with VCore parameter set - LicenseIncluded
176+
$databaseName = Get-DatabaseName
177+
$db = New-AzureRmSqlDatabase -ResourceGroupName $rg.ResourceGroupName -ServerName $server.ServerName -DatabaseName $databaseName -VCore 2 -ComputeGeneration Gen4 -Edition GeneralPurpose -LicenseType LicenseIncluded
178+
Assert-AreEqual LicenseIncluded $db.LicenseType
179+
}
180+
finally
181+
{
182+
Remove-ResourceGroupForTest $rg
183+
}
184+
}
185+
147186
<#
148187
.SYNOPSIS
149188
Tests creating a database with sample name.
@@ -245,13 +284,13 @@ function Test-UpdateDatabaseInternal ($location = "westcentralus")
245284
# Setup
246285
$rg = Create-ResourceGroupForTest
247286
$server = Create-ServerForTest $rg $location
248-
287+
249288
$databaseName = Get-DatabaseName
250289
$db = New-AzureRmSqlDatabase -ResourceGroupName $rg.ResourceGroupName -ServerName $server.ServerName -DatabaseName $databaseName `
251290
-Edition Standard -MaxSizeBytes 250GB -RequestedServiceObjectiveName S0
252291
Assert-AreEqual $db.DatabaseName $databaseName
253292

254-
# Database will be Standard s0 with maxsize: 268435456000 (250GB)
293+
# Database will be Standard s0 with maxsize: 268435456000 (250GB)
255294

256295
try
257296
{
@@ -307,11 +346,11 @@ function Test-UpdateDatabaseInternal ($location = "westcentralus")
307346

308347
<#
309348
.SYNOPSIS
310-
Tests updating a vcore database
349+
Tests updating a vcore database
311350
#>
312-
function Test-UpdateVcoreDatabase ()
351+
function Test-UpdateVcoreDatabase()
313352
{
314-
# Setup
353+
# Setup
315354
$location = Get-Location "Microsoft.Sql" "operations" "Southeast Asia"
316355
$rg = Create-ResourceGroupForTest $location
317356
$server = Create-ServerForTest $rg $location
@@ -385,6 +424,47 @@ function Test-UpdateVcoreDatabase ()
385424
}
386425
}
387426

427+
<#
428+
.SYNOPSIS
429+
Tests updating a vcore database license type
430+
#>
431+
function Test-UpdateVcoreDatabaseLicenseType()
432+
{
433+
# Setup
434+
$location = Get-Location "Microsoft.Sql" "operations" "Southeast Asia"
435+
$rg = Create-ResourceGroupForTest $location
436+
$server = Create-ServerForTest $rg $location
437+
438+
# Create vcore database
439+
$databaseName = Get-DatabaseName
440+
$db = New-AzureRmSqlDatabase -ResourceGroupName $rg.ResourceGroupName -ServerName $server.ServerName -DatabaseName $databaseName -RequestedServiceObjectiveName GP_Gen4_1 -Edition GeneralPurpose
441+
Assert-AreEqual $db.DatabaseName $databaseName
442+
Assert-AreEqual $db.LicenseType LicenseIncluded # Default license type
443+
444+
try
445+
{
446+
# Alter with license type - License Included
447+
$db1 = Set-AzureRmSqlDatabase -ResourceGroupName $db.ResourceGroupName -ServerName $db.ServerName -DatabaseName $db.DatabaseName -LicenseType LicenseIncluded
448+
Assert-AreEqual LicenseIncluded $db1.LicenseType
449+
450+
# Alter with license type - Base Price
451+
$db1 = Set-AzureRmSqlDatabase -ResourceGroupName $db.ResourceGroupName -ServerName $db.ServerName -DatabaseName $db.DatabaseName -LicenseType BasePrice
452+
Assert-AreEqual BasePrice $db1.LicenseType
453+
454+
# Test piping - LicenseIncluded
455+
$db1 = $db1 | Set-AzureRmSqlDatabase -LicenseType LicenseIncluded
456+
Assert-AreEqual LicenseIncluded $db1.LicenseType
457+
458+
# Test piping - BasePrice
459+
$db1 = $db1 | Set-AzureRmSqlDatabase -LicenseType BasePrice
460+
Assert-AreEqual BasePrice $db1.LicenseType
461+
}
462+
finally
463+
{
464+
Remove-ResourceGroupForTest $rg
465+
}
466+
}
467+
388468
<#
389469
.SYNOPSIS
390470
Tests updating a database with zone redundancy
@@ -395,7 +475,7 @@ function Test-UpdateDatabaseWithZoneRedundant ()
395475
$location = Get-Location "Microsoft.Sql" "operations" "Southeast Asia"
396476
$rg = Create-ResourceGroupForTest $location
397477
$server = Create-ServerForTest $rg $location
398-
478+
399479
$databaseName = Get-DatabaseName
400480
$db1 = New-AzureRmSqlDatabase -ResourceGroupName $rg.ResourceGroupName -ServerName $server.ServerName -DatabaseName $databaseName `
401481
-Edition Premium
@@ -442,7 +522,7 @@ function Test-UpdateDatabaseWithZoneRedundantNotSpecified ()
442522
$location = Get-Location "Microsoft.Sql" "operations" "Southeast Asia"
443523
$rg = Create-ResourceGroupForTest $location
444524
$server = Create-ServerForTest $rg $location
445-
525+
446526
$databaseName = Get-DatabaseName
447527
$db = New-AzureRmSqlDatabase -ResourceGroupName $rg.ResourceGroupName -ServerName $server.ServerName -DatabaseName $databaseName `
448528
-Edition Premium -ZoneRedundant
@@ -480,7 +560,7 @@ function Test-RenameDatabase
480560
{
481561
$location = "westcentralus"
482562
$server = Create-ServerForTest $rg $location
483-
563+
484564
# Create with default values
485565
$databaseName = Get-DatabaseName
486566
$db1 = New-AzureRmSqlDatabase -ResourceGroupName $rg.ResourceGroupName -ServerName $server.ServerName -DatabaseName $databaseName -MaxSizeBytes 1GB
@@ -528,17 +608,17 @@ function Test-GetDatabaseInternal ($location = "westcentralus")
528608
# Setup
529609
$rg = Create-ResourceGroupForTest
530610
$server = Create-ServerForTest $rg $location
531-
611+
532612
# Create with default values
533613
$databaseName = Get-DatabaseName
534614
$db1 = New-AzureRmSqlDatabase -ResourceGroupName $rg.ResourceGroupName -ServerName $server.ServerName -DatabaseName $databaseName -MaxSizeBytes 1GB
535615
Assert-AreEqual $db1.DatabaseName $databaseName
536616

537-
# Create database with non-defaults
617+
# Create database with non-defaults
538618
$databaseName = Get-DatabaseName
539619
$db2 = New-AzureRmSqlDatabase -ResourceGroupName $rg.ResourceGroupName -ServerName $server.ServerName -DatabaseName $databaseName `
540620
-CollationName "Japanese_Bushu_Kakusu_100_CS_AS" -MaxSizeBytes 1GB -Edition Basic -RequestedServiceObjectiveName Basic
541-
Assert-AreEqual $db2.DatabaseName $databaseName
621+
Assert-AreEqual $db2.DatabaseName $databaseName
542622

543623
try
544624
{
@@ -556,21 +636,21 @@ function Test-GetDatabaseInternal ($location = "westcentralus")
556636
$all = $server | Get-AzureRmSqlDatabase
557637
Assert-AreEqual $all.Count 4 # 4 because master database is included
558638

559-
$gdb1 = Get-AzureRmSqlDatabase -ResourceGroupName $server.ResourceGroupname -ServerName $server.ServerName -DatabaseName $db1.DatabaseName
560-
Assert-NotNull $gdb1
561-
Assert-AreEqual $db1.DatabaseName $gdb1.DatabaseName
562-
Assert-AreEqual $db1.Edition $gdb1.Edition
563-
Assert-AreEqual $db1.CollationName $gdb1.CollationName
564-
Assert-AreEqual $db1.CurrentServiceObjectiveName $gdb1.CurrentServiceObjectiveName
565-
Assert-AreEqual $db1.MaxSizeBytes $gdb1.MaxSizeBytes
566-
567-
$gdb2 = $db2 | Get-AzureRmSqlDatabase
568-
Assert-NotNull $gdb2
569-
Assert-AreEqual $db2.DatabaseName $gdb2.DatabaseName
570-
Assert-AreEqual $db2.Edition $gdb2.Edition
571-
Assert-AreEqual $db2.CollationName $gdb2.CollationName
572-
Assert-AreEqual $db2.CurrentServiceObjectiveName $gdb2.CurrentServiceObjectiveName
573-
Assert-AreEqual $db2.MaxSizeBytes $gdb2.MaxSizeBytes
639+
$gdb1 = Get-AzureRmSqlDatabase -ResourceGroupName $server.ResourceGroupname -ServerName $server.ServerName -DatabaseName $db1.DatabaseName
640+
Assert-NotNull $gdb1
641+
Assert-AreEqual $db1.DatabaseName $gdb1.DatabaseName
642+
Assert-AreEqual $db1.Edition $gdb1.Edition
643+
Assert-AreEqual $db1.CollationName $gdb1.CollationName
644+
Assert-AreEqual $db1.CurrentServiceObjectiveName $gdb1.CurrentServiceObjectiveName
645+
Assert-AreEqual $db1.MaxSizeBytes $gdb1.MaxSizeBytes
646+
647+
$gdb2 = $db2 | Get-AzureRmSqlDatabase
648+
Assert-NotNull $gdb2
649+
Assert-AreEqual $db2.DatabaseName $gdb2.DatabaseName
650+
Assert-AreEqual $db2.Edition $gdb2.Edition
651+
Assert-AreEqual $db2.CollationName $gdb2.CollationName
652+
Assert-AreEqual $db2.CurrentServiceObjectiveName $gdb2.CurrentServiceObjectiveName
653+
Assert-AreEqual $db2.MaxSizeBytes $gdb2.MaxSizeBytes
574654
}
575655
finally
576656
{
@@ -634,17 +714,17 @@ function Test-RemoveDatabaseInternal ($location = "westcentralus")
634714
# Setup
635715
$rg = Create-ResourceGroupForTest
636716
$server = Create-ServerForTest $rg $location
637-
717+
638718
# Create with default values
639719
$databaseName = Get-DatabaseName
640720
$db1 = New-AzureRmSqlDatabase -ResourceGroupName $rg.ResourceGroupName -ServerName $server.ServerName -DatabaseName $databaseName -MaxSizeBytes 1GB
641721
Assert-AreEqual $db1.DatabaseName $databaseName
642722

643-
# Create database with non-defaults
723+
# Create database with non-defaults
644724
$databaseName = Get-DatabaseName
645725
$db2 = New-AzureRmSqlDatabase -ResourceGroupName $rg.ResourceGroupName -ServerName $server.ServerName -DatabaseName $databaseName `
646726
-CollationName "Japanese_Bushu_Kakusu_100_CS_AS" -MaxSizeBytes 1GB -Edition Basic -RequestedServiceObjectiveName Basic
647-
Assert-AreEqual $db2.DatabaseName $databaseName
727+
Assert-AreEqual $db2.DatabaseName $databaseName
648728

649729
try
650730
{
@@ -655,16 +735,16 @@ function Test-RemoveDatabaseInternal ($location = "westcentralus")
655735
Assert-AreEqual $dwdb.DatabaseName $databaseName
656736

657737
Remove-AzureRmSqlDatabase -ResourceGroupName $server.ResourceGroupname -ServerName $server.ServerName -DatabaseName $dwdb.DatabaseName -Force
658-
738+
659739
$all = $server | Get-AzureRmSqlDatabase
660740
Assert-AreEqual $all.Count 3 # 3 because master database is included
661-
662-
Remove-AzureRmSqlDatabase -ResourceGroupName $server.ResourceGroupname -ServerName $server.ServerName -DatabaseName $db1.DatabaseName -Force
663741

664-
$db2 | Remove-AzureRmSqlDatabase -Force
742+
Remove-AzureRmSqlDatabase -ResourceGroupName $server.ResourceGroupname -ServerName $server.ServerName -DatabaseName $db1.DatabaseName -Force
743+
744+
$db2 | Remove-AzureRmSqlDatabase -Force
665745

666-
$all = $server | Get-AzureRmSqlDatabase
667-
Assert-AreEqual $all.Count 1 # 1 because master database is included
746+
$all = $server | Get-AzureRmSqlDatabase
747+
Assert-AreEqual $all.Count 1 # 1 because master database is included
668748
}
669749
finally
670750
{

0 commit comments

Comments
 (0)