Skip to content

Commit fa8e305

Browse files
committed
Merge branch 'dev' of https://github.com/Azure/azure-powershell into dev1
2 parents 3959378 + b833d86 commit fa8e305

File tree

77 files changed

+18152
-10393
lines changed

Some content is hidden

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

77 files changed

+18152
-10393
lines changed

src/ResourceManager/Sql/ChangeLog.md

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Overview of change #1
88
- Additional information about change #1
99
* Overview of change #2
10-
- Additional information about change #2
10+
- Additional information about change #4
1111
- Additional information about change #2
1212
* Overview of change #3
1313
* Overview of change #4
@@ -18,13 +18,19 @@
1818
- Additional information about change #1
1919
-->
2020
## Current Release
21-
* Added storage properties to cmdlets for Azure SQL threat detection policy management at database and server level
21+
* Added storage properties to cmdlets for Azure SQL threat detection policy management at database and server level
2222
- StorageAccountName
2323
- RetentionInDays
24-
* Removed the unsupported param "AuditAction" from Set-AzureSqlDatabaseServerAuditingPolicy
25-
* Added new param "AuditAction" to Set-AzureSqlDatabaseAuditingPolicy
26-
* Fix for showing on GET and persisting Tags on SET (if not given) for Database, Server and Elastic Pool
27-
- If Tags is used in command it will save tags, if not it will not wipe out tags on resource.
28-
## Version 2.3.0
29-
* Fix for showing on GET and persisting Tags on SET (if not given) for Database, Server and Elastic Pool
30-
- If Tags is used in command it will save tags, if not it will not wipe out tags on resource.
24+
*Removed the unsupported param "AuditAction" from Set-AzureSqlDatabaseServerAuditingPolicy
25+
*Added new param "AuditAction" to Set-AzureSqlDatabaseAuditingPolicy
26+
*Fix for showing on GET and persisting Tags on SET (if not given) for Database, Server and Elastic Pool
27+
- If Tags is used in command it will save tags, if not it will not wipe out tags on resource.
28+
* Fix for showing on GET and persisting Tags on SET (if not given) for Database, Server and Elastic Pool
29+
- If Tags is used in command it will save tags, if not it will not wipe out tags on resource.
30+
* Changes for "New-AzureRmSqlDatabase", "Set-AzureRmSqlDatabase" and "Get-AzureRmSqlDatabase" cmdlets
31+
- Adding a new parameter called "ReadScale" for the 3 cmdlets above.
32+
- The "ReadScale" parameter has 2 possibl values: "Enabled" or "Disabled" to indicate whether the ReadScale option is turned on for the database.
33+
* Functionality of ReadScale Feature.
34+
- ReadScale is a new feature in SQL Database, which allows the user to enabled/disable routing read-only requests to Geo-secondary Premium databases.
35+
- This feature allows the customer to scale up/down their read-only workload flexibly, and unlocked more DTUs for the premium database.
36+
- To configure ReadScale, user simply specify "ReadScale" paramter with "Enabled/Disabled" at database creation with New-AzureRmSqlDatabase cmdlet,

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

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
</Reference>
7272
<Reference Include="Microsoft.Azure.Management.Sql">
7373
<SpecificVersion>False</SpecificVersion>
74-
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Sql.0.50.0-prerelease\lib\net40\Microsoft.Azure.Management.Sql.dll</HintPath>
74+
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Sql.0.51.0-prerelease\lib\net40\Microsoft.Azure.Management.Sql.dll</HintPath>
7575
</Reference>
7676
<Reference Include="Microsoft.Azure.Management.Storage">
7777
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Storage.2.4.0-preview\lib\net40\Microsoft.Azure.Management.Storage.dll</HintPath>
@@ -202,6 +202,7 @@
202202
<DesignTime>True</DesignTime>
203203
<DependentUpon>Resources.resx</DependentUpon>
204204
</Compile>
205+
<Compile Include="ScenarioTests\ReadScaleCrudTests.cs" />
205206
<Compile Include="ScenarioTests\RecommendedActionTests.cs" />
206207
<Compile Include="ScenarioTests\DatabaseBackupStretchTests.cs" />
207208
<Compile Include="ScenarioTests\DatabaseCrudStretchTests.cs" />
@@ -211,6 +212,9 @@
211212
<Compile Include="ScenarioTests\DatabaseReplicationTests.cs" />
212213
<Compile Include="ScenarioTests\DatabaseCrudTests.cs" />
213214
<Compile Include="ScenarioTests\DataMaskingTests.cs" />
215+
<None Include="ScenarioTests\ReadScaleCrudTests.ps1">
216+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
217+
</None>
214218
<None Include="ScenarioTests\RecommendedActionTests.ps1">
215219
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
216220
</None>
@@ -620,6 +624,12 @@
620624
<None Include="SessionRecords\Microsoft.Azure.Commands.Sql.Test.ScenarioTests.IndexRecommendationTests\TestGetIndexRecommendation.json">
621625
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
622626
</None>
627+
<None Include="SessionRecords\Microsoft.Azure.Commands.Sql.Test.ScenarioTests.ReadScaleCrudTests\TestDatabaseReadScaleCreateUpdate.json">
628+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
629+
</None>
630+
<None Include="SessionRecords\Microsoft.Azure.Commands.Sql.Test.ScenarioTests.ReadScaleCrudTests\TestDatabaseReadScaleGet.json">
631+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
632+
</None>
623633
<None Include="SessionRecords\Microsoft.Azure.Commands.Sql.Test.ScenarioTests.RecommendedActionTests\TestGetDatabaseRecommendedAction.json">
624634
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
625635
</None>
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
// ----------------------------------------------------------------------------------
2+
//
3+
// Copyright Microsoft Corporation
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
// Unless required by applicable law or agreed to in writing, software
9+
// distributed under the License is distributed on an "AS IS" BASIS,
10+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
// See the License for the specific language governing permissions and
12+
// limitations under the License.
13+
// ----------------------------------------------------------------------------------
14+
15+
using Microsoft.Azure.Commands.ScenarioTest.SqlTests;
16+
using Microsoft.Azure.ServiceManagemenet.Common.Models;
17+
using Microsoft.WindowsAzure.Commands.ScenarioTest;
18+
using Xunit;
19+
using Xunit.Abstractions;
20+
21+
namespace Microsoft.Azure.Commands.Sql.Test.ScenarioTests
22+
{
23+
public class ReadScaleCrudTests : SqlTestsBase
24+
{
25+
public ReadScaleCrudTests(ITestOutputHelper output)
26+
{
27+
XunitTracingInterceptor.AddToContext(new XunitTracingInterceptor(output));
28+
}
29+
30+
[Fact]
31+
[Trait(Category.AcceptanceType, Category.CheckIn)]
32+
public void TestDatabaseReadScaleCreateUpdate()
33+
{
34+
RunPowerShellTest("Test-CreateUpdateDatabaseReadScale");
35+
}
36+
37+
[Fact]
38+
[Trait(Category.AcceptanceType, Category.CheckIn)]
39+
public void TestDatabaseReadScaleGet()
40+
{
41+
RunPowerShellTest("Test-GetDatabaseReadScale");
42+
}
43+
}
44+
}
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# ----------------------------------------------------------------------------------
2+
#
3+
# Copyright Microsoft Corporation
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
# Unless required by applicable law or agreed to in writing, software
9+
# distributed under the License is distributed on an "AS IS" BASIS,
10+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
# See the License for the specific language governing permissions and
12+
# limitations under the License.
13+
# ----------------------------------------------------------------------------------
14+
15+
<#
16+
.SYNOPSIS
17+
Tests create and update a database with read scale option
18+
#>
19+
function Test-CreateUpdateDatabaseReadScale ($serverVersion = "12.0", $location = "Southeast Asia")
20+
{
21+
# Setup
22+
$rg = Create-ResourceGroupForTest
23+
$server = Create-ServerForTest $rg $serverVersion $location
24+
25+
# Create with default values
26+
$databaseName = Get-DatabaseName
27+
$db = New-AzureRmSqlDatabase -ResourceGroupName $rg.ResourceGroupName -ServerName $server.ServerName -DatabaseName $databaseName -Edition Premium -ReadScale Enabled
28+
Assert-AreEqual $db.DatabaseName $databaseName
29+
30+
try
31+
{
32+
# Alter all properties
33+
$db1 = Set-AzureRmSqlDatabase -ResourceGroupName $db.ResourceGroupName -ServerName $db.ServerName -DatabaseName $db.DatabaseName -ReadScale Disabled
34+
Assert-AreEqual $db1.ReadScale Disabled
35+
}
36+
finally
37+
{
38+
Remove-ResourceGroupForTest $rg
39+
}
40+
}
41+
42+
43+
<#
44+
.SYNOPSIS
45+
Tests Getting a database read scale option
46+
#>
47+
function Test-GetDatabaseReadScale ($serverVersion = "12.0", $location = "Southeast Asia")
48+
{
49+
# Setup
50+
$rg = Create-ResourceGroupForTest
51+
$server = Create-ServerForTest $rg $serverVersion $location
52+
53+
# Create with default values
54+
$databaseName = Get-DatabaseName
55+
$db = New-AzureRmSqlDatabase -ResourceGroupName $rg.ResourceGroupName -ServerName $server.ServerName -DatabaseName $databaseName -Edition Premium
56+
Assert-AreEqual $db.DatabaseName $databaseName
57+
58+
try
59+
{
60+
$db1 = Get-AzureRmSqlDatabase -ResourceGroupName $server.ResourceGroupname -ServerName $server.ServerName -DatabaseName $db.DatabaseName
61+
Assert-AreEqual $db1.ReadScale Disabled
62+
63+
# Alter read scale properties
64+
$db2 = Set-AzureRmSqlDatabase -ResourceGroupName $db.ResourceGroupName -ServerName $db.ServerName -DatabaseName $db.DatabaseName `
65+
-ReadScale Enabled
66+
Assert-AreEqual $db2.ReadScale Enabled
67+
}
68+
finally
69+
{
70+
Remove-ResourceGroupForTest $rg
71+
}
72+
}

0 commit comments

Comments
 (0)