We recommend using Azure Native.
azure.storage.AccountNetworkRules
Manages network rules inside of a Azure Storage Account.
Note: Network Rules can be defined either directly on the
azure.storage.Accountresource, or using theazure.storage.AccountNetworkRulesresource - but the two cannot be used together. Spurious changes will occur if both are used against the same Storage Account.
Note: Only one
azure.storage.AccountNetworkRulescan be tied to anazure.storage.Account. Spurious changes will occur if more thanazure.storage.AccountNetworkRulesis tied to the sameazure.storage.Account.
Note: Deleting this resource updates the storage account back to the default values it had when the storage account was created.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const example = new azure.core.ResourceGroup("example", {
    name: "example-resources",
    location: "West Europe",
});
const exampleVirtualNetwork = new azure.network.VirtualNetwork("example", {
    name: "example-vnet",
    addressSpaces: ["10.0.0.0/16"],
    location: example.location,
    resourceGroupName: example.name,
});
const exampleSubnet = new azure.network.Subnet("example", {
    name: "example-subnet",
    resourceGroupName: example.name,
    virtualNetworkName: exampleVirtualNetwork.name,
    addressPrefixes: ["10.0.2.0/24"],
    serviceEndpoints: ["Microsoft.Storage"],
});
const exampleAccount = new azure.storage.Account("example", {
    name: "storageaccountname",
    resourceGroupName: example.name,
    location: example.location,
    accountTier: "Standard",
    accountReplicationType: "GRS",
    tags: {
        environment: "staging",
    },
});
const exampleAccountNetworkRules = new azure.storage.AccountNetworkRules("example", {
    storageAccountId: exampleAccount.id,
    defaultAction: "Allow",
    ipRules: ["127.0.0.1"],
    virtualNetworkSubnetIds: [exampleSubnet.id],
    bypasses: ["Metrics"],
});
import pulumi
import pulumi_azure as azure
example = azure.core.ResourceGroup("example",
    name="example-resources",
    location="West Europe")
example_virtual_network = azure.network.VirtualNetwork("example",
    name="example-vnet",
    address_spaces=["10.0.0.0/16"],
    location=example.location,
    resource_group_name=example.name)
example_subnet = azure.network.Subnet("example",
    name="example-subnet",
    resource_group_name=example.name,
    virtual_network_name=example_virtual_network.name,
    address_prefixes=["10.0.2.0/24"],
    service_endpoints=["Microsoft.Storage"])
example_account = azure.storage.Account("example",
    name="storageaccountname",
    resource_group_name=example.name,
    location=example.location,
    account_tier="Standard",
    account_replication_type="GRS",
    tags={
        "environment": "staging",
    })
example_account_network_rules = azure.storage.AccountNetworkRules("example",
    storage_account_id=example_account.id,
    default_action="Allow",
    ip_rules=["127.0.0.1"],
    virtual_network_subnet_ids=[example_subnet.id],
    bypasses=["Metrics"])
