Skip to content

Commit cac4a86

Browse files
committed
Upgrade to SRP SDK 7.0 with migrate NetworkRule API change
1 parent 6f4e2c5 commit cac4a86

13 files changed

+39
-33
lines changed

src/ResourceManager/Storage/Commands.Management.Storage.Test/Commands.Management.Storage.Test.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@
5151
<Reference Include="Microsoft.Azure.Management.Authorization">
5252
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Authorization.2.0.0\lib\net40\Microsoft.Azure.Management.Authorization.dll</HintPath>
5353
</Reference>
54-
<Reference Include="Microsoft.Azure.Management.Storage, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
55-
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Storage.6.5.0-preview\lib\net452\Microsoft.Azure.Management.Storage.dll</HintPath>
54+
<Reference Include="Microsoft.Azure.Management.Storage, Version=7.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
55+
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Storage.7.1.0-preview\lib\net452\Microsoft.Azure.Management.Storage.dll</HintPath>
5656
</Reference>
5757
<Reference Include="Microsoft.Azure.ResourceManager, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
5858
<SpecificVersion>False</SpecificVersion>
@@ -72,10 +72,10 @@
7272
<HintPath>..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.28.3\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll</HintPath>
7373
</Reference>
7474
<Reference Include="Microsoft.Rest.ClientRuntime, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
75-
<HintPath>..\..\..\packages\Microsoft.Rest.ClientRuntime.2.3.8\lib\net452\Microsoft.Rest.ClientRuntime.dll</HintPath>
75+
<HintPath>..\..\..\packages\Microsoft.Rest.ClientRuntime.2.3.10\lib\net452\Microsoft.Rest.ClientRuntime.dll</HintPath>
7676
</Reference>
7777
<Reference Include="Microsoft.Rest.ClientRuntime.Azure, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
78-
<HintPath>..\..\..\packages\Microsoft.Rest.ClientRuntime.Azure.3.3.7\lib\net452\Microsoft.Rest.ClientRuntime.Azure.dll</HintPath>
78+
<HintPath>..\..\..\packages\Microsoft.Rest.ClientRuntime.Azure.3.3.10\lib\net452\Microsoft.Rest.ClientRuntime.Azure.dll</HintPath>
7979
</Reference>
8080
<Reference Include="Microsoft.Rest.ClientRuntime.Azure.Authentication, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
8181
<HintPath>..\..\..\packages\Microsoft.Rest.ClientRuntime.Azure.Authentication.2.2.9-preview\lib\net45\Microsoft.Rest.ClientRuntime.Azure.Authentication.dll</HintPath>

src/ResourceManager/Storage/Commands.Management.Storage.Test/packages.config

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@
66
<package id="Microsoft.Azure.Gallery" version="2.6.2-preview" targetFramework="net45" />
77
<package id="Microsoft.Azure.Management.Authorization" version="1.0.0" targetFramework="net45" />
88
<package id="Microsoft.Azure.Management.Resources" version="2.20.0-preview" targetFramework="net45" />
9-
<package id="Microsoft.Azure.Management.Storage" version="6.5.0-preview" targetFramework="net452" />
9+
<package id="Microsoft.Azure.Management.Storage" version="7.1.0-preview" targetFramework="net452" />
1010
<package id="Microsoft.Azure.Test.Framework" version="1.0.6179.26854-prerelease" targetFramework="net45" />
1111
<package id="Microsoft.Azure.Test.HttpRecorder" version="1.6.7-preview" targetFramework="net45" />
1212
<package id="Microsoft.Bcl" version="1.1.9" targetFramework="net45" />
1313
<package id="Microsoft.Bcl.Async" version="1.0.168" targetFramework="net45" />
1414
<package id="Microsoft.Bcl.Build" version="1.0.14" targetFramework="net45" />
1515
<package id="Microsoft.IdentityModel.Clients.ActiveDirectory" version="2.28.3" targetFramework="net45" />
1616
<package id="Microsoft.Net.Http" version="2.2.28" targetFramework="net45" />
17-
<package id="Microsoft.Rest.ClientRuntime" version="2.3.8" targetFramework="net452" />
18-
<package id="Microsoft.Rest.ClientRuntime.Azure" version="3.3.7" targetFramework="net452" />
17+
<package id="Microsoft.Rest.ClientRuntime" version="2.3.10" targetFramework="net452" />
18+
<package id="Microsoft.Rest.ClientRuntime.Azure" version="3.3.10" targetFramework="net452" />
1919
<package id="Microsoft.Rest.ClientRuntime.Azure.Authentication" version="2.2.9-preview" targetFramework="net45" />
2020
<package id="Microsoft.Rest.ClientRuntime.Azure.TestFramework" version="1.5.0-preview" targetFramework="net45" />
2121
<package id="Newtonsoft.Json" version="6.0.8" targetFramework="net45" />

