Skip to content

Commit 4821d28

Browse files
authored
Merge pull request #9037 from wastoresh/srpsdk11
[Storage] Upgrade to SRPSDK 11.0
2 parents 04ae7cd + d5e67d6 commit 4821d28

31 files changed

+4055
-4494
lines changed

src/Storage/Storage.Management.Test/ScenarioTests/StorageAccountTests.ps1

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ function Test-StorageAccount
3939
$job | Wait-Job
4040
$stos = Get-AzStorageAccount -ResourceGroupName $rgname;
4141

42-
$stotype = 'StandardGRS';
4342
Retry-IfException { $global:sto = Get-AzStorageAccount -ResourceGroupName $rgname -Name $stoname; }
4443
Assert-AreEqual $stoname $sto.StorageAccountName;
4544
Assert-AreEqual $stotype $sto.Sku.Name;
@@ -52,7 +51,6 @@ function Test-StorageAccount
5251
# TODO: Still need to do retry for Set-, even after Get- returns it.
5352
Retry-IfException { $global:sto = Set-AzStorageAccount -ResourceGroupName $rgname -Name $stoname -Type $stotype -AccessTier $accessTier -Force }
5453
$sto = Get-AzStorageAccount -ResourceGroupName $rgname -Name $stoname;
55-
$stotype = 'StandardLRS';
5654
Assert-AreEqual $stoname $sto.StorageAccountName;
5755
Assert-AreEqual $stotype $sto.Sku.Name;
5856
Assert-AreEqual $loc.ToLower().Replace(" ", "") $sto.Location;
@@ -64,7 +62,6 @@ function Test-StorageAccount
6462
Set-AzStorageAccount -ResourceGroupName $rgname -Name $stoname -Type $stotype -AccessTier $accessTier -Force
6563

6664
$sto = Get-AzStorageAccount -ResourceGroupName $rgname -Name $stoname;
67-
$stotype = 'StandardRAGRS';
6865
Assert-AreEqual $stoname $sto.StorageAccountName;
6966
Assert-AreEqual $stotype $sto.Sku.Name;
7067
Assert-AreEqual $loc.ToLower().Replace(" ", "") $sto.Location;
@@ -75,7 +72,6 @@ function Test-StorageAccount
7572
Set-AzStorageAccount -ResourceGroupName $rgname -Name $stoname -Type $stotype
7673

7774
$sto = Get-AzStorageAccount -ResourceGroupName $rgname -Name $stoname;
78-
$stotype = 'StandardGRS';
7975
Assert-AreEqual $stoname $sto.StorageAccountName;
8076
Assert-AreEqual $stotype $sto.Sku.Name;
8177
Assert-AreEqual $loc.ToLower().Replace(" ", "") $sto.Location;
@@ -130,7 +126,6 @@ function Test-NewAzureStorageAccount
130126
$loc = Get-ProviderLocation ResourceManagement;
131127
New-AzStorageAccount -ResourceGroupName $rgname -Name $stoname -Location $loc -Type $stotype -Kind $kind;
132128
$sto = Get-AzStorageAccount -ResourceGroupName $rgname -Name $stoname;
133-
$stotype = 'StandardLRS';
134129
Assert-AreEqual $stoname $sto.StorageAccountName;
135130
Assert-AreEqual $stotype $sto.Sku.Name;
136131
Assert-AreEqual $loc.ToLower().Replace(" ", "") $sto.Location;
@@ -162,15 +157,14 @@ function Test-GetAzureStorageAccount
162157
$stoname = 'sto' + $rgname;
163158
$stotype = 'Standard_GRS';
164159
$loc = Get-ProviderLocation ResourceManagement;
165-
$kind = 'Storage'
160+
$kind = 'StorageV2'
166161

167162
New-AzResourceGroup -Name $rgname -Location $loc;
168163
Write-Output ("Resource Group created")
169164

170165
New-AzStorageAccount -ResourceGroupName $rgname -Name $stoname -Location $loc -Type $stotype ;
171166

