Update-AzureRmStorageAccountNetworkRuleSet

Update the NetworkRule property of a Storage account

Warning

The AzureRM PowerShell module has been officially deprecated as of February 29, 2024. Users are advised to migrate from AzureRM to the Az PowerShell module to ensure continued support and updates.

Although the AzureRM module may still function, it's no longer maintained or supported, placing any continued use at the user's discretion and risk. Please refer to our migration resources for guidance on transitioning to the Az module.

Syntax

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

Description

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

Examples

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

PS C:\> Update-AzureRmStorageAccountNetworkRuleSet -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 (@{VirtualNetworkReourceId="/subscriptions/s1/resourceGroups/g1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1";Action="allow"},@{VirtualNetworkReourceId="/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-AzureRmStorageAccountNetworkRuleSet -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-AzureRmStorageAccountNetworkRuleSet -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
Required:False
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:PSNetWorkRuleBypassEnum
Accepted values:None, Logging, Metrics, AzureServices
Position:Named
Default value:None
Required:False
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
Required:False
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:PSNetWorkRuleDefaultActionEnum
Accepted values:Deny, Allow
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DefaultProfile

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

Type:IAzureContextContainer
Aliases:AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
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:PSIpRule[]
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-Name

Specifies the name of the Storage account.

Type:String
Aliases:StorageAccountName, AccountName
Position:1
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-ResourceGroupName

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

Type:String
Position:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-VirtualNetworkRule

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

Type:PSVirtualNetworkRule[]
Position:Named
Default value:None
Required:False
Accept pipeline input:True
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
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

String

PSIpRule[]

Parameters: IPRule (ByValue)

PSVirtualNetworkRule[]

Parameters: VirtualNetworkRule (ByValue)

Outputs

PSNetworkRuleSet