src/ResourceManager/Storage/Commands.Management.Storage/Commands.Management.Storage.csproj

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@
5252
<HintPath>..\..\..\packages\Microsoft.Azure.KeyVault.Core.1.0.0\lib\net40\Microsoft.Azure.KeyVault.Core.dll</HintPath>
5353
<Private>True</Private>
5454
</Reference>
55-
<Reference Include="Microsoft.Azure.Management.Storage, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
56-
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Storage.6.5.0-preview\lib\net452\Microsoft.Azure.Management.Storage.dll</HintPath>
55+
<Reference Include="Microsoft.Azure.Management.Storage, Version=7.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
56+
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Storage.7.1.0-preview\lib\net452\Microsoft.Azure.Management.Storage.dll</HintPath>
5757
</Reference>
5858
<Reference Include="Microsoft.Data.Edm, Version=5.8.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
5959
<HintPath>..\..\..\packages\Microsoft.Data.Edm.5.8.2\lib\net40\Microsoft.Data.Edm.dll</HintPath>
@@ -67,10 +67,13 @@
6767
<HintPath>..\..\..\packages\Microsoft.Data.Services.Client.5.8.2\lib\net40\Microsoft.Data.Services.Client.dll</HintPath>
6868
<Private>True</Private>
6969
</Reference>
70+
<Reference Include="Microsoft.Rest.ClientRuntime, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
71+
<Reference Include="Microsoft.Rest.ClientRuntime.Azure, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
7072
<Reference Include="Microsoft.WindowsAzure.Storage, Version=8.1.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
7173
<HintPath>..\..\..\packages\WindowsAzure.Storage.8.1.1\lib\net45\Microsoft.WindowsAzure.Storage.dll</HintPath>
7274
<Private>True</Private>
7375
</Reference>
76+
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL" />
7477
<Reference Include="System.Management.Automation, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
7578
<Reference Include="System.Spatial, Version=5.8.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
7679
<HintPath>..\..\..\packages\System.Spatial.5.8.2\lib\net40\System.Spatial.dll</HintPath>

src/ResourceManager/Storage/Commands.Management.Storage/Models/PSNetworkRule.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ public static VirtualNetworkRule ParseStorageNetworkRuleVirtualNetworkRule(PSVir
223223
}
224224

225225
//Parse Storage NetworkRule object in SDK to wrapped PSNetworkRuleSet
226-
public static PSNetworkRuleSet ParsePSNetworkRule(StorageNetworkAcls rules)
226+
public static PSNetworkRuleSet ParsePSNetworkRule(NetworkRuleSet rules)
227227
{
228228
if (rules == null)
229229
{
@@ -257,13 +257,13 @@ public static PSNetworkRuleSet ParsePSNetworkRule(StorageNetworkAcls rules)
257257
}
258258

259259
//Parse wrapped PSNetworkRuleSet to storage NetworkRule object in SDK
260-
public static StorageNetworkAcls ParseStorageNetworkRule(PSNetworkRuleSet rules)
260+
public static NetworkRuleSet ParseStorageNetworkRule(PSNetworkRuleSet rules)
261261
{
262262
if (rules == null)
263263
{
264264
return null;
265265
}
266-
StorageNetworkAcls returnRules = new StorageNetworkAcls();
266+
NetworkRuleSet returnRules = new NetworkRuleSet();
267267
returnRules.Bypass = ParseStorageNetworkRuleBypass(rules.Bypass);
268268
returnRules.DefaultAction = ParseStorageNetworkRuleDefaultAction(rules.DefaultAction);
269269

src/ResourceManager/Storage/Commands.Management.Storage/Models/PSStorageAccount.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public PSStorageAccount(StorageModels.StorageAccount storageAccount)
4949
this.StatusOfSecondary = storageAccount.StatusOfSecondary;
5050
this.Tags = storageAccount.Tags;
5151
this.EnableHttpsTrafficOnly = storageAccount.EnableHttpsTrafficOnly;
52-
this.NetworkRuleSet = PSNetworkRuleSet.ParsePSNetworkRule(storageAccount.NetworkAcls);
52+
this.NetworkRuleSet = PSNetworkRuleSet.ParsePSNetworkRule(storageAccount.NetworkRuleSet);
5353
}
5454

5555
public string ResourceGroupName { get; set; }

src/ResourceManager/Storage/Commands.Management.Storage/StorageAccount/AddAzureStorageAccountNetworkRule.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,11 @@ public override void ExecuteCmdlet()
100100
var storageAccount = this.StorageClient.StorageAccounts.GetProperties(
101101
this.ResourceGroupName,
102102
this.Name);
103-
StorageNetworkAcls storageACL = storageAccount.NetworkAcls;
103+
NetworkRuleSet storageACL = storageAccount.NetworkRuleSet;
104104

105105
if (storageACL == null)
106106
{
107-
storageACL = new StorageNetworkAcls();
107+
storageACL = new NetworkRuleSet();
108108
}
109109

110110
switch (ParameterSetName)
@@ -146,7 +146,7 @@ public override void ExecuteCmdlet()
146146
}
147147

