Update-AzStorageAccountNetworkRuleSet

Update the NetworkRule property of a Storage account

Syntax

Update-AzStorageAccountNetworkRuleSet
      [-ResourceGroupName] <String>
      [-Name] <String>
      [-Bypass <PSNetWorkRuleBypassEnum>]
      [-DefaultAction <PSNetWorkRuleDefaultActionEnum>]
      [-IPRule <PSIpRule[]>]
      [-VirtualNetworkRule <PSVirtualNetworkRule[]>]
      [-AsJob]
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]

Description

The Update-AzStorageAccountNetworkRuleSet cmdlet updates the NetworkRule property of a Storage account

Examples

Example 1: Update all properties of NetworkRule, input Rules with JSON

PS C:\> Update-AzStorageAccountNetworkRuleSet -ResourceGroupName "myResourceGroup" -AccountName "mystorageaccount" -Bypass Logging,Metrics -DefaultAction Allow -IpRule (@{IPAddressOrRange="10.0.0.0/24";Action="allow"},@{IPAddressOrRange="28.2.0.0/16";Action="allow"})
    -VirtualNetworkRule (@{VirtualNetworkResourceId="/subscriptions/s1/resourceGroups/g1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1";Action="allow"},@{VirtualNetworkResourceId="/subscriptions/s1/resourceGroups/g1/providers/Microsoft.Network/virtualN
    etworks/vnet2/subnets/subnet2";Action="allow"})

This command update all properties of NetworkRule, input Rules with JSON.

Example 2: Update Bypass property of NetworkRule

PS C:\> Update-AzStorageAccountNetworkRuleSet -ResourceGroupName "myResourceGroup" -AccountName "mystorageaccount" -Bypass AzureServices,Metrics

This command update Bypass property of NetworkRule (other properties won't change).

Example 3: Clean up rules of NetworkRule of a Storage account

PS C:\> Update-AzStorageAccountNetworkRuleSet -ResourceGroupName "myResourceGroup" -AccountName "mystorageaccount" -IpRule @() -VirtualNetworkRule @()

This command clean up rules of NetworkRule of a Storage account (other properties not change).

Parameters

-AsJob

Run cmdlet in the background

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Bypass

The Bypass value to update to the NetworkRule property of a Storage account. The allowed value are none or any combination of: • Logging • Metrics • Azureservices

Type:Microsoft.Azure.Commands.Management.Storage.Models.PSNetWorkRuleBypassEnum
Accepted values:None, Logging, Metrics, AzureServices
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-DefaultAction

The DefaultAction value to update to the NetworkRule property of a Storage account. The allowed Options: • Allow • Deny

Type:Microsoft.Azure.Commands.Management.Storage.Models.PSNetWorkRuleDefaultActionEnum
Accepted values:Deny, Allow
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-DefaultProfile

The credentials, account, tenant, and subscription used for communication with Azure.

Type:Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-IPRule

The Array of IpRule objects to update to the NetworkRule Property of a Storage account.

Type:Microsoft.Azure.Commands.Management.Storage.Models.PSIpRule[]
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-Name

Specifies the name of the Storage account.

Type:String
Aliases:StorageAccountName, AccountName
Position:1
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-ResourceGroupName

Specifies the name of the resource group contains the Storage account.

Type:String
Position:0
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-VirtualNetworkRule

The Array of VirtualNetworkRule objects to update to the NetworkRule Property of a Storage account.

Type:Microsoft.Azure.Commands.Management.Storage.Models.PSVirtualNetworkRule[]
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

Inputs

String

Microsoft.Azure.Commands.Management.Storage.Models.PSIpRule[]

Microsoft.Azure.Commands.Management.Storage.Models.PSVirtualNetworkRule[]

Outputs

PSNetworkRuleSet