Skip to content

[Storage] Support Account Kind FileStorage, and Skuname Premium_ZRS #9332

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 3 commits into from
Jun 4, 2019
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
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,13 @@ public void TestGetAzureStorageLocationUsage()
TestRunner.RunTestScript("Test-GetAzureStorageLocationUsage");
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestNewAzureStorageAccountFileStorage()
{
TestRunner.RunTestScript("Test-NewAzureStorageAccountFileStorage");
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestPipingNewUpdateAccount()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -668,6 +668,43 @@ function Test-GetAzureStorageLocationUsage
Assert-AreNotEqual 0 $usage.CurrentValue;
}

<#
.SYNOPSIS
Test New-AzStorageAccountFileStorage
.DESCRIPTION
Smoke[Broken]Test
#>
function Test-NewAzureStorageAccountFileStorage
{
# Setup
$rgname = Get-StorageManagementTestResourceName;

try
{
# Test
$stoname = 'sto' + $rgname;
$stotype = 'Premium_LRS';
$kind = 'FileStorage'

$loc = Get-ProviderLocation ResourceManagement;
New-AzResourceGroup -Name $rgname -Location $loc;

New-AzStorageAccount -ResourceGroupName $rgname -Name $stoname -Location $loc -Type $stotype -Kind $kind;
$sto = Get-AzStorageAccount -ResourceGroupName $rgname -Name $stoname;
Assert-AreEqual $stoname $sto.StorageAccountName;
Assert-AreEqual $stotype $sto.Sku.Name;
Assert-AreEqual $loc.ToLower().Replace(" ", "") $sto.Location;
Assert-AreEqual $kind $sto.Kind;

Retry-IfException { Remove-AzStorageAccount -Force -ResourceGroupName $rgname -Name $stoname; }
}
finally
{
# Cleanup
Clean-ResourceGroup $rgname
}
}

<#
.SYNOPSIS
Test Get-AzStorageAccount | New/Set-AzStorageAccount
Expand Down

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions src/Storage/Storage.Management/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
- Additional information about change #1
-->
## Upcoming Release
* Support Kind FileStorage and SkuName Premium_ZRS when create Storage account
- New-AzStorageAccount
* Clarified description of blob immutability cmdlet
- Remove-AzRmStorageContainerImmutabilityPolicy

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ public class NewAzureStorageAccountCommand : StorageAccountBaseCmdlet
StorageModels.SkuName.StandardGRS,
StorageModels.SkuName.StandardRAGRS,
StorageModels.SkuName.PremiumLRS,
StorageModels.SkuName.PremiumZRS,
IgnoreCase = true)]
public string SkuName { get; set; }

Expand All @@ -75,6 +76,7 @@ public class NewAzureStorageAccountCommand : StorageAccountBaseCmdlet
StorageModels.Kind.StorageV2,
StorageModels.Kind.BlobStorage,
StorageModels.Kind.BlockBlobStorage,
StorageModels.Kind.FileStorage,
IgnoreCase = true)]
public string Kind
{
Expand Down
9 changes: 6 additions & 3 deletions src/Storage/Storage.Management/help/New-AzStorageAccount.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,13 +185,15 @@ The acceptable values for this parameter are:
- Storage. General purpose Storage account that supports storage of Blobs, Tables, Queues, Files and Disks.
- StorageV2. General Purpose Version 2 (GPv2) Storage account that supports Blobs, Tables, Queues, Files, and Disks, with advanced features like data tiering.
- BlobStorage. Blob Storage account which supports storage of Blobs only.
The default value is Storage.
- BlockBlobStorage. Block Blob Storage account which supports storage of Block Blobs only.
- FileStorage. File Storage account which supports storage of Files only.
The default value is StorageV2.

```yaml
Type: System.String
Parameter Sets: (All)
Aliases:
Accepted values: Storage, StorageV2, BlobStorage, BlockBlobStorage
Accepted values: Storage, StorageV2, BlobStorage, BlockBlobStorage, FileStorage

Required: False
Position: Named
Expand Down Expand Up @@ -268,12 +270,13 @@ The acceptable values for this parameter are:
- Standard_GRS. Geo-redundant storage.
- Standard_RAGRS. Read access geo-redundant storage.
- Premium_LRS. Premium locally-redundant storage.
- Premium_ZRS. Premium zone-redundant storage.

```yaml
Type: System.String
Parameter Sets: (All)
Aliases: StorageAccountType, AccountType, Type
Accepted values: Standard_LRS, Standard_ZRS, Standard_GRS, Standard_RAGRS, Premium_LRS
Accepted values: Standard_LRS, Standard_ZRS, Standard_GRS, Standard_RAGRS, Premium_LRS, Premium_ZRS

Required: True
Position: 2
Expand Down
6 changes: 4 additions & 2 deletions src/Storage/Storage.Management/help/New-AzStorageContext.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ New-AzStorageContext [-Local] [<CommonParameters>]

## DESCRIPTION
The **New-AzStorageContext** cmdlet creates an Azure Storage context.
The default Authentication of a Storage Context is OAuth (Azure AD), if only input Storage account name.
See details of authentication of the Storage Service in https://docs.microsoft.com/en-us/rest/api/storageservices/authorization-for-the-azure-storage-services.

## EXAMPLES

Expand Down Expand Up @@ -159,7 +161,7 @@ PS C:\>Connect-AzAccount
PS C:\> $Context = New-AzStorageContext -StorageAccountName "myaccountname" -UseConnectedAccount
```

This command creates a context by using the OAuth Authentication.
This command creates a context by using the OAuth (Azure AD) Authentication.

## PARAMETERS

Expand Down Expand Up @@ -316,7 +318,7 @@ Accept wildcard characters: False
```

### -UseConnectedAccount
Indicates that this cmdlet creates an Azure Storage context with OAuth Authentication.
Indicates that this cmdlet creates an Azure Storage context with OAuth (Azure AD) Authentication.
The cmdlet will use OAuth Authentication by default, when other anthentication not specified.

```yaml
Expand Down