148148
StorageAccountUpdateParameters updateParameters = new StorageAccountUpdateParameters();
149-
updateParameters.NetworkAcls = storageACL;
149+
updateParameters.NetworkRuleSet = storageACL;
150150

151151
var updatedAccountResponse = this.StorageClient.StorageAccounts.Update(
152152
this.ResourceGroupName,
@@ -159,11 +159,11 @@ public override void ExecuteCmdlet()
159159
{
160160
case NetWorkRuleStringParameterSet:
161161
case NetworkRuleObjectParameterSet:
162-
WriteObject(PSNetworkRuleSet.ParsePSNetworkRule(storageAccount.NetworkAcls).VirtualNetworkRules);
162+
WriteObject(PSNetworkRuleSet.ParsePSNetworkRule(storageAccount.NetworkRuleSet).VirtualNetworkRules);
163163
break;
164164
case IpRuleStringParameterSet:
165165
case IpRuleObjectParameterSet:
166-
WriteObject(PSNetworkRuleSet.ParsePSNetworkRule(storageAccount.NetworkAcls).IpRules);
166+
WriteObject(PSNetworkRuleSet.ParsePSNetworkRule(storageAccount.NetworkRuleSet).IpRules);
167167
break;
168168
}
169169
}

src/ResourceManager/Storage/Commands.Management.Storage/StorageAccount/GetAzureStorageAccountNetworkRuleSet.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ public override void ExecuteCmdlet()
5050
var storageAccount = this.StorageClient.StorageAccounts.GetProperties(
5151
this.ResourceGroupName,
5252
this.Name);
53-
if (storageAccount.NetworkAcls != null)
53+
if (storageAccount.NetworkRuleSet != null)
5454
{
55-
WriteObject(PSNetworkRuleSet.ParsePSNetworkRule(storageAccount.NetworkAcls));
55+
WriteObject(PSNetworkRuleSet.ParsePSNetworkRule(storageAccount.NetworkRuleSet));
5656
}
5757
}
5858
}

src/ResourceManager/Storage/Commands.Management.Storage/StorageAccount/NewAzureStorageAccount.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ public override void ExecuteCmdlet()
190190
}
191191
if (NetworkRuleSet != null)
192192
{
193-
createParameters.NetworkAcls = PSNetworkRuleSet.ParseStorageNetworkRule(NetworkRuleSet);
193+
createParameters.NetworkRuleSet = PSNetworkRuleSet.ParseStorageNetworkRule(NetworkRuleSet);
194194
}
195195

196196
var createAccountResponse = this.StorageClient.StorageAccounts.Create(

src/ResourceManager/Storage/Commands.Management.Storage/StorageAccount/RemoveAzureStorageAccountNetworkRule.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,11 @@ public override void ExecuteCmdlet()
100100
var storageAccount = this.StorageClient.StorageAccounts.GetProperties(
101101
this.ResourceGroupName,
102102
this.Name);
103-
StorageNetworkAcls storageACL = storageAccount.NetworkAcls;
103+
NetworkRuleSet storageACL = storageAccount.NetworkRuleSet;
104104

105105
if (storageACL == null)
106106
{
107-
storageACL = new StorageNetworkAcls();
107+
storageACL = new NetworkRuleSet();
108108
}
109109

110110
switch (ParameterSetName)
@@ -150,7 +150,7 @@ public override void ExecuteCmdlet()
150150
}
151151

152152
StorageAccountUpdateParameters updateParameters = new StorageAccountUpdateParameters();
153-
updateParameters.NetworkAcls = storageACL;
153+
updateParameters.NetworkRuleSet = storageACL;
154154