172167
Retry-IfException { $global:sto = Get-AzStorageAccount -ResourceGroupName $rgname -Name $stoname; }
173-
$stotype = 'StandardGRS';
174168
Assert-AreEqual $stoname $sto.StorageAccountName;
175169
Assert-AreEqual $stotype $sto.Sku.Name;
176170
Assert-AreEqual $loc.ToLower().Replace(" ", "") $sto.Location;
@@ -216,7 +210,6 @@ function Test-SetAzureStorageAccount
216210
New-AzStorageAccount -ResourceGroupName $rgname -Name $stoname -Location $loc -Type $stotype -Kind $kind -EnableHttpsTrafficOnly $true -EnableHierarchicalNamespace $true;
217211

218212
Retry-IfException { $global:sto = Get-AzStorageAccount -ResourceGroupName $rgname -Name $stoname; }
219-
$stotype = 'StandardGRS';
220213
Assert-AreEqual $stoname $sto.StorageAccountName;
221214
Assert-AreEqual $stotype $sto.Sku.Name;
222215
Assert-AreEqual $loc.ToLower().Replace(" ", "") $sto.Location;
@@ -240,7 +233,6 @@ function Test-SetAzureStorageAccount
240233
Assert-AreEqual $true $sto.EnableHierarchicalNamespace;
241234

242235
$sto = Get-AzStorageAccount -ResourceGroupName $rgname -Name $stoname;
243-
$stotype = 'StandardRAGRS';
244236
Assert-AreEqual $stoname $sto.StorageAccountName;
245237
Assert-AreEqual $stotype $sto.Sku.Name;
246238
Assert-AreEqual $loc.ToLower().Replace(" ", "") $sto.Location;
@@ -309,7 +301,6 @@ function Test-SetAzureRmStorageAccountKeySource
309301
New-AzStorageAccount -ResourceGroupName $rgname -Name $stoname -Location $loc -Type $stotype;
310302

311303
$sto = Set-AzStorageAccount -ResourceGroupName $rgname -Name $stoname -StorageEncryption
312-
$stotype = 'StandardGRS';
313304
Assert-AreEqual $stoname $sto.StorageAccountName;
314305
Assert-AreEqual $stotype $sto.Sku.Name;
315306
Assert-AreEqual $loc.ToLower().Replace(" ", "") $sto.Location;
@@ -639,7 +630,6 @@ function Test-SetAzureStorageAccountStorageV2
639630
New-AzStorageAccount -ResourceGroupName $rgname -Name $stoname -Location $loc -Type $stotype -Kind $kind;
640631

641632
Retry-IfException { $global:sto = Get-AzStorageAccount -ResourceGroupName $rgname -Name $stoname; }
642-
$stotype = 'StandardGRS';
643633
Assert-AreEqual $stoname $sto.StorageAccountName;
644634
Assert-AreEqual $stotype $sto.Sku.Name;
645635
Assert-AreEqual $loc.ToLower().Replace(" ", "") $sto.Location;
@@ -742,7 +732,6 @@ function Test-NewAzureStorageAccountBlockBlobStorage
742732

743733
New-AzureRmStorageAccount -ResourceGroupName $rgname -Name $stoname -Location $loc -Type $stotype -Kind $kind;
744734
$sto = Get-AzureRmStorageAccount -ResourceGroupName $rgname -Name $stoname;
745-
$stotype = 'PremiumLRS';
746735
Assert-AreEqual $stoname $sto.StorageAccountName;
747736
Assert-AreEqual $stotype $sto.Sku.Name;
748737
Assert-AreEqual $loc.ToLower().Replace(" ", "") $sto.Location;
@@ -782,7 +771,6 @@ function Test-StorageAccountManagementPolicy
782771
New-AzureRmStorageAccount -ResourceGroupName $rgname -Name $stoname -Location $loc -Type $stotype -Kind $kind;
783772

784773
Retry-IfException { $global:sto = Get-AzureRmStorageAccount -ResourceGroupName $rgname -Name $stoname; }
785-
$stotype = 'StandardGRS';
786774
Assert-AreEqual $stoname $sto.StorageAccountName;
787775
Assert-AreEqual $stotype $sto.Sku.Name;
788776
Assert-AreEqual $loc.ToLower().Replace(" ", "") $sto.Location;

