-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding basic SQL virtual network rules functionality #4404
Changes from 23 commits
8677f51
b2cef3c
baa93a6
057677f
630830b
eadc1a1
c5570fd
3de79f6
2171e87
e04d6cb
89993cc
b370abc
b93ce59
4340077
8133016
3455f68
c296abb
23506fd
9846cdb
d873129
a25c0d6
d3489f1
1481cfc
e8b91c0
9944439
b1c0759
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1556,9 +1556,6 @@ | |
<Component Id="cmpC67F14F377421F1BCD74EC5A579D43CB" Guid="*"> | ||
<File Id="filE9553CEC1D67AB3D4B77759239D60B18" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.IotHub\Microsoft.Azure.Commands.IotHub.dll-Help.xml" /> | ||
</Component> | ||
<Component Id="cmpD844DA64698210481D550B5CD8799D26" Guid="*"> | ||
<File Id="filA23D9B350E9B87D17B90B2181AE71E4B" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.IotHub\Microsoft.Azure.Commands.IotHub.format.ps1xml" /> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this an intentional change? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a change to fix broken build. This change - #4503 removed a file, but this file was not updated. |
||
</Component> | ||
<Component Id="cmp31610C192ED2776279BBDA3D9905552E" Guid="*"> | ||
<File Id="filB571C170B96736E7EE17BBF869A203A8" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.IotHub\Microsoft.Azure.Commands.ResourceManager.Common.dll" /> | ||
</Component> | ||
|
@@ -5842,7 +5839,6 @@ | |
<ComponentRef Id="cmp9DFE8C2688F7DF1A3DFF20EFA59BF3B5" /> | ||
<ComponentRef Id="cmpE29D513714759F365A7C0A2A7F2B5DC6" /> | ||
<ComponentRef Id="cmpC67F14F377421F1BCD74EC5A579D43CB" /> | ||
<ComponentRef Id="cmpD844DA64698210481D550B5CD8799D26" /> | ||
<ComponentRef Id="cmp31610C192ED2776279BBDA3D9905552E" /> | ||
<ComponentRef Id="cmpB0A6B8E083FEAEC29D41F54189DC6605" /> | ||
<ComponentRef Id="cmpB2620706D83DB49D3434BB39A5495055" /> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,6 +50,18 @@ | |
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Reference Include="Microsoft.Azure.Management.Network, Version=14.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @kisantia this reference to the Network management library should be removed. Only the Network project should have a dependency on the management library. If you need to use the code from their library, please use the |
||
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Network.14.0.0-preview\lib\net452\Microsoft.Azure.Management.Network.dll</HintPath> | ||
<Private>True</Private> | ||
</Reference> | ||
<Reference Include="Microsoft.Rest.ClientRuntime, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> | ||
<HintPath>..\..\..\packages\Microsoft.Rest.ClientRuntime.2.3.9\lib\net452\Microsoft.Rest.ClientRuntime.dll</HintPath> | ||
<Private>True</Private> | ||
</Reference> | ||
<Reference Include="Microsoft.Rest.ClientRuntime.Azure, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> | ||
<HintPath>..\..\..\packages\Microsoft.Rest.ClientRuntime.Azure.3.3.9\lib\net452\Microsoft.Rest.ClientRuntime.Azure.dll</HintPath> | ||
<Private>True</Private> | ||
</Reference> | ||
<Reference Include="System.Management.Automation, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" /> | ||
<Reference Include="System.Security" /> | ||
<Reference Include="System.ServiceModel" /> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,12 +6,13 @@ | |
<package id="Microsoft.Azure.Common" version="2.1.0" targetFramework="net452" /> | ||
<package id="Microsoft.Azure.Common.Dependencies" version="1.0.0" targetFramework="net452" /> | ||
<package id="Microsoft.Azure.KeyVault.Core" version="1.0.0" targetFramework="net452" /> | ||
<package id="Microsoft.Azure.Management.Network" version="14.0.0-preview" targetFramework="net452" /> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @kisantia same comment |
||
<package id="Microsoft.Bcl" version="1.1.9" targetFramework="net452" /> | ||
<package id="Microsoft.Bcl.Async" version="1.0.168" targetFramework="net452" /> | ||
<package id="Microsoft.Bcl.Build" version="1.0.14" targetFramework="net452" /> | ||
<package id="Microsoft.Net.Http" version="2.2.28" targetFramework="net452" /> | ||
<package id="Microsoft.Rest.ClientRuntime" version="2.3.8" targetFramework="net452" /> | ||
<package id="Microsoft.Rest.ClientRuntime.Azure" version="3.3.8" targetFramework="net452" /> | ||
<package id="Microsoft.Rest.ClientRuntime" version="2.3.9" targetFramework="net452" /> | ||
<package id="Microsoft.Rest.ClientRuntime.Azure" version="3.3.9" targetFramework="net452" /> | ||
<package id="Microsoft.WindowsAzure.Management" version="4.1.1" targetFramework="net452" /> | ||
<package id="Newtonsoft.Json" version="6.0.8" targetFramework="net452" /> | ||
</packages> |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -135,6 +135,15 @@ public string RMStorageDataPlaneModule | |
} | ||
} | ||
|
||
public string RMNetworkModule | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @kisantia same comment |
||
{ | ||
get | ||
{ | ||
return Path.Combine(this.PackageDirectory, | ||
@"ResourceManager\AzureResourceManager\AzureRM.Network\AzureRM.Network.psd1"); | ||
} | ||
} | ||
|
||
public string GetRMModulePath(string psd1FileName) | ||
{ | ||
string basename = Path.GetFileNameWithoutExtension(psd1FileName); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -82,10 +82,22 @@ | |
<HintPath>..\..\..\packages\Microsoft.Data.Services.Client.5.8.2\lib\net40\Microsoft.Data.Services.Client.dll</HintPath> | ||
<Private>True</Private> | ||
</Reference> | ||
<Reference Include="Microsoft.Rest.ClientRuntime, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @kisantia please revert the changes in this file. All changes to dependencies should be done in |
||
<HintPath>..\..\..\packages\Microsoft.Rest.ClientRuntime.2.3.9\lib\net452\Microsoft.Rest.ClientRuntime.dll</HintPath> | ||
<Private>True</Private> | ||
</Reference> | ||
<Reference Include="Microsoft.Rest.ClientRuntime.Azure, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> | ||
<HintPath>..\..\..\packages\Microsoft.Rest.ClientRuntime.Azure.3.3.9\lib\net452\Microsoft.Rest.ClientRuntime.Azure.dll</HintPath> | ||
<Private>True</Private> | ||
</Reference> | ||
<Reference Include="Microsoft.WindowsAzure.Storage, Version=8.1.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> | ||
<HintPath>..\..\..\packages\WindowsAzure.Storage.8.1.1\lib\net45\Microsoft.WindowsAzure.Storage.dll</HintPath> | ||
<Private>True</Private> | ||
</Reference> | ||
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> | ||
<HintPath>..\..\..\packages\Newtonsoft.Json.6.0.8\lib\net45\Newtonsoft.Json.dll</HintPath> | ||
<Private>True</Private> | ||
</Reference> | ||
<Reference Include="System.IO.Compression.FileSystem" /> | ||
<Reference Include="System.Management.Automation, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" /> | ||
<Reference Include="System.Spatial, Version=5.8.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,5 +5,8 @@ | |
<package id="Microsoft.Azure.Management.Compute" version="16.2.0" targetFramework="net452" /> | ||
<package id="Microsoft.Azure.Management.Network" version="14.0.0-preview" targetFramework="net452" /> | ||
<package id="Microsoft.Azure.Management.Storage" version="4.1.0-preview" targetFramework="net45" /> | ||
<package id="Microsoft.Rest.ClientRuntime" version="2.3.9" targetFramework="net452" /> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @kisantia same comment about reverting the changes in this file |
||
<package id="Microsoft.Rest.ClientRuntime.Azure" version="3.3.9" targetFramework="net452" /> | ||
<package id="Newtonsoft.Json" version="6.0.8" targetFramework="net452" /> | ||
<package id="WindowsAzure.Storage" version="8.1.1" targetFramework="net452" /> | ||
</packages> |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,7 +37,7 @@ | |
* Marked parameter -ProbeEnabled as obsolete | ||
- Add-AzureRmApplicationGatewayBackendHttpSettings | ||
- New-AzureRmApplicationGatewayBackendHttpSettings | ||
- Set-AzureRmApplicationGatewayBackendHttpSettings | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @kisantia please revert the change in this file |
||
- Set-AzureRmApplicationGatewayBackendHttpSettings | ||
|
||
## Version 4.2.1 | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -177,7 +177,11 @@ CmdletsToExport = 'Get-AzureRmSqlDatabaseTransparentDataEncryption', | |
'Get-AzureRmSqlSyncMember', 'Remove-AzureRmSqlSyncMember', | ||
'New-AzureRmSqlSyncAgent', 'Get-AzureRmSqlSyncAgent', | ||
'Remove-AzureRmSqlSyncAgent', 'New-AzureRmSqlSyncAgentKey', | ||
'Get-AzureRmSqlSyncAgentLinkedDatabase' | ||
'Get-AzureRmSqlSyncAgentLinkedDatabase', | ||
'New-AzureRmSqlServerVirtualNetworkRule', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: fix indentation here There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fix spacing (use spaces not tabs) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. will make these changes |
||
'Set-AzureRmSqlServerVirtualNetworkRule', | ||
'Get-AzureRmSqlServerVirtualNetworkRule', | ||
'Remove-AzureRmSqlServerVirtualNetworkRule' | ||
|
||
# Variables to export from this module | ||
# VariablesToExport = @() | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -76,9 +76,12 @@ | |
<Reference Include="Microsoft.Azure.Management.Authorization, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> | ||
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Authorization.2.0.0\lib\net40\Microsoft.Azure.Management.Authorization.dll</HintPath> | ||
<Private>True</Private> | ||
</Reference> | ||
<Reference Include="Microsoft.Azure.Management.Network"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @kisantia please use the generated Network code in |
||
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Network.14.0.0-preview\lib\net452\Microsoft.Azure.Management.Network.dll</HintPath> | ||
</Reference> | ||
<Reference Include="Microsoft.Azure.Management.Sql, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> | ||
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Sql.1.5.0-preview\lib\net452\Microsoft.Azure.Management.Sql.dll</HintPath> | ||
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Sql.1.6.0-preview\lib\net452\Microsoft.Azure.Management.Sql.dll</HintPath> | ||
<Private>True</Private> | ||
</Reference> | ||
<Reference Include="Microsoft.Azure.Management.Storage"> | ||
|
@@ -310,6 +313,7 @@ | |
<Compile Include="ScenarioTests\SqlTestsBase.cs" /> | ||
<Compile Include="ScenarioTests\TransparentDataEncryptionCrudTests.cs" /> | ||
<Compile Include="ScenarioTests\ServerKeyVaultKeyTests.cs" /> | ||
<Compile Include="ScenarioTests\VirtualNetworkRuleTest.cs" /> | ||
<Compile Include="ScenarioTests\IndexRecommendationTests.cs" /> | ||
<Compile Include="ScenarioTests\ImportExportTests.cs" /> | ||
<Compile Include="UnitTests\AzureSqlDatabaseImportExportTests.cs" /> | ||
|
@@ -396,6 +400,9 @@ | |
<None Include="ScenarioTests\ServerKeyVaultKeyTests.ps1"> | ||
<CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||
</None> | ||
<None Include="ScenarioTests\VirtualNetworkRuleTest.ps1"> | ||
<CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||
</None> | ||
<None Include="SessionRecords\Microsoft.Azure.Commands.Sql.Test.ScenarioTests.AdvisorTests\TestGetElasticPoolAdvisor.json"> | ||
<CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||
</None> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
// ---------------------------------------------------------------------------------- | ||
// | ||
// Copyright Microsoft Corporation | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// ---------------------------------------------------------------------------------- | ||
|
||
using Microsoft.Azure.Commands.ScenarioTest.SqlTests; | ||
using Microsoft.Azure.Management.Resources; | ||
using Microsoft.Azure.ServiceManagemenet.Common.Models; | ||
using Microsoft.WindowsAzure.Commands.ScenarioTest; | ||
using Xunit; | ||
using Xunit.Abstractions; | ||
using RestTestFramework = Microsoft.Rest.ClientRuntime.Azure.TestFramework; | ||
|
||
namespace Microsoft.Azure.Commands.Sql.Test.ScenarioTests | ||
{ | ||
public class VirtualNetworkRuleTest : SqlTestsBase | ||
{ | ||
protected override void SetupManagementClients(RestTestFramework.MockContext context) | ||
{ | ||
var sqlClient = GetSqlClient(context); | ||
var sqlLegacyClient = GetLegacySqlClient(); | ||
var resourcesClient = GetResourcesClient(); | ||
var newResourcesClient = GetResourcesClient(context); | ||
var networkClient = GetNetworkClient(context); | ||
helper.SetupSomeOfManagementClients(sqlClient, sqlLegacyClient, resourcesClient, newResourcesClient, networkClient); | ||
} | ||
public VirtualNetworkRuleTest(ITestOutputHelper output) : base(output) | ||
{ | ||
} | ||
|
||
[Fact] | ||
[Trait(Category.AcceptanceType, Category.CheckIn)] | ||
public void TestVirtualNetworkRuleCreateAndUpdate() | ||
{ | ||
RunPowerShellTest("Test-CreateAndUpdateVirtualNetworkRule"); | ||
} | ||
|
||
[Fact] | ||
[Trait(Category.AcceptanceType, Category.CheckIn)] | ||
public void TestVirtualNetworkRuleGet() | ||
{ | ||
RunPowerShellTest("Test-GetVirtualNetworkRule"); | ||
} | ||
|
||
[Fact] | ||
[Trait(Category.AcceptanceType, Category.CheckIn)] | ||
public void TestVirtualNetworkRuleRemove() | ||
{ | ||
RunPowerShellTest("Test-RemoveVirtualNetworkRule"); | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kisantia pulling the latest changes from the preview branch will remove the need for this change