Skip to content

Commit 978b243

Browse files
authored
Merge pull request #5190 from Azure/master
Merge master into preview after Storage gallery release
2 parents eb9ff03 + 1ffb0da commit 978b243

26 files changed

+8403
-199
lines changed

src/ResourceManager/Storage/AzureRM.Storage.psd1

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# RootModule = ''
1313

1414
# Version number of this module.
15-
ModuleVersion = '4.0.1'
15+
ModuleVersion = '4.1.0'
1616

1717
# Supported PSEditions
1818
# CompatiblePSEditions = @()
@@ -122,7 +122,10 @@ PrivateData = @{
122122
# IconUri = ''
123123

124124
# ReleaseNotes of this module
125-
ReleaseNotes = '* Fixed assembly loading issue that caused some cmdlets to fail when executing'
125+
ReleaseNotes = '* Upgrade SRP SDK to 7.1.0
126+
* Add StorageV2 account kind to resource mode storage account cmdlets
127+
- New-AzureRmStorageAccount
128+
- Set-AzureRmStorageAccount'
126129

127130
# External dependent modules of this module
128131
# ExternalModuleDependencies = ''

src/ResourceManager/Storage/ChangeLog.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,12 @@
1818
- Additional information about change #1
1919
-->
2020
## Current Release
21+
* Upgrade SRP SDK to 7.1.0
22+
* Add StorageV2 account kind to resource mode storage account cmdlets
23+
- New-AzureRmStorageAccount
24+
- Set-AzureRmStorageAccount
2125
* Added Location Completer to -Location parameters allowing tab completion through valid Locations
2226
* Added ResourceGroup Completer to -ResourceGroup parameters allowing tab completion through resource groups in current subscription
23-
2427
## Version 4.0.1
2528
* Fixed assembly loading issue that caused some cmdlets to fail when executing
2629

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

Lines changed: 7 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>
@@ -200,6 +200,9 @@
200200
<None Include="SessionRecords\Microsoft.Azure.Commands.Management.Storage.Test.ScenarioTests.StorageAccountTests\TestStorageAccount.json">
201201
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
202202
</None>
203+
<None Include="SessionRecords\Microsoft.Azure.Commands.Management.Storage.Test.ScenarioTests.StorageAccountTests\TestSetAzureStorageAccountStorageV2.json">
204+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
205+
</None>
203206
</ItemGroup>
204207
<ItemGroup>
205208
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />

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.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,5 +112,11 @@ public void TestNetworkRule()
112112
TestController.NewInstance.RunPsTest("Test-NetworkRule");
113113
}
114114

115+
[Fact]
116+
[Trait(Category.AcceptanceType, Category.CheckIn)]
117+
public void TestSetAzureStorageAccountStorageV2()
118+
{
119+
TestController.NewInstance.RunPsTest("Test-SetAzureStorageAccountStorageV2");
120+
}
115121
}
116122
}

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

Lines changed: 59 additions & 4 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
}
@@ -511,7 +520,6 @@ function Test-SetAzureRmCurrentStorageAccount
511520
}
512521
}
513522

514-
515523
<#
516524
.SYNOPSIS
517525
Test NetworkRule
@@ -602,3 +610,50 @@ function Test-NetworkRule
602610
Clean-ResourceGroup $rgname
603611
}
604612
}
613+
614+
<#
615+
.SYNOPSIS
616+
Test SetAzureStorageAccount with Kind as StorageV2
617+
.Description
618+
AzureAutomationTest
619+
#>
620+
function Test-SetAzureStorageAccountStorageV2
621+
{
622+
# Setup
623+
$rgname = Get-StorageManagementTestResourceName;
624+
625+
try
626+
{
627+
# Test
628+
$stoname = 'sto' + $rgname;
629+
$stotype = 'Standard_GRS';
630+
$loc = Get-ProviderLocation ResourceManagement;
631+
$kind = 'Storage'
632+
633+
New-AzureRmResourceGroup -Name $rgname -Location $loc;
634+
$loc = Get-ProviderLocation_Stage ResourceManagement;
635+
New-AzureRmStorageAccount -ResourceGroupName $rgname -Name $stoname -Location $loc -Type $stotype -Kind $kind;
636+
637+
Retry-IfException { $global:sto = Get-AzureRmStorageAccount -ResourceGroupName $rgname -Name $stoname; }
638+
$stotype = 'StandardGRS';
639+
Assert-AreEqual $sto.StorageAccountName $stoname;
640+
Assert-AreEqual $sto.Sku.Name $stotype;
641+
Assert-AreEqual $sto.Location $loc;
642+
Assert-AreEqual $sto.Kind $kind;
643+
644+
$kind = 'StorageV2'
645+
Set-AzureRmStorageAccount -ResourceGroupName $rgname -Name $stoname -UpgradeToStorageV2;
646+
$sto = Get-AzureRmStorageAccount -ResourceGroupName $rgname -Name $stoname;
647+
Assert-AreEqual $sto.StorageAccountName $stoname;
648+
Assert-AreEqual $sto.Sku.Name $stotype;
649+
Assert-AreEqual $sto.Location $loc;
650+
Assert-AreEqual $sto.Kind $kind;
651+
652+
Remove-AzureRmStorageAccount -Force -ResourceGroupName $rgname -Name $stoname;
653+
}
654+
finally
655+
{
656+
# Cleanup
657+
Clean-ResourceGroup $rgname
658+
}
659+
}

0 commit comments

Comments
 (0)