src/Storage/Storage.Management.Test/SessionRecords/Microsoft.Azure.Commands.Management.Storage.Test.ScenarioTests.StorageAccountTests/TestGetAzureStorageAccount.json

Lines changed: 140 additions & 329 deletions
Large diffs are not rendered by default.

src/Storage/Storage.Management.Test/SessionRecords/Microsoft.Azure.Commands.Management.Storage.Test.ScenarioTests.StorageAccountTests/TestGetAzureStorageAccountKey.json

Lines changed: 121 additions & 121 deletions
Large diffs are not rendered by default.

src/Storage/Storage.Management.Test/SessionRecords/Microsoft.Azure.Commands.Management.Storage.Test.ScenarioTests.StorageAccountTests/TestGetAzureStorageLocationUsage.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
22
"Entries": [
33
{
4-
"RequestUri": "/subscriptions/ce4a7590-4722-4bcf-a2c6-e473e9f11778/providers/Microsoft.Storage/locations/eastus2%28stage%29/usages?api-version=2018-11-01",
5-
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvY2U0YTc1OTAtNDcyMi00YmNmLWEyYzYtZTQ3M2U5ZjExNzc4L3Byb3ZpZGVycy9NaWNyb3NvZnQuU3RvcmFnZS9sb2NhdGlvbnMvZWFzdHVzMiUyOHN0YWdlJTI5L3VzYWdlcz9hcGktdmVyc2lvbj0yMDE4LTExLTAx",
4+
"RequestUri": "/subscriptions/ce4a7590-4722-4bcf-a2c6-e473e9f11778/providers/Microsoft.Storage/locations/eastus2%28stage%29/usages?api-version=2019-04-01",
5+
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvY2U0YTc1OTAtNDcyMi00YmNmLWEyYzYtZTQ3M2U5ZjExNzc4L3Byb3ZpZGVycy9NaWNyb3NvZnQuU3RvcmFnZS9sb2NhdGlvbnMvZWFzdHVzMiUyOHN0YWdlJTI5L3VzYWdlcz9hcGktdmVyc2lvbj0yMDE5LTA0LTAx",
66
"RequestMethod": "GET",
77
"RequestBody": "",
88
"RequestHeaders": {
99
"x-ms-client-request-id": [
10-
"4b708fff-fea3-4c66-b96c-71341772642e"
10+
"43479304-72fe-4301-a6c4-aa96181febaf"
1111
],
1212
"Accept-Language": [
1313
"en-US"
@@ -16,7 +16,7 @@
1616
"FxVersion/4.6.27207.03",
1717
"OSName/Windows",
1818
"OSVersion/Microsoft.Windows.10.0.17763.",
19-
"Microsoft.Azure.Management.Storage.StorageManagementClient/10.0.0.0"
19+
"Microsoft.Azure.Management.Storage.StorageManagementClient/11.0.0.0"
2020
]
2121
},
2222
"ResponseHeaders": {
@@ -27,7 +27,7 @@
2727
"no-cache"
2828
],
2929
"x-ms-request-id": [
30-
"8eb8990a-0a7c-44bb-95a4-48066cc59dce"
30+
"b384ce8f-73df-4be5-a320-4afe8a409bcb"
3131
],
3232
"Strict-Transport-Security": [
3333
"max-age=31536000; includeSubDomains"
@@ -36,19 +36,19 @@
3636
"Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0"
3737
],
3838
"x-ms-ratelimit-remaining-subscription-reads": [
39-
"11999"
39+
"11963"
4040
],
4141
"x-ms-correlation-request-id": [
42-
"d61c8bda-857e-4dbf-8ce5-d19a0bb251d3"
42+
"6e7a1a59-039e-433b-a39a-e4c7a3eff9b5"
4343
],
4444
"x-ms-routing-request-id": [
45-
"SOUTHEASTASIA:20190306T095939Z:d61c8bda-857e-4dbf-8ce5-d19a0bb251d3"
45+
"SOUTHEASTASIA:20190419T080733Z:6e7a1a59-039e-433b-a39a-e4c7a3eff9b5"
4646
],
4747
"X-Content-Type-Options": [
4848
"nosniff"
4949
],
5050
"Date": [
51-
"Wed, 06 Mar 2019 09:59:38 GMT"
51+
"Fri, 19 Apr 2019 08:07:33 GMT"
5252
],
5353
"Content-Length": [
5454
"129"
@@ -60,7 +60,7 @@
6060
"-1"
6161
]
6262
},
63-
"ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"unit\": \"Count\",\r\n \"currentValue\": 13,\r\n \"limit\": 250,\r\n \"name\": {\r\n \"value\": \"StorageAccounts\",\r\n \"localizedValue\": \"Storage Accounts\"\r\n }\r\n }\r\n ]\r\n}",
63+
"ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"unit\": \"Count\",\r\n \"currentValue\": 14,\r\n \"limit\": 250,\r\n \"name\": {\r\n \"value\": \"StorageAccounts\",\r\n \"localizedValue\": \"Storage Accounts\"\r\n }\r\n }\r\n ]\r\n}",
6464
"StatusCode": 200
6565
}
6666
],

