Skip to content

Rename NetworkRule to NetworkRuleSet in Set/Get/New-azureRMstorageAcc… #4401

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 1 commit into from
Aug 2, 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
Original file line number Diff line number Diff line change
Expand Up @@ -526,12 +526,12 @@ function Test-NetworkRule

New-AzureRmResourceGroup -Name $rgname -Location $loc;

New-AzureRmStorageAccount -ResourceGroupName $rgname -Name $stoname -Location $loc -Type $stotype -NetworkRule (@{bypass="Logging,Metrics,AzureServices";
New-AzureRmStorageAccount -ResourceGroupName $rgname -Name $stoname -Location $loc -Type $stotype -NetworkRuleSet (@{bypass="Logging,Metrics,AzureServices";
ipRules=(@{IPAddressOrRange="$ip1";Action="allow"},
@{IPAddressOrRange="$ip2";Action="allow"});
defaultAction="Deny"})

$stoacl = (Get-AzureRmStorageAccount -ResourceGroupName $rgname -Name $stoname).NetworkRule
$stoacl = (Get-AzureRmStorageAccount -ResourceGroupName $rgname -Name $stoname).NetworkRuleSet
Assert-AreEqual $stoacl.Bypass 7;
Assert-AreEqual $stoacl.DefaultAction Deny;
Assert-AreEqual $stoacl.IpRules.Count 2
Expand Down Expand Up @@ -573,7 +573,7 @@ function Test-NetworkRule
Assert-AreEqual $stoacl.IpRules[1].IPAddressOrRange $ip4;
Assert-AreEqual $stoacl.VirtualNetworkRules $null

Set-AzureRmStorageAccount -ResourceGroupName $rgname -Name $stoname -NetworkRule (@{bypass="AzureServices";
Set-AzureRmStorageAccount -ResourceGroupName $rgname -Name $stoname -NetworkRuleSet (@{bypass="AzureServices";
ipRules=(@{IPAddressOrRange="$ip1";Action="allow"},
@{IPAddressOrRange="$ip2";Action="allow"});
defaultAction="Allow"})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public PSStorageAccount(StorageModels.StorageAccount storageAccount)
this.StatusOfSecondary = storageAccount.StatusOfSecondary;
this.Tags = storageAccount.Tags;
this.EnableHttpsTrafficOnly = storageAccount.EnableHttpsTrafficOnly;
this.NetworkRule = PSNetworkRuleSet.ParsePSNetworkRule(storageAccount.NetworkAcls);
this.NetworkRuleSet = PSNetworkRuleSet.ParsePSNetworkRule(storageAccount.NetworkAcls);
}

public string ResourceGroupName { get; set; }
Expand Down Expand Up @@ -91,7 +91,7 @@ public PSStorageAccount(StorageModels.StorageAccount storageAccount)

public bool? EnableHttpsTrafficOnly { get; set; }

public PSNetworkRuleSet NetworkRule { get; set; }
public PSNetworkRuleSet NetworkRuleSet { get; set; }

public static PSStorageAccount Create(StorageModels.StorageAccount storageAccount, IStorageManagementClient client)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ public bool EnableHttpsTrafficOnly
[Parameter(HelpMessage = "Storage Account NetworkRule",
Mandatory = false)]
[ValidateNotNullOrEmpty]
public PSNetworkRuleSet NetworkRule
public PSNetworkRuleSet NetworkRuleSet
{
get; set;
}
Expand Down Expand Up @@ -188,9 +188,9 @@ public override void ExecuteCmdlet()
{
createParameters.Identity = new Identity();
}
if (NetworkRule != null)
if (NetworkRuleSet != null)
{
createParameters.NetworkAcls = PSNetworkRuleSet.ParseStorageNetworkRule(NetworkRule);
createParameters.NetworkAcls = PSNetworkRuleSet.ParseStorageNetworkRule(NetworkRuleSet);
}

var createAccountResponse = this.StorageClient.StorageAccounts.Create(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ public string KeyVaultUri
[Parameter(HelpMessage = "Storage Account NetworkRule",
Mandatory = false)]
[ValidateNotNullOrEmpty]
public PSNetworkRuleSet NetworkRule
public PSNetworkRuleSet NetworkRuleSet
{
get; set;
}
Expand Down Expand Up @@ -241,9 +241,9 @@ public override void ExecuteCmdlet()
}
updateParameters.Encryption = ParseEncryption(EnableEncryptionService, DisableEncryptionService, StorageEncryption, keyvaultEncryption, KeyName, KeyVersion, KeyVaultUri);
}
if (NetworkRule != null)
if (NetworkRuleSet != null)
{
updateParameters.NetworkAcls = PSNetworkRuleSet.ParseStorageNetworkRule(NetworkRule);
updateParameters.NetworkAcls = PSNetworkRuleSet.ParseStorageNetworkRule(NetworkRuleSet);
}

var updatedAccountResponse = this.StorageClient.StorageAccounts.Update(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Creates a Storage account.
New-AzureRmStorageAccount [-ResourceGroupName] <String> [-Name] <String> [-SkuName] <String>
[-Location] <String> [[-Kind] <String>] [[-AccessTier] <String>] [[-CustomDomainName] <String>]
[[-UseSubDomain] <Boolean>] [[-EnableEncryptionService] <EncryptionSupportServiceEnum>] [[-Tag] <Hashtable>]
[-EnableHttpsTrafficOnly <Boolean>] [-AssignIdentity] [-NetworkRule <PSNetworkRuleSet>]
[-EnableHttpsTrafficOnly <Boolean>] [-AssignIdentity] [-NetworkRuleSet <PSNetworkRuleSet>]
[-InformationAction <ActionPreference>] [-InformationVariable <String>] [<CommonParameters>]
```

Expand Down Expand Up @@ -48,17 +48,17 @@ PS C:\>New-AzureRmStorageAccount -ResourceGroupName "MyResourceGroup" -AccountNa
This command creates a Storage account that enabled Storage Service encryption on Blob and File Services. It also generates and assigns an identity that can be used to manage
account keys through Azure KeyVault.

### Example 4: Create a Storage Account with NetworkRule from JSON
### Example 4: Create a Storage Account with NetworkRuleSet from JSON
```
PS C:\>New-AzureRmStorageAccount -ResourceGroupName "MyResourceGroup" -AccountName "MyStorageAccount" -Location "US West" -Type "Standard_LRS" -NetworkRule (@{bypass="Logging,Metrics";
PS C:\>New-AzureRmStorageAccount -ResourceGroupName "MyResourceGroup" -AccountName "MyStorageAccount" -Location "US West" -Type "Standard_LRS" -NetworkRuleSet (@{bypass="Logging,Metrics";
ipRules=(@{IPAddressOrRange="20.11.0.0/16";Action="allow"},
@{IPAddressOrRange="10.0.0.0/7";Action="allow"});
virtualNetworkRules=(@{VirtualNetworkResourceId="/subscriptions/s1/resourceGroups/g1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1";Action="allow"},
@{VirtualNetworkResourceId="/subscriptions/s1/resourceGroups/g1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/subnet2";Action="allow"});
defaultAction="Deny"})
```

This command creates a Storage account that has NetworkRule property from JSON
This command creates a Storage account that has NetworkRuleSet property from JSON

## PARAMETERS

Expand Down Expand Up @@ -234,8 +234,8 @@ Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```

### -NetworkRule
Storage Account NetworkRule
### -NetworkRuleSet
Storage Account NetworkRuleSet

```yaml
Type: PSNetworkRuleSet
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Set-AzureRmStorageAccount [-ResourceGroupName] <String> [-Name] <String> [-Force
[[-AccessTier] <String>] [[-CustomDomainName] <String>] [[-UseSubDomain] <Boolean>]
[[-EnableEncryptionService] <EncryptionSupportServiceEnum>]
[[-DisableEncryptionService] <EncryptionSupportServiceEnum>] [[-Tag] <Hashtable>]
[-EnableHttpsTrafficOnly <Boolean>] [-StorageEncryption] [-AssignIdentity] [-NetworkRule <PSNetworkRuleSet>]
[-EnableHttpsTrafficOnly <Boolean>] [-StorageEncryption] [-AssignIdentity] [-NetworkRuleSet <PSNetworkRuleSet>]
[-InformationAction <ActionPreference>] [-InformationVariable <String>] [-WhatIf] [-Confirm]
[<CommonParameters>]
```
Expand All @@ -30,7 +30,7 @@ Set-AzureRmStorageAccount [-ResourceGroupName] <String> [-Name] <String> [-Force
[[-EnableEncryptionService] <EncryptionSupportServiceEnum>]
[[-DisableEncryptionService] <EncryptionSupportServiceEnum>] [[-Tag] <Hashtable>]
[-EnableHttpsTrafficOnly <Boolean>] [-KeyvaultEncryption] -KeyName <String> -KeyVersion <String>
-KeyVaultUri <String> [-AssignIdentity] [-NetworkRule <PSNetworkRuleSet>]
-KeyVaultUri <String> [-AssignIdentity] [-NetworkRuleSet <PSNetworkRuleSet>]
[-InformationAction <ActionPreference>] [-InformationVariable <String>] [-WhatIf] [-Confirm]
[<CommonParameters>]
```
Expand Down Expand Up @@ -97,25 +97,25 @@ PS C:\>Set-AzureRmStorageAccount -ResourceGroupName "MyResourceGroup" -AccountNa

This command disables encryption on File Services with KeySource set to "Microsoft.Storage"

### Example 7: Set NetworkRule property of a Storage Account with JSON
### Example 7: Set NetworkRuleSet property of a Storage Account with JSON
```
PS C:\>Set-AzureRmStorageAccount -ResourceGroupName "MyResourceGroup" -AccountName "MyStorageAccount" -NetworkRule (@{bypass="Logging,Metrics";
PS C:\>Set-AzureRmStorageAccount -ResourceGroupName "MyResourceGroup" -AccountName "MyStorageAccount" -NetworkRuleSet (@{bypass="Logging,Metrics";
ipRules=(@{IPAddressOrRange="20.11.0.0/16";Action="allow"},
@{IPAddressOrRange="10.0.0.0/7";Action="allow"});
virtualNetworkRules=(@{VirtualNetworkResourceId="/subscriptions/s1/resourceGroups/g1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1";Action="allow"},
@{VirtualNetworkResourceId="/subscriptions/s1/resourceGroups/g1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/subnet2";Action="allow"});
defaultAction="allow"})
```

This command sets NetworkRule property of a Storage Account with JSON
This command sets NetworkRuleSet property of a Storage Account with JSON

### Example 8: Get NetworkRule property from a Storage Account, and set it to another storage account
### Example 8: Get NetworkRuleSet property from a Storage Account, and set it to another storage account
```
PS C:\> $networkRule = (Get-AzureRmStorageAccount -ResourceGroupName "MyResourceGroup" -AccountName "MyStorageAccount").NetworkRule
PS C:\> Set-AzureRmStorageAccount -ResourceGroupName "MyResourceGroup" -AccountName "MyStorageAccount2" -NetworkRule $networkRule
PS C:\> $networkRuleSet = (Get-AzureRmStorageAccount -ResourceGroupName "MyResourceGroup" -AccountName "MyStorageAccount").NetworkRuleSet
PS C:\> Set-AzureRmStorageAccount -ResourceGroupName "MyResourceGroup" -AccountName "MyStorageAccount2" -NetworkRuleSet $networkRuleSet
```

This first command gets NetworkRule property from a Storage Account, and the second command sets it to another storage account
This first command gets NetworkRuleSet property from a Storage Account, and the second command sets it to another Storage Account

## PARAMETERS

Expand Down Expand Up @@ -349,8 +349,8 @@ Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```

### -NetworkRule
Storage Account NetworkRule
### -NetworkRuleSet
Storage Account NetworkRuleSet

```yaml
Type: PSNetworkRuleSet
Expand Down