155155
var updatedAccountResponse = this.StorageClient.StorageAccounts.Update(
156156
this.ResourceGroupName,
@@ -163,11 +163,11 @@ public override void ExecuteCmdlet()
163163
{
164164
case NetWorkRuleStringParameterSet:
165165
case NetworkRuleObjectParameterSet:
166-
WriteObject(PSNetworkRuleSet.ParsePSNetworkRule(storageAccount.NetworkAcls).VirtualNetworkRules);
166+
WriteObject(PSNetworkRuleSet.ParsePSNetworkRule(storageAccount.NetworkRuleSet).VirtualNetworkRules);
167167
break;
168168
case IpRuleStringParameterSet:
169169
case IpRuleObjectParameterSet:
170-
WriteObject(PSNetworkRuleSet.ParsePSNetworkRule(storageAccount.NetworkAcls).IpRules);
170+
WriteObject(PSNetworkRuleSet.ParsePSNetworkRule(storageAccount.NetworkRuleSet).IpRules);
171171
break;
172172
}
173173
}

src/ResourceManager/Storage/Commands.Management.Storage/StorageAccount/SetAzureStorageAccount.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ public override void ExecuteCmdlet()
243243
}
244244
if (NetworkRuleSet != null)
245245
{
246-
updateParameters.NetworkAcls = PSNetworkRuleSet.ParseStorageNetworkRule(NetworkRuleSet);
246+
updateParameters.NetworkRuleSet = PSNetworkRuleSet.ParseStorageNetworkRule(NetworkRuleSet);
247247
}
248248

249249
var updatedAccountResponse = this.StorageClient.StorageAccounts.Update(

src/ResourceManager/Storage/Commands.Management.Storage/StorageAccount/UpdateAzureStorageAccountNetworkRuleSet.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,11 +131,11 @@ public override void ExecuteCmdlet()
131131
var storageAccount = this.StorageClient.StorageAccounts.GetProperties(
132132
this.ResourceGroupName,
133133
this.Name);
134-
StorageNetworkAcls storageACL = storageAccount.NetworkAcls;
134+
NetworkRuleSet storageACL = storageAccount.NetworkRuleSet;
135135

136136
if (storageACL == null)
137137
{
138-
storageACL = new StorageNetworkAcls();
138+
storageACL = new NetworkRuleSet();
139139
}
140140

141141
PSNetworkRuleSet psNetworkRule = PSNetworkRuleSet.ParsePSNetworkRule(storageACL);
@@ -161,7 +161,7 @@ public override void ExecuteCmdlet()
161161
}
162162

163163
StorageAccountUpdateParameters updateParameters = new StorageAccountUpdateParameters();
164-
updateParameters.NetworkAcls = PSNetworkRuleSet.ParseStorageNetworkRule(psNetworkRule);
164+
updateParameters.NetworkRuleSet = PSNetworkRuleSet.ParseStorageNetworkRule(psNetworkRule);
165165

166166
var updatedAccountResponse = this.StorageClient.StorageAccounts.Update(
167167
this.ResourceGroupName,
@@ -170,7 +170,7 @@ public override void ExecuteCmdlet()
170170

171171
storageAccount = this.StorageClient.StorageAccounts.GetProperties(this.ResourceGroupName, this.Name);
172172

173-
WriteObject(PSNetworkRuleSet.ParsePSNetworkRule(storageAccount.NetworkAcls));
173+
WriteObject(PSNetworkRuleSet.ParsePSNetworkRule(storageAccount.NetworkRuleSet));
174174
}
175175
}
176176
}
Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
<?xml version="1.0" encoding="utf-8"?>
1+
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
33
<package id="Microsoft.Azure.KeyVault.Core" version="1.0.0" targetFramework="net45" />
4-
<package id="Microsoft.Azure.Management.Storage" version="6.5.0-preview" targetFramework="net452" />
4+
<package id="Microsoft.Azure.Management.Storage" version="7.1.0-preview" targetFramework="net452" />
5+
<package id="Microsoft.Rest.ClientRuntime" version="2.3.10" targetFramework="net452" />
6+
<package id="Microsoft.Rest.ClientRuntime.Azure" version="3.3.10" targetFramework="net452" />
7+
<package id="Newtonsoft.Json" version="6.0.8" targetFramework="net452" />
58
<package id="WindowsAzure.Storage" version="8.1.1" targetFramework="net452" />
69
</packages>
Binary file not shown.

0 commit comments

Comments
 (0)