src/Storage/Storage.Management.Test/SessionRecords/Microsoft.Azure.Commands.Management.Storage.Test.ScenarioTests.StorageAccountTests/TestNetworkRule.json

Lines changed: 376 additions & 376 deletions
Large diffs are not rendered by default.

src/Storage/Storage.Management.Test/SessionRecords/Microsoft.Azure.Commands.Management.Storage.Test.ScenarioTests.StorageAccountTests/TestNewAzureStorageAccount.json

Lines changed: 136 additions & 136 deletions
Large diffs are not rendered by default.

src/Storage/Storage.Management.Test/SessionRecords/Microsoft.Azure.Commands.Management.Storage.Test.ScenarioTests.StorageAccountTests/TestNewAzureStorageAccountBlockBlobStorage.json

Lines changed: 160 additions & 160 deletions
Large diffs are not rendered by default.

src/Storage/Storage.Management.Test/SessionRecords/Microsoft.Azure.Commands.Management.Storage.Test.ScenarioTests.StorageAccountTests/TestNewAzureStorageAccountKey.json

Lines changed: 225 additions & 168 deletions
Large diffs are not rendered by default.

src/Storage/Storage.Management.Test/SessionRecords/Microsoft.Azure.Commands.Management.Storage.Test.ScenarioTests.StorageAccountTests/TestPipingGetAccountToGetKey.json

Lines changed: 141 additions & 141 deletions
Large diffs are not rendered by default.

src/Storage/Storage.Management.Test/SessionRecords/Microsoft.Azure.Commands.Management.Storage.Test.ScenarioTests.StorageAccountTests/TestPipingNewUpdateAccount.json

Lines changed: 241 additions & 304 deletions
Large diffs are not rendered by default.

src/Storage/Storage.Management.Test/SessionRecords/Microsoft.Azure.Commands.Management.Storage.Test.ScenarioTests.StorageAccountTests/TestPipingSetStorageAccount.json

Lines changed: 147 additions & 147 deletions
Large diffs are not rendered by default.

src/Storage/Storage.Management.Test/SessionRecords/Microsoft.Azure.Commands.Management.Storage.Test.ScenarioTests.StorageAccountTests/TestRemoveAzureStorageAccount.json

Lines changed: 115 additions & 343 deletions
Large diffs are not rendered by default.

src/Storage/Storage.Management.Test/SessionRecords/Microsoft.Azure.Commands.Management.Storage.Test.ScenarioTests.StorageAccountTests/TestSetAzureRmStorageAccountKeySource.json

Lines changed: 161 additions & 161 deletions
Large diffs are not rendered by default.

src/Storage/Storage.Management.Test/SessionRecords/Microsoft.Azure.Commands.Management.Storage.Test.ScenarioTests.StorageAccountTests/TestSetAzureStorageAccount.json

Lines changed: 195 additions & 195 deletions
Large diffs are not rendered by default.

src/Storage/Storage.Management.Test/SessionRecords/Microsoft.Azure.Commands.Management.Storage.Test.ScenarioTests.StorageAccountTests/TestSetAzureStorageAccountStorageV2.json

