編輯

共用方式為


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[]>]
      [-ResourceAccessRule <PSResourceAccessRule[]>]
      [-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

Update-AzStorageAccountNetworkRuleSet -ResourceGroupName "myResourceGroup" -Name "mystorageaccount" -Bypass Logging,Metrics -DefaultAction Allow -IpRule (@{IPAddressOrRange="10.0.0.0/7";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/virtualNetworks/vnet2/subnets/subnet2";Action="allow"}) -ResourceAccessRule (@{ResourceId=$ResourceId1;TenantId=$tenantId1},@{ResourceId=$ResourceId2;TenantId=$tenantId1})

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

Example 2: Update Bypass property of NetworkRule

Update-AzStorageAccountNetworkRuleSet -ResourceGroupName "myResourceGroup" -Name "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

Update-AzStorageAccountNetworkRuleSet -ResourceGroupName "myResourceGroup" -Name "mystorageaccount" -IpRule @() -VirtualNetworkRule @() -ResourceAccessRule @()

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:Allow, Deny
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:AzContext, 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

-ResourceAccessRule

Storage Account NetworkRule ResourceAccessRules.

Type:PSResourceAccessRule[]
Position:Named
Default value:None
Required:False
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[]

PSVirtualNetworkRule[]

Outputs

PSNetworkRuleSet