Remove-AzStorageAccountNetworkRule
Remove IpRules or VirtualNetworkRules from the NetWorkRule property of a Storage account
Note
This is the previous version of our documentation. Please consult the most recent version for up-to-date information.
Syntax
Remove-AzStorageAccountNetworkRule
[-ResourceGroupName] <String>
[-Name] <String>
-VirtualNetworkResourceId <String[]>
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Remove-AzStorageAccountNetworkRule
[-ResourceGroupName] <String>
[-Name] <String>
-IPRule <PSIpRule[]>
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Remove-AzStorageAccountNetworkRule
[-ResourceGroupName] <String>
[-Name] <String>
-VirtualNetworkRule <PSVirtualNetworkRule[]>
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Remove-AzStorageAccountNetworkRule
[-ResourceGroupName] <String>
[-Name] <String>
-ResourceAccessRule <PSResourceAccessRule[]>
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Remove-AzStorageAccountNetworkRule
[-ResourceGroupName] <String>
[-Name] <String>
-IPAddressOrRange <String[]>
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Remove-AzStorageAccountNetworkRule
[-ResourceGroupName] <String>
[-Name] <String>
-TenantId <String>
-ResourceId <String>
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
The Remove-AzStorageAccountNetworkRule cmdlet removes IpRules or VirtualNetworkRules from the NetWorkRule property of a Storage account
Examples
Example 1: Remove several IpRules with IPAddressOrRange
PS C:\>Remove-AzStorageAccountNetworkRule -ResourceGroupName "myResourceGroup" -AccountName "mystorageaccount" -IPAddressOrRange "10.0.0.0/7,28.1.0.0/16"
This command remove several IpRules with IPAddressOrRange.
Example 2: Remove a VirtualNetworkRule with VirtualNetworkRule Object input with JSON
PS C:\>Remove-AzStorageAccountNetworkRule -ResourceGroupName "myResourceGroup" -AccountName "mystorageaccount" -VirtualNetworkRules (@{VirtualNetworkResourceId="/subscriptions/s1/resourceGroups/g1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1";Action="allow"})
This command remove a VirtualNetworkRule with VirtualNetworkRule Object input with JSON.
Example 3: Remove first IpRule with pipeline
PS C:\>(Get-AzStorageAccountNetworkRuleSet -ResourceGroupName "myResourceGroup" -AccountName "mystorageaccount").IpRules[0] | Remove-AzStorageAccountNetworkRule -ResourceGroupName "myResourceGroup" -AccountName "myStorageAccount"
This command remove first IpRule with pipeline.
Example 4: Remove several VirtualNetworkRules with VirtualNetworkResourceID
PS C:\>Remove-AzStorageAccountNetworkRule -ResourceGroupName "myResourceGroup" -AccountName "mystorageaccount" -VirtualNetworkResourceId "/subscriptions/s1/resourceGroups/g1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1","/subscriptions/s1/resourceGroups/g1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/subnet2"
This command remove several VirtualNetworkRules with VirtualNetworkResourceID.
Example 5: Remove a resource access rule with TenantId and ResourceId.
PS C:\>Remove-AzStorageAccountNetworkRule -ResourceGroupName "myResourceGroup" -AccountName "mystorageaccount" -TenantId $tenantId -ResourceId $ResourceId
This command removes a resource access rule with TenantId and ResourceId.
Example 6: Remove the first 3 resource access rules from a storage account
PS C:\> (Get-AzStorageAccountNetworkRuleSet -ResourceGroupName "myResourceGroup" -Name "mystorageaccount").ResourceAccessRules | Select-Object -First 3 | Remove-AzStorageAccountNetworkRule -ResourceGroupName "myResourceGroup" -AccountName "mystorageaccount"
This command removes the first 3 resource access rules from a storage account.
Parameters
Run cmdlet in the background
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
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 |
The credentials, account, tenant, and subscription used for communication with Azure.
| Type: | IAzureContextContainer |
| Aliases: | AzContext, AzureRmContext, AzureCredential |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The Array of IpAddressOrRange, will remove IpRule with same IpAddressOrRange from the NetWorkRule Property.
| Type: | String[] |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The Array of IpRule objects to remove from the NetWorkRule Property.
| Type: | PSIpRule[] |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |
Specifies the name of the Storage account.
| Type: | String |
| Aliases: | StorageAccountName, AccountName |
| Position: | 1 |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |
Storage Account NetworkRule ResourceAccessRules.
| Type: | PSResourceAccessRule[] |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |
Specifies the name of the resource group contains the Storage account.
| Type: | String |
| Position: | 0 |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |
Storage Account ResourceAccessRule ResourceId in string.
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |
Storage Account ResourceAccessRule TenantId in string.
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The Array of VirtualNetworkResourceId, will remove VirtualNetworkRule with same VirtualNetworkResourceId from the NetWorkRule Property.
| Type: | String[] |
| Aliases: | SubnetId, VirtualNetworkId |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The Array of VirtualNetworkRule objects to remove from the NetWorkRule Property.
| Type: | PSVirtualNetworkRule[] |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |
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
PSIpRule[]