Lines changed: 163 additions & 163 deletions
Large diffs are not rendered by default.

src/Storage/Storage.Management.Test/SessionRecords/Microsoft.Azure.Commands.Management.Storage.Test.ScenarioTests.StorageAccountTests/TestSetCurrentStorageAccount.json

Lines changed: 150 additions & 150 deletions
Large diffs are not rendered by default.

src/Storage/Storage.Management.Test/SessionRecords/Microsoft.Azure.Commands.Management.Storage.Test.ScenarioTests.StorageAccountTests/TestStorageAccount.json

Lines changed: 269 additions & 269 deletions
Large diffs are not rendered by default.

src/Storage/Storage.Management.Test/SessionRecords/Microsoft.Azure.Commands.Management.Storage.Test.ScenarioTests.StorageAccountTests/TestStorageAccountManagementPolicy.json

Lines changed: 190 additions & 184 deletions
Large diffs are not rendered by default.

src/Storage/Storage.Management.Test/SessionRecords/Microsoft.Azure.Commands.Management.Storage.Test.ScenarioTests.StorageBlobTests/TestStorageBlobContainer.json

Lines changed: 235 additions & 235 deletions
Large diffs are not rendered by default.

src/Storage/Storage.Management.Test/SessionRecords/Microsoft.Azure.Commands.Management.Storage.Test.ScenarioTests.StorageBlobTests/TestStorageBlobContainerImmutabilityPolicy.json

Lines changed: 373 additions & 373 deletions
Large diffs are not rendered by default.

src/Storage/Storage.Management.Test/SessionRecords/Microsoft.Azure.Commands.Management.Storage.Test.ScenarioTests.StorageBlobTests/TestStorageBlobContainerLegalHold.json

Lines changed: 242 additions & 242 deletions
Large diffs are not rendered by default.

src/Storage/Storage.Management.Test/SessionRecords/Microsoft.Azure.Commands.Management.Storage.Test.ScenarioTests.StorageBlobTests/TestStorageBlobServiceProperties.json

Lines changed: 212 additions & 212 deletions
Large diffs are not rendered by default.

src/Storage/Storage.Management.Test/Storage.Management.Test.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
</PropertyGroup>
1212

1313
<ItemGroup>
14-
<PackageReference Include="Microsoft.Azure.Management.Storage" Version="10.0.0" />
14+
<PackageReference Include="Microsoft.Azure.Management.Storage" Version="11.0.0" />
1515
</ItemGroup>
1616

1717
</Project>

src/Storage/Storage.Management/ChangeLog.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,13 @@
1818
- Additional information about change #1
1919
-->
2020
## Upcoming Release
21+
* Upgrade to Microsoft.Azure.Management.Storage 11.0.0, to support new API version 2019-04-01.
22+
* The default Storage account Kind in Create Storage account change from 'Storage' to 'StorageV2'
23+
- New-AzStorageAccount
24+
* Change the Storage account cmdlet output Sku.Name to be aligned with input SkuName by add '-', like "StandardLRS" change to "Standard_LRS"
25+
- New-AzStorageAccount
26+
- Get-AzStorageAccount
27+
- Set-AzStorageAccount
2128

2229
## Version 1.2.0
2330
* Report detail error when create Storage context with parameter -UseConnectedAccount, but without login Azure account

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
using Microsoft.Azure.Management.Storage.Models;
1818
using Microsoft.WindowsAzure.Commands.Common.Storage;
1919
using Microsoft.WindowsAzure.Commands.Storage.Adapters;
20-
using Microsoft.WindowsAzure.Storage;
2120
using System;
2221
using System.Collections.Generic;
2322
using Microsoft.WindowsAzure.Commands.Common.Attributes;
@@ -70,7 +69,7 @@ public PSStorageAccount(StorageModels.StorageAccount storageAccount)
7069
public Sku Sku { get; set; }
7170

7271
[Ps1Xml(Label = "Kind", Target = ViewControl.Table, Position = 4)]
73-
public Kind? Kind { get; set; }
72+
public string Kind { get; set; }
7473
public Encryption Encryption { get; set; }
7574

7675
[Ps1Xml(Label = "AccessTier", Target = ViewControl.Table, Position = 5)]

