Skip to content

Support Set-AzureRMstorageAccount with Kind StorageV2 #5110

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

Merged
merged 5 commits into from
Dec 13, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/ResourceManager/Storage/AzureRM.Storage.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# RootModule = ''

# Version number of this module.
ModuleVersion = '4.0.1'
ModuleVersion = '4.1.0'

# Supported PSEditions
# CompatiblePSEditions = @()
Expand Down Expand Up @@ -122,7 +122,10 @@ PrivateData = @{
# IconUri = ''

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

# External dependent modules of this module
# ExternalModuleDependencies = ''
Expand Down
1 change: 1 addition & 0 deletions src/ResourceManager/Storage/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
* Upgrade SRP SDK to 7.1.0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@blueww Please update the version of the module in AzureRM.Storage.psd1 (should be 4.1.0), please add the text here to the 'ReleaseNotes' in AzureRM.Storage.psd1, and please update the AssemblyVersion and AssemblyFileVersion in AssemblyInfo.cs for the built assembly (Microsoft.Azure.Commands.Management.Storage).

Otherwise, this looks good.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@markcowl
All updated. Please check.

* Add StorageV2 account kind to resource mode storage account cmdlets
- New-AzureRmStorageAccount
- Set-AzureRmStorageAccount

## Version 4.0.1
* Fixed assembly loading issue that caused some cmdlets to fail when executing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,9 @@
<None Include="SessionRecords\Microsoft.Azure.Commands.Management.Storage.Test.ScenarioTests.StorageAccountTests\TestStorageAccount.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="SessionRecords\Microsoft.Azure.Commands.Management.Storage.Test.ScenarioTests.StorageAccountTests\TestSetAzureStorageAccountStorageV2.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,5 +112,11 @@ public void TestNetworkRule()
TestController.NewInstance.RunPsTest("Test-NetworkRule");
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestSetAzureStorageAccountStorageV2()
{
TestController.NewInstance.RunPsTest("Test-SetAzureStorageAccountStorageV2");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,6 @@ function Test-SetAzureRmCurrentStorageAccount
}
}


<#
.SYNOPSIS
Test NetworkRule
Expand Down Expand Up @@ -611,3 +610,50 @@ function Test-NetworkRule
Clean-ResourceGroup $rgname
}
}

<#
.SYNOPSIS
Test SetAzureStorageAccount with Kind as StorageV2
.Description
AzureAutomationTest
#>
function Test-SetAzureStorageAccountStorageV2
{
# Setup
$rgname = Get-StorageManagementTestResourceName;

try
{
# Test
$stoname = 'sto' + $rgname;
$stotype = 'Standard_GRS';
$loc = Get-ProviderLocation ResourceManagement;
$kind = 'Storage'

New-AzureRmResourceGroup -Name $rgname -Location $loc;
$loc = Get-ProviderLocation_Stage ResourceManagement;
New-AzureRmStorageAccount -ResourceGroupName $rgname -Name $stoname -Location $loc -Type $stotype -Kind $kind;

Retry-IfException { $global:sto = Get-AzureRmStorageAccount -ResourceGroupName $rgname -Name $stoname; }
$stotype = 'StandardGRS';
Assert-AreEqual $sto.StorageAccountName $stoname;
Assert-AreEqual $sto.Sku.Name $stotype;
Assert-AreEqual $sto.Location $loc;
Assert-AreEqual $sto.Kind $kind;

$kind = 'StorageV2'
Set-AzureRmStorageAccount -ResourceGroupName $rgname -Name $stoname -UpgradeToStorageV2;
$sto = Get-AzureRmStorageAccount -ResourceGroupName $rgname -Name $stoname;
Assert-AreEqual $sto.StorageAccountName $stoname;
Assert-AreEqual $sto.Sku.Name $stotype;
Assert-AreEqual $sto.Location $loc;
Assert-AreEqual $sto.Kind $kind;

Remove-AzureRmStorageAccount -Force -ResourceGroupName $rgname -Name $stoname;
}
finally
{
# Cleanup
Clean-ResourceGroup $rgname
}
}
Loading