package main
import (
	"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
	"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/network"
	"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/storage"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
			Name:     pulumi.String("example-resources"),
			Location: pulumi.String("West Europe"),
		})
		if err != nil {
			return err
		}
		exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "example", &network.VirtualNetworkArgs{
			Name: pulumi.String("example-vnet"),
			AddressSpaces: pulumi.StringArray{
				pulumi.String("10.0.0.0/16"),
			},
			Location:          example.Location,
			ResourceGroupName: example.Name,
		})
		if err != nil {
			return err
		}
		exampleSubnet, err := network.NewSubnet(ctx, "example", &network.SubnetArgs{
			Name:               pulumi.String("example-subnet"),
			ResourceGroupName:  example.Name,
			VirtualNetworkName: exampleVirtualNetwork.Name,
			AddressPrefixes: pulumi.StringArray{
				pulumi.String("10.0.2.0/24"),
			},
			ServiceEndpoints: pulumi.StringArray{
				pulumi.String("Microsoft.Storage"),
			},
		})
		if err != nil {
			return err
		}
		exampleAccount, err := storage.NewAccount(ctx, "example", &storage.AccountArgs{
			Name:                   pulumi.String("storageaccountname"),
			ResourceGroupName:      example.Name,
			Location:               example.Location,
			AccountTier:            pulumi.String("Standard"),
			AccountReplicationType: pulumi.String("GRS"),
			Tags: pulumi.StringMap{
				"environment": pulumi.String("staging"),
			},
		})
		if err != nil {
			return err
		}
		_, err = storage.NewAccountNetworkRules(ctx, "example", &storage.AccountNetworkRulesArgs{
			StorageAccountId: exampleAccount.ID(),
			DefaultAction:    pulumi.String("Allow"),
			IpRules: pulumi.StringArray{
				pulumi.String("127.0.0.1"),
			},
			VirtualNetworkSubnetIds: pulumi.StringArray{
				exampleSubnet.ID(),
			},
			Bypasses: pulumi.StringArray{
				pulumi.String("Metrics"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;
return await Deployment.RunAsync(() => 
{
    var example = new Azure.Core.ResourceGroup("example", new()
    {
        Name = "example-resources",
        Location = "West Europe",
    });
    var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("example", new()
    {
        Name = "example-vnet",
        AddressSpaces = new[]
        {
            "10.0.0.0/16",
        },
        Location = example.Location,
        ResourceGroupName = example.Name,
    });
    var exampleSubnet = new Azure.Network.Subnet("example", new()
    {
        Name = "example-subnet",
        ResourceGroupName = example.Name,
        VirtualNetworkName = exampleVirtualNetwork.Name,
        AddressPrefixes = new[]
        {
            "10.0.2.0/24",
        },
        ServiceEndpoints = new[]
        {
            "Microsoft.Storage",
        },
    });
    var exampleAccount = new Azure.Storage.Account("example", new()
    {
        Name = "storageaccountname",
        ResourceGroupName = example.Name,
        Location = example.Location,
        AccountTier = "Standard",
        AccountReplicationType = "GRS",
        Tags = 
        {
            { "environment", "staging" },
        },
    });
    var exampleAccountNetworkRules = new Azure.Storage.AccountNetworkRules("example", new()
    {
        StorageAccountId = exampleAccount.Id,
        DefaultAction = "Allow",
        IpRules = new[]
        {
            "127.0.0.1",
        },
        VirtualNetworkSubnetIds = new[]
        {
            exampleSubnet.Id,
        },
        Bypasses = new[]
        {
            "Metrics",
        },
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.core.ResourceGroup;
import com.pulumi.azure.core.ResourceGroupArgs;
import com.pulumi.azure.network.VirtualNetwork;
import com.pulumi.azure.network.VirtualNetworkArgs;
import com.pulumi.azure.network.Subnet;
import com.pulumi.azure.network.SubnetArgs;
import com.pulumi.azure.storage.Account;
import com.pulumi.azure.storage.AccountArgs;
import com.pulumi.azure.storage.AccountNetworkRules;
import com.pulumi.azure.storage.AccountNetworkRulesArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }
    public static void stack(Context ctx) {
        var example = new ResourceGroup("example", ResourceGroupArgs.builder()
            .name("example-resources")
            .location("West Europe")
            .build());
        var exampleVirtualNetwork = new VirtualNetwork("exampleVirtualNetwork", VirtualNetworkArgs.builder()
            .name("example-vnet")
            .addressSpaces("10.0.0.0/16")
            .location(example.location())
            .resourceGroupName(example.name())
            .build());
        var exampleSubnet = new Subnet("exampleSubnet", SubnetArgs.builder()
            .name("example-subnet")
            .resourceGroupName(example.name())
            .virtualNetworkName(exampleVirtualNetwork.name())
            .addressPrefixes("10.0.2.0/24")
            .serviceEndpoints("Microsoft.Storage")
            .build());
        var exampleAccount = new Account("exampleAccount", AccountArgs.builder()
            .name("storageaccountname")
            .resourceGroupName(example.name())
            .location(example.location())
            .accountTier("Standard")
            .accountReplicationType("GRS")
            .tags(Map.of("environment", "staging"))
            .build());
        var exampleAccountNetworkRules = new AccountNetworkRules("exampleAccountNetworkRules", AccountNetworkRulesArgs.builder()
            .storageAccountId(exampleAccount.id())
            .defaultAction("Allow")
            .ipRules("127.0.0.1")
            .virtualNetworkSubnetIds(exampleSubnet.id())
            .bypasses("Metrics")
            .build());
    }
}
resources:
  example:
    type: azure:core:ResourceGroup
    properties:
      name: example-resources
      location: West Europe
  exampleVirtualNetwork:
    type: azure:network:VirtualNetwork
    name: example
    properties:
      name: example-vnet
      addressSpaces:
        - 10.0.0.0/16
      location: ${example.location}
      resourceGroupName: ${example.name}
  exampleSubnet:
    type: azure:network:Subnet
    name: example
    properties:
      name: example-subnet
      resourceGroupName: ${example.name}
      virtualNetworkName: ${exampleVirtualNetwork.name}
      addressPrefixes:
        - 10.0.2.0/24
      serviceEndpoints:
        - Microsoft.Storage
  exampleAccount:
    type: azure:storage:Account
    name: example
    properties:
      name: storageaccountname
      resourceGroupName: ${example.name}
      location: ${example.location}
      accountTier: Standard
      accountReplicationType: GRS
      tags:
        environment: staging
  exampleAccountNetworkRules:
    type: azure:storage:AccountNetworkRules
    name: example
    properties:
      storageAccountId: ${exampleAccount.id}
      defaultAction: Allow
      ipRules:
        - 127.0.0.1
      virtualNetworkSubnetIds:
        - ${exampleSubnet.id}
      bypasses:
        - Metrics
API Providers
This resource uses the following Azure API Providers:
- Microsoft.Storage- 2023-05-01
Create AccountNetworkRules Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new AccountNetworkRules(name: string, args: AccountNetworkRulesArgs, opts?: CustomResourceOptions);@overload
def AccountNetworkRules(resource_name: str,
                        args: AccountNetworkRulesInitArgs,
                        opts: Optional[ResourceOptions] = None)
@overload
def AccountNetworkRules(resource_name: str,
                        opts: Optional[ResourceOptions] = None,
                        default_action: Optional[str] = None,
                        storage_account_id: Optional[str] = None,
                        bypasses: Optional[Sequence[str]] = None,
                        ip_rules: Optional[Sequence[str]] = None,
                        private_link_access_rules: Optional[Sequence[AccountNetworkRulesPrivateLinkAccessRuleArgs]] = None,
                        virtual_network_subnet_ids: Optional[Sequence[str]] = None)func NewAccountNetworkRules(ctx *Context, name string, args AccountNetworkRulesArgs, opts ...ResourceOption) (*AccountNetworkRules, error)public AccountNetworkRules(string name, AccountNetworkRulesArgs args, CustomResourceOptions? opts = null)
public AccountNetworkRules(String name, AccountNetworkRulesArgs args)
public AccountNetworkRules(String name, AccountNetworkRulesArgs args, CustomResourceOptions options)
type: azure:storage:AccountNetworkRules
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args AccountNetworkRulesArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args AccountNetworkRulesInitArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args AccountNetworkRulesArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args AccountNetworkRulesArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args AccountNetworkRulesArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var accountNetworkRulesResource = new Azure.Storage.AccountNetworkRules("accountNetworkRulesResource", new()
{
    DefaultAction = "string",
    StorageAccountId = "string",
    Bypasses = new[]
    {
        "string",
    },
    IpRules = new[]
    {
        "string",
    },
    PrivateLinkAccessRules = new[]
    {
        new Azure.Storage.Inputs.AccountNetworkRulesPrivateLinkAccessRuleArgs
        {
            EndpointResourceId = "string",
            EndpointTenantId = "string",
        },
    },
    VirtualNetworkSubnetIds = new[]
    {
        "string",
    },
});
example, err := storage.NewAccountNetworkRules(ctx, "accountNetworkRulesResource", &storage.AccountNetworkRulesArgs{
	DefaultAction:    pulumi.String("string"),
	StorageAccountId: pulumi.String("string"),
	Bypasses: pulumi.StringArray{
		pulumi.String("string"),
	},
	IpRules: pulumi.StringArray{
		pulumi.String("string"),
	},
	PrivateLinkAccessRules: storage.AccountNetworkRulesPrivateLinkAccessRuleArray{
		&storage.AccountNetworkRulesPrivateLinkAccessRuleArgs{
			EndpointResourceId: pulumi.String("string"),
			EndpointTenantId:   pulumi.String("string"),
		},
	},
	VirtualNetworkSubnetIds: pulumi.StringArray{
		pulumi.String("string"),
	},
})
var accountNetworkRulesResource = new AccountNetworkRules("accountNetworkRulesResource", AccountNetworkRulesArgs.builder()
    .defaultAction("string")
    .storageAccountId("string")
    .bypasses("string")
    .ipRules("string")
    .privateLinkAccessRules(AccountNetworkRulesPrivateLinkAccessRuleArgs.builder()
        .endpointResourceId("string")
        .endpointTenantId("string")
        .build())
    .virtualNetworkSubnetIds("string")
    .build());
account_network_rules_resource = azure.storage.AccountNetworkRules("accountNetworkRulesResource",
    default_action="string",
    storage_account_id="string",
    bypasses=["string"],
    ip_rules=["string"],
    private_link_access_rules=[{
        "endpoint_resource_id": "string",
        "endpoint_tenant_id": "string",
    }],
    virtual_network_subnet_ids=["string"])
const accountNetworkRulesResource = new azure.storage.AccountNetworkRules("accountNetworkRulesResource", {
    defaultAction: "string",
    storageAccountId: "string",
    bypasses: ["string"],
    ipRules: ["string"],
    privateLinkAccessRules: [{
        endpointResourceId: "string",
        endpointTenantId: "string",
    }],
    virtualNetworkSubnetIds: ["string"],
});
type: azure:storage:AccountNetworkRules
properties:
    bypasses:
        - string
    defaultAction: string
    ipRules:
        - string
    privateLinkAccessRules:
        - endpointResourceId: string
          endpointTenantId: string
    storageAccountId: string
    virtualNetworkSubnetIds:
        - string
AccountNetworkRules Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The AccountNetworkRules resource accepts the following input properties:
- DefaultAction string
- Specifies the default action of allow or deny when no other rules match. Valid options are DenyorAllow.
- StorageAccount stringId 
- Specifies the ID of the storage account. Changing this forces a new resource to be created.
- Bypasses List<string>
- Specifies whether traffic is bypassed for Logging/Metrics/AzureServices. Valid options are any combination of - Logging,- Metrics,- AzureServices, or- None. Defaults to- ["AzureServices"].- Note: User has to explicitly set - bypassto empty slice (- []) to remove it.
- IpRules List<string>
- List of public IP or IP ranges in CIDR Format. Only IPv4 addresses are allowed. Private IP address ranges (as defined in RFC 1918) are not allowed. - Note: Small address ranges using "/31" or "/32" prefix sizes are not supported. These ranges should be configured using individual IP address rules without prefix specified. - Note: IP network rules have no effect on requests originating from the same Azure region as the storage account. Use Virtual network rules to allow same-region requests. Services deployed in the same region as the storage account use private Azure IP addresses for communication. Thus, you cannot restrict access to specific Azure services based on their public outbound IP address range. - Note: User has to explicitly set - ip_rulesto empty slice (- []) to remove it.
- PrivateLink List<AccountAccess Rules Network Rules Private Link Access Rule> 
- One or more private_link_accessblock as defined below.
- VirtualNetwork List<string>Subnet Ids 
- A list of virtual network subnet ids to secure the storage account. - Note: User has to explicitly set - virtual_network_subnet_idsto empty slice (- []) to remove it.
- DefaultAction string
- Specifies the default action of allow or deny when no other rules match. Valid options are DenyorAllow.
- StorageAccount stringId 
- Specifies the ID of the storage account. Changing this forces a new resource to be created.
- Bypasses []string
- Specifies whether traffic is bypassed for Logging/Metrics/AzureServices. Valid options are any combination of - Logging,- Metrics,- AzureServices, or- None. Defaults to- ["AzureServices"].- Note: User has to explicitly set - bypassto empty slice (- []) to remove it.
- IpRules []string
- List of public IP or IP ranges in CIDR Format. Only IPv4 addresses are allowed. Private IP address ranges (as defined in RFC 1918) are not allowed. - Note: Small address ranges using "/31" or "/32" prefix sizes are not supported. These ranges should be configured using individual IP address rules without prefix specified. - Note: IP network rules have no effect on requests originating from the same Azure region as the storage account. Use Virtual network rules to allow same-region requests. Services deployed in the same region as the storage account use private Azure IP addresses for communication. Thus, you cannot restrict access to specific Azure services based on their public outbound IP address range. - Note: User has to explicitly set - ip_rulesto empty slice (- []) to remove it.
- PrivateLink []AccountAccess Rules Network Rules Private Link Access Rule Args 
- One or more private_link_accessblock as defined below.
- VirtualNetwork []stringSubnet Ids 
- A list of virtual network subnet ids to secure the storage account. - Note: User has to explicitly set - virtual_network_subnet_idsto empty slice (- []) to remove it.
- defaultAction String
- Specifies the default action of allow or deny when no other rules match. Valid options are DenyorAllow.
- storageAccount StringId 
- Specifies the ID of the storage account. Changing this forces a new resource to be created.
- bypasses List<String>
- Specifies whether traffic is bypassed for Logging/Metrics/AzureServices. Valid options are any combination of - Logging,- Metrics,- AzureServices, or- None. Defaults to- ["AzureServices"].- Note: User has to explicitly set - bypassto empty slice (- []) to remove it.
- ipRules List<String>
- List of public IP or IP ranges in CIDR Format. Only IPv4 addresses are allowed. Private IP address ranges (as defined in RFC 1918) are not allowed. - Note: Small address ranges using "/31" or "/32" prefix sizes are not supported. These ranges should be configured using individual IP address rules without prefix specified. - Note: IP network rules have no effect on requests originating from the same Azure region as the storage account. Use Virtual network rules to allow same-region requests. Services deployed in the same region as the storage account use private Azure IP addresses for communication. Thus, you cannot restrict access to specific Azure services based on their public outbound IP address range. - Note: User has to explicitly set - ip_rulesto empty slice (- []) to remove it.
- privateLink List<AccountAccess Rules Network Rules Private Link Access Rule> 
- One or more private_link_accessblock as defined below.
- virtualNetwork List<String>Subnet Ids 
- A list of virtual network subnet ids to secure the storage account. - Note: User has to explicitly set - virtual_network_subnet_idsto empty slice (- []) to remove it.
- defaultAction string
- Specifies the default action of allow or deny when no other rules match. Valid options are DenyorAllow.
- storageAccount stringId 
- Specifies the ID of the storage account. Changing this forces a new resource to be created.
- bypasses string[]
- Specifies whether traffic is bypassed for Logging/Metrics/AzureServices. Valid options are any combination of - Logging,- Metrics,- AzureServices, or- None. Defaults to- ["AzureServices"].- Note: User has to explicitly set - bypassto empty slice (- []) to remove it.
- ipRules string[]
- List of public IP or IP ranges in CIDR Format. Only IPv4 addresses are allowed. Private IP address ranges (as defined in RFC 1918) are not allowed. - Note: Small address ranges using "/31" or "/32" prefix sizes are not supported. These ranges should be configured using individual IP address rules without prefix specified. - Note: IP network rules have no effect on requests originating from the same Azure region as the storage account. Use Virtual network rules to allow same-region requests. Services deployed in the same region as the storage account use private Azure IP addresses for communication. Thus, you cannot restrict access to specific Azure services based on their public outbound IP address range. - Note: User has to explicitly set - ip_rulesto empty slice (- []) to remove it.
- privateLink AccountAccess Rules Network Rules Private Link Access Rule[] 
- One or more private_link_accessblock as defined below.
- virtualNetwork string[]Subnet Ids 
- A list of virtual network subnet ids to secure the storage account. - Note: User has to explicitly set - virtual_network_subnet_idsto empty slice (- []) to remove it.
- default_action str
- Specifies the default action of allow or deny when no other rules match. Valid options are DenyorAllow.
- storage_account_ strid 
- Specifies the ID of the storage account. Changing this forces a new resource to be created.
- bypasses Sequence[str]
- Specifies whether traffic is bypassed for Logging/Metrics/AzureServices. Valid options are any combination of - Logging,- Metrics,- AzureServices, or- None. Defaults to- ["AzureServices"].- Note: User has to explicitly set - bypassto empty slice (- []) to remove it.
- ip_rules Sequence[str]
- List of public IP or IP ranges in CIDR Format. Only IPv4 addresses are allowed. Private IP address ranges (as defined in RFC 1918) are not allowed. - Note: Small address ranges using "/31" or "/32" prefix sizes are not supported. These ranges should be configured using individual IP address rules without prefix specified. - Note: IP network rules have no effect on requests originating from the same Azure region as the storage account. Use Virtual network rules to allow same-region requests. Services deployed in the same region as the storage account use private Azure IP addresses for communication. Thus, you cannot restrict access to specific Azure services based on their public outbound IP address range. - Note: User has to explicitly set - ip_rulesto empty slice (- []) to remove it.
- private_link_ Sequence[Accountaccess_ rules Network Rules Private Link Access Rule Args] 
- One or more private_link_accessblock as defined below.
- virtual_network_ Sequence[str]subnet_ ids 
- A list of virtual network subnet ids to secure the storage account. - Note: User has to explicitly set - virtual_network_subnet_idsto empty slice (- []) to remove it.
- defaultAction String
- Specifies the default action of allow or deny when no other rules match. Valid options are DenyorAllow.
- storageAccount StringId 
- Specifies the ID of the storage account. Changing this forces a new resource to be created.
- bypasses List<String>
- Specifies whether traffic is bypassed for Logging/Metrics/AzureServices. Valid options are any combination of - Logging,- Metrics,- AzureServices, or- None. Defaults to- ["AzureServices"].- Note: User has to explicitly set - bypassto empty slice (- []) to remove it.
- ipRules List<String>
- List of public IP or IP ranges in CIDR Format. Only IPv4 addresses are allowed. Private IP address ranges (as defined in RFC 1918) are not allowed. - Note: Small address ranges using "/31" or "/32" prefix sizes are not supported. These ranges should be configured using individual IP address rules without prefix specified. - Note: IP network rules have no effect on requests originating from the same Azure region as the storage account. Use Virtual network rules to allow same-region requests. Services deployed in the same region as the storage account use private Azure IP addresses for communication. Thus, you cannot restrict access to specific Azure services based on their public outbound IP address range. - Note: User has to explicitly set - ip_rulesto empty slice (- []) to remove it.
- privateLink List<Property Map>Access Rules 
- One or more private_link_accessblock as defined below.
- virtualNetwork List<String>Subnet Ids 
- A list of virtual network subnet ids to secure the storage account. - Note: User has to explicitly set - virtual_network_subnet_idsto empty slice (- []) to remove it.
Outputs
All input properties are implicitly available as output properties. Additionally, the AccountNetworkRules resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing AccountNetworkRules Resource
Get an existing AccountNetworkRules resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: AccountNetworkRulesState, opts?: CustomResourceOptions): AccountNetworkRules@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        bypasses: Optional[Sequence[str]] = None,
        default_action: Optional[str] = None,
        ip_rules: Optional[Sequence[str]] = None,
        private_link_access_rules: Optional[Sequence[AccountNetworkRulesPrivateLinkAccessRuleArgs]] = None,
        storage_account_id: Optional[str] = None,
        virtual_network_subnet_ids: Optional[Sequence[str]] = None) -> AccountNetworkRulesfunc GetAccountNetworkRules(ctx *Context, name string, id IDInput, state *AccountNetworkRulesState, opts ...ResourceOption) (*AccountNetworkRules, error)public static AccountNetworkRules Get(string name, Input<string> id, AccountNetworkRulesState? state, CustomResourceOptions? opts = null)public static AccountNetworkRules get(String name, Output<String> id, AccountNetworkRulesState state, CustomResourceOptions options)resources:  _:    type: azure:storage:AccountNetworkRules    get:      id: ${id}- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Bypasses List<string>
- Specifies whether traffic is bypassed for Logging/Metrics/AzureServices. Valid options are any combination of - Logging,- Metrics,- AzureServices, or- None. Defaults to- ["AzureServices"].- Note: User has to explicitly set - bypassto empty slice (- []) to remove it.
- DefaultAction string
- Specifies the default action of allow or deny when no other rules match. Valid options are DenyorAllow.
- IpRules List<string>
- List of public IP or IP ranges in CIDR Format. Only IPv4 addresses are allowed. Private IP address ranges (as defined in RFC 1918) are not allowed. - Note: Small address ranges using "/31" or "/32" prefix sizes are not supported. These ranges should be configured using individual IP address rules without prefix specified. - Note: IP network rules have no effect on requests originating from the same Azure region as the storage account. Use Virtual network rules to allow same-region requests. Services deployed in the same region as the storage account use private Azure IP addresses for communication. Thus, you cannot restrict access to specific Azure services based on their public outbound IP address range. - Note: User has to explicitly set - ip_rulesto empty slice (- []) to remove it.
- PrivateLink List<AccountAccess Rules Network Rules Private Link Access Rule> 
- One or more private_link_accessblock as defined below.
- StorageAccount stringId 
- Specifies the ID of the storage account. Changing this forces a new resource to be created.
- VirtualNetwork List<string>Subnet Ids 
- A list of virtual network subnet ids to secure the storage account. - Note: User has to explicitly set - virtual_network_subnet_idsto empty slice (- []) to remove it.
- Bypasses []string
- Specifies whether traffic is bypassed for Logging/Metrics/AzureServices. Valid options are any combination of - Logging,- Metrics,- AzureServices, or- None. Defaults to- ["AzureServices"].- Note: User has to explicitly set - bypassto empty slice (- []) to remove it.
- DefaultAction string
- Specifies the default action of allow or deny when no other rules match. Valid options are DenyorAllow.
- IpRules []string
- List of public IP or IP ranges in CIDR Format. Only IPv4 addresses are allowed. Private IP address ranges (as defined in RFC 1918) are not allowed. - Note: Small address ranges using "/31" or "/32" prefix sizes are not supported. These ranges should be configured using individual IP address rules without prefix specified. - Note: IP network rules have no effect on requests originating from the same Azure region as the storage account. Use Virtual network rules to allow same-region requests. Services deployed in the same region as the storage account use private Azure IP addresses for communication. Thus, you cannot restrict access to specific Azure services based on their public outbound IP address range. - Note: User has to explicitly set - ip_rulesto empty slice (- []) to remove it.
- PrivateLink []AccountAccess Rules Network Rules Private Link Access Rule Args 
- One or more private_link_accessblock as defined below.
- StorageAccount stringId 
- Specifies the ID of the storage account. Changing this forces a new resource to be created.
- VirtualNetwork []stringSubnet Ids 
- A list of virtual network subnet ids to secure the storage account. - Note: User has to explicitly set - virtual_network_subnet_idsto empty slice (- []) to remove it.
- bypasses List<String>
- Specifies whether traffic is bypassed for Logging/Metrics/AzureServices. Valid options are any combination of - Logging,- Metrics,- AzureServices, or- None. Defaults to- ["AzureServices"].- Note: User has to explicitly set - bypassto empty slice (- []) to remove it.
- defaultAction String
- Specifies the default action of allow or deny when no other rules match. Valid options are DenyorAllow.
- ipRules List<String>
- List of public IP or IP ranges in CIDR Format. Only IPv4 addresses are allowed. Private IP address ranges (as defined in RFC 1918) are not allowed. - Note: Small address ranges using "/31" or "/32" prefix sizes are not supported. These ranges should be configured using individual IP address rules without prefix specified. - Note: IP network rules have no effect on requests originating from the same Azure region as the storage account. Use Virtual network rules to allow same-region requests. Services deployed in the same region as the storage account use private Azure IP addresses for communication. Thus, you cannot restrict access to specific Azure services based on their public outbound IP address range. - Note: User has to explicitly set - ip_rulesto empty slice (- []) to remove it.
- privateLink List<AccountAccess Rules Network Rules Private Link Access Rule> 
- One or more private_link_accessblock as defined below.
- storageAccount StringId 
- Specifies the ID of the storage account. Changing this forces a new resource to be created.
- virtualNetwork List<String>Subnet Ids 
- A list of virtual network subnet ids to secure the storage account. - Note: User has to explicitly set - virtual_network_subnet_idsto empty slice (- []) to remove it.
- bypasses string[]
- Specifies whether traffic is bypassed for Logging/Metrics/AzureServices. Valid options are any combination of - Logging,- Metrics,- AzureServices, or- None. Defaults to- ["AzureServices"].- Note: User has to explicitly set - bypassto empty slice (- []) to remove it.
- defaultAction string
- Specifies the default action of allow or deny when no other rules match. Valid options are DenyorAllow.
- ipRules string[]
- List of public IP or IP ranges in CIDR Format. Only IPv4 addresses are allowed. Private IP address ranges (as defined in RFC 1918) are not allowed. - Note: Small address ranges using "/31" or "/32" prefix sizes are not supported. These ranges should be configured using individual IP address rules without prefix specified. - Note: IP network rules have no effect on requests originating from the same Azure region as the storage account. Use Virtual network rules to allow same-region requests. Services deployed in the same region as the storage account use private Azure IP addresses for communication. Thus, you cannot restrict access to specific Azure services based on their public outbound IP address range. - Note: User has to explicitly set - ip_rulesto empty slice (- []) to remove it.
- privateLink AccountAccess Rules Network Rules Private Link Access Rule[] 
- One or more private_link_accessblock as defined below.
- storageAccount stringId 
- Specifies the ID of the storage account. Changing this forces a new resource to be created.
- virtualNetwork string[]Subnet Ids 
- A list of virtual network subnet ids to secure the storage account. - Note: User has to explicitly set - virtual_network_subnet_idsto empty slice (- []) to remove it.
- bypasses Sequence[str]
- Specifies whether traffic is bypassed for Logging/Metrics/AzureServices. Valid options are any combination of - Logging,- Metrics,- AzureServices, or- None. Defaults to- ["AzureServices"].- Note: User has to explicitly set - bypassto empty slice (- []) to remove it.
- default_action str
- Specifies the default action of allow or deny when no other rules match. Valid options are DenyorAllow.
- ip_rules Sequence[str]
- List of public IP or IP ranges in CIDR Format. Only IPv4 addresses are allowed. Private IP address ranges (as defined in RFC 1918) are not allowed. - Note: Small address ranges using "/31" or "/32" prefix sizes are not supported. These ranges should be configured using individual IP address rules without prefix specified. - Note: IP network rules have no effect on requests originating from the same Azure region as the storage account. Use Virtual network rules to allow same-region requests. Services deployed in the same region as the storage account use private Azure IP addresses for communication. Thus, you cannot restrict access to specific Azure services based on their public outbound IP address range. - Note: User has to explicitly set - ip_rulesto empty slice (- []) to remove it.
- private_link_ Sequence[Accountaccess_ rules Network Rules Private Link Access Rule Args] 
- One or more private_link_accessblock as defined below.
- storage_account_ strid 
- Specifies the ID of the storage account. Changing this forces a new resource to be created.
- virtual_network_ Sequence[str]subnet_ ids 
- A list of virtual network subnet ids to secure the storage account. - Note: User has to explicitly set - virtual_network_subnet_idsto empty slice (- []) to remove it.
- bypasses List<String>
- Specifies whether traffic is bypassed for Logging/Metrics/AzureServices. Valid options are any combination of - Logging,- Metrics,- AzureServices, or- None. Defaults to- ["AzureServices"].- Note: User has to explicitly set - bypassto empty slice (- []) to remove it.
- defaultAction String
- Specifies the default action of allow or deny when no other rules match. Valid options are DenyorAllow.
- ipRules List<String>
- List of public IP or IP ranges in CIDR Format. Only IPv4 addresses are allowed. Private IP address ranges (as defined in RFC 1918) are not allowed. - Note: Small address ranges using "/31" or "/32" prefix sizes are not supported. These ranges should be configured using individual IP address rules without prefix specified. - Note: IP network rules have no effect on requests originating from the same Azure region as the storage account. Use Virtual network rules to allow same-region requests. Services deployed in the same region as the storage account use private Azure IP addresses for communication. Thus, you cannot restrict access to specific Azure services based on their public outbound IP address range. - Note: User has to explicitly set - ip_rulesto empty slice (- []) to remove it.
- privateLink List<Property Map>Access Rules 
- One or more private_link_accessblock as defined below.
- storageAccount StringId 
- Specifies the ID of the storage account. Changing this forces a new resource to be created.
- virtualNetwork List<String>Subnet Ids 
- A list of virtual network subnet ids to secure the storage account. - Note: User has to explicitly set - virtual_network_subnet_idsto empty slice (- []) to remove it.
Supporting Types
AccountNetworkRulesPrivateLinkAccessRule, AccountNetworkRulesPrivateLinkAccessRuleArgs              
- EndpointResource stringId 
- The resource id of the resource access rule to be granted access.
- EndpointTenant stringId 
- The tenant id of the resource of the resource access rule to be granted access. Defaults to the current tenant id.
- EndpointResource stringId 
- The resource id of the resource access rule to be granted access.
- EndpointTenant stringId 
- The tenant id of the resource of the resource access rule to be granted access. Defaults to the current tenant id.
- endpointResource StringId 
- The resource id of the resource access rule to be granted access.
- endpointTenant StringId 
- The tenant id of the resource of the resource access rule to be granted access. Defaults to the current tenant id.
- endpointResource stringId 
- The resource id of the resource access rule to be granted access.
- endpointTenant stringId 
- The tenant id of the resource of the resource access rule to be granted access. Defaults to the current tenant id.
- endpoint_resource_ strid 
- The resource id of the resource access rule to be granted access.
- endpoint_tenant_ strid 
- The tenant id of the resource of the resource access rule to be granted access. Defaults to the current tenant id.
- endpointResource StringId 
- The resource id of the resource access rule to be granted access.
- endpointTenant StringId 
- The tenant id of the resource of the resource access rule to be granted access. Defaults to the current tenant id.
Import
Storage Account Network Rules can be imported using the resource id, e.g.
$ pulumi import azure:storage/accountNetworkRules:AccountNetworkRules storageAcc1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myresourcegroup/providers/Microsoft.Storage/storageAccounts/myaccount
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Azure Classic pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the azurermTerraform Provider.