src/Storage/Storage.Management/Storage.Management.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<RootNamespace>$(LegacyAssemblyPrefix)$(PsModuleName)</RootNamespace>
1515
</PropertyGroup>
1616
<ItemGroup>
17-
<PackageReference Include="Microsoft.Azure.Management.Storage" Version="10.0.0" />
17+
<PackageReference Include="Microsoft.Azure.Management.Storage" Version="11.0.0" />
1818
<PackageReference Include="Microsoft.Azure.Storage.Blob" Version="9.4.2" />
1919
<PackageReference Include="Microsoft.Azure.Storage.File" Version="9.4.2" />
2020
<PackageReference Include="Microsoft.Azure.Storage.Queue" Version="9.4.2" />

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

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,11 @@ public class NewAzureStorageAccountCommand : StorageAccountBaseCmdlet
5151
ValueFromPipelineByPropertyName = true,
5252
HelpMessage = "Storage Account Sku Name.")]
5353
[Alias(StorageAccountTypeAlias, AccountTypeAlias, Account_TypeAlias)]
54-
[ValidateSet(AccountTypeString.StandardLRS,
55-
AccountTypeString.StandardZRS,
56-
AccountTypeString.StandardGRS,
57-
AccountTypeString.StandardRAGRS,
58-
AccountTypeString.PremiumLRS,
54+
[ValidateSet(StorageModels.SkuName.StandardLRS,
55+
StorageModels.SkuName.StandardZRS,
56+
StorageModels.SkuName.StandardGRS,
57+
StorageModels.SkuName.StandardRAGRS,
58+
StorageModels.SkuName.PremiumLRS,
5959
IgnoreCase = true)]
6060
public string SkuName { get; set; }
6161

@@ -71,12 +71,23 @@ public class NewAzureStorageAccountCommand : StorageAccountBaseCmdlet
7171
[Parameter(
7272
Mandatory = false,
7373
HelpMessage = "Storage Account Kind.")]
74-
[ValidateSet(AccountKind.Storage,
75-
AccountKind.StorageV2,
76-
AccountKind.BlobStorage,
77-
AccountKind.BlockBlobStorage,
74+
[ValidateSet(StorageModels.Kind.Storage,
75+
StorageModels.Kind.StorageV2,
76+
StorageModels.Kind.BlobStorage,
77+
StorageModels.Kind.BlockBlobStorage,
7878
IgnoreCase = true)]
79-
public string Kind { get; set; }
79+
public string Kind
80+
{
81+
get
82+
{
83+
return kind;
84+
}
85+
set
86+
{
87+
kind = value;
88+
}
89+
}
90+
private string kind = StorageModels.Kind.StorageV2;
8091

8192
[Parameter(
8293
Mandatory = false,
@@ -167,7 +178,7 @@ public override void ExecuteCmdlet()
167178
StorageAccountCreateParameters createParameters = new StorageAccountCreateParameters()
168179
{
169180
Location = this.Location,
170-
Sku = new Sku(ParseSkuName(this.SkuName)),
181+
Sku = new Sku(this.SkuName),
171182
Tags = TagsConversionHelper.CreateTagDictionary(Tag, validate: true),
172183
};
173184

@@ -184,9 +195,9 @@ public override void ExecuteCmdlet()
184195
throw new System.ArgumentException(string.Format("UseSubDomain must be set together with CustomDomainName."));
185196
}
186197

187-
if (Kind != null)
198+
if (kind != null)
188199
{
189-
createParameters.Kind = ParseAccountKind(Kind);
200+
createParameters.Kind = kind;
190201
}
191202

192203
if (this.AccessTier != null)

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,11 @@ public SwitchParameter Force
7373
ValueFromPipelineByPropertyName = true,
7474
HelpMessage = "Storage Account Sku Name.")]
7575
[Alias(StorageAccountTypeAlias, AccountTypeAlias, Account_TypeAlias)]
76-
[ValidateSet(AccountTypeString.StandardLRS,
77-
AccountTypeString.StandardZRS,
78-
AccountTypeString.StandardGRS,
79-
AccountTypeString.StandardRAGRS,
80-
AccountTypeString.PremiumLRS,
76+
[ValidateSet(StorageModels.SkuName.StandardLRS,
77+
StorageModels.SkuName.StandardZRS,
78+
StorageModels.SkuName.StandardGRS,
79+
StorageModels.SkuName.StandardRAGRS,
80+
StorageModels.SkuName.PremiumLRS,
8181
IgnoreCase = true)]
8282
public string SkuName { get; set; }
8383

@@ -197,7 +197,7 @@ public override void ExecuteCmdlet()
197197
StorageAccountUpdateParameters updateParameters = new StorageAccountUpdateParameters();
198198
if (this.SkuName != null)
199199
{
200-
updateParameters.Sku = new Sku(ParseSkuName(this.SkuName));
200+
updateParameters.Sku = new Sku(this.SkuName);
201201
}
202202

203203
if (this.Tag != null)

src/Storage/Storage.Management/StorageAccount/StorageAccountBaseCmdlet.cs

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -47,21 +47,6 @@ public abstract class StorageAccountBaseCmdlet : AzureRMCmdlet
4747

4848
protected const string StorageUsageNounStr = "AzureRmStorageUsage";
4949

50-
protected struct AccountTypeString
51-
{
52-
internal const string StandardLRS = "Standard_LRS";
53-
internal const string StandardZRS = "Standard_ZRS";
54-
internal const string StandardGRS = "Standard_GRS";
55-
internal const string StandardRAGRS = "Standard_RAGRS";
56-
internal const string PremiumLRS = "Premium_LRS";
57-
}
58-
protected struct AccountKind
59-
{
60-
internal const string Storage = "Storage";
61-
internal const string StorageV2 = "StorageV2";
62-
internal const string BlobStorage = "BlobStorage";
63-
internal const string BlockBlobStorage = "BlockBlobStorage";
64-
}
6550
protected struct AccountAccessTier
6651
{
6752
internal const string Hot = "Hot";
@@ -113,25 +98,6 @@ public string SubscriptionId
11398
}
11499
}
115100

116-
protected static SkuName ParseSkuName(string skuName)
117-
{
118-
SkuName returnSkuName;
119-
if (!Enum.TryParse<SkuName>(skuName.Replace("_", ""), true, out returnSkuName))
120-
{
121-
throw new ArgumentOutOfRangeException("SkuName");
122-
}
123-
return returnSkuName;
124-
}
125-
126-
protected static Kind ParseAccountKind(string accountKind)
127-
{
128-
Kind returnKind;
129-
if (!Enum.TryParse<Kind>(accountKind, true, out returnKind))
130-
{
131-
throw new ArgumentOutOfRangeException("Kind");
132-
}
133-
return returnKind;
134-
}
135101
protected static AccessTier ParseAccessTier(string accessTier)
136102
{
137103
AccessTier returnAccessTier;

src/StorageSync/StorageSync.Test/StorageSync.Test.csproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@
1010
<RootNamespace>$(LegacyAssemblyPrefix)$(PsModuleName)$(AzTestAssemblySuffix)</RootNamespace>
1111
</PropertyGroup>
1212

13-
<ItemGroup>
13+
<ItemGroup>
1414
<PackageReference Include="Microsoft.Azure.Management.StorageSync" Version="3.0.0" />
15-
<PackageReference Include="Microsoft.Azure.Management.Storage" Version="10.0.0" />
16-
<PackageReference Include="System.Management" Version="4.5.0" />
17-
</ItemGroup>
15+
<PackageReference Include="Microsoft.Azure.Management.Storage" Version="11.0.0" />
16+
<PackageReference Include="System.Management" Version="4.5.0" />
17+
</ItemGroup>
1818

1919
<ItemGroup>
2020
<ProjectReference Include="..\..\Storage\Storage.Management\Storage.Management.csproj" />
2121
<ProjectReference Include="..\..\Storage\Storage\Storage.csproj" />
2222
<ProjectReference Include="..\StorageSync\StorageSync.csproj" />
2323
</ItemGroup>
2424

25-
</Project>
25+
</Project>

0 commit comments

Comments
 (0)