Skip to content

Commit 6e77f89

Browse files
authored
Merge pull request #5012 from wastoresh/storage-v2
Support create RM storage Account with Kind "Storagev2"
2 parents 6f4e2c5 + c441083 commit 6e77f89

21 files changed

+3806
-177
lines changed

src/ResourceManager/Storage/ChangeLog.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@
1818
- Additional information about change #1
1919
-->
2020
## Current Release
21-
21+
* Upgrade SRP SDK to 7.1.0
22+
* Add StorageV2 account kind to resource mode storage account cmdlets
23+
- New-AzureRmStorageAccount
24+
2225
## Version 4.0.1
2326
* Fixed assembly loading issue that caused some cmdlets to fail when executing
2427

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/ScenarioTests/Common.ps1

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,4 +168,14 @@ Gets the Canary location for a provider
168168
function Get-ProviderLocation_Canary($provider)
169169
{
170170
"eastus2euap"
171+
}
172+
173+
174+
<#
175+
.SYNOPSIS
176+
Gets the Stage location for a provider
177+
#>
178+
function Get-ProviderLocation_Stage($provider)
179+
{
180+
"eastus2(stage)"
171181
}

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

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,12 +129,21 @@ function Test-NewAzureStorageAccount
129129
{
130130
# Test
131131
$stoname = 'sto' + $rgname;
132-
$stotype = 'Standard_GRS';
133-
$loc = Get-ProviderLocation ResourceManagement;
132+
$stotype = 'Standard_ZRS';
133+
$kind = 'StorageV2'
134134

135+
$loc = Get-ProviderLocation ResourceManagement;
135136
New-AzureRmResourceGroup -Name $rgname -Location $loc;
136137

137-
New-AzureRmStorageAccount -ResourceGroupName $rgname -Name $stoname -Location $loc -Type $stotype;
138+
$loc = Get-ProviderLocation_Stage ResourceManagement;
139+
New-AzureRmStorageAccount -ResourceGroupName $rgname -Name $stoname -Location $loc -Type $stotype -Kind $kind;
140+
141+
$sto = Get-AzureRmStorageAccount -ResourceGroupName $rgname -Name $stoname;
142+
$stotype = 'StandardZRS';
143+
Assert-AreEqual $sto.StorageAccountName $stoname;
144+
Assert-AreEqual $sto.Sku.Name $stotype;
145+
Assert-AreEqual $sto.Location $loc;
146+
Assert-AreEqual $sto.Kind $kind;
138147

139148
Retry-IfException { Remove-AzureRmStorageAccount -Force -ResourceGroupName $rgname -Name $stoname; }
140149
}

0 commit comments

Comments
 (0)