Lesson 1 of 5 Securing Access to Azure Storage

Restricting Network Access to Storage Accounts

The storage firewall controls which networks can reach a storage account's public endpoint. This lesson explains the public network access settings, rule types and exceptions.

Learning outcomes

After completing this lesson, you will be able to:

  • Describe the three public network access settings.
  • Distinguish between virtual network rules, IP network rules and resource instance rules.
  • Explain the trusted Microsoft services exception and the firewall's effect on the portal.

Public network access settings

On the account's Networking page, public network access has three options. Enabled from all networks (the default) accepts requests from anywhere, subject to authorization. Enabled from selected virtual networks and IP addresses applies the firewall rules below and denies other traffic. Disabled blocks the public endpoint entirely, leaving only private endpoints. Network rules are evaluated before authorization, so a request from a denied network fails even with a valid key or SAS.

Match the pairs

Public network access

Exam skills 2.1.1

Match each public network access option with its effect.

Log in to try this activity Interactive activities are free with an account.

Firewall rule types

With selected networks, access is granted by three kinds of rules. Virtual network rules allow specific subnets, which must have the Microsoft.Storage (or Microsoft.Storage.Global) service endpoint enabled; the portal can enable it when the rule is added. Subnets can be in other regions and, with permissions, other subscriptions. IP network rules allow public IPv4 addresses or CIDR ranges, such as an office's outbound NAT address; private address ranges (RFC 1918) cannot be used, and clients in the same Azure region reach storage with private addresses, so they need virtual network rules instead. Resource instance rules allow specific Azure resource instances, such as a particular Azure Synapse workspace or Data Factory, by resource type and ID, using the resource's managed identity.

Exceptions include Allow Azure services on the trusted services list to access this storage account, which lets services such as Azure Backup, Azure Site Recovery, Azure Monitor, Event Grid and Azure DevTest Labs reach the account, and options to allow read access to logs and metrics. Network security perimeter is a newer option that groups several PaaS resources behind a common boundary.

The following diagram shows which sources a storage firewall admits when access is limited to one subnet and the head office.

A storage firewall that admits only the App subnet in VNet1 and the head office. Public network access is set to selected virtual networks and IP addresses, with a virtual network rule for VNet1/App (the subnet has the Microsoft.Storage service endpoint) and an IP rule for 203.0.113.10; the trusted Microsoft services exception lets Azure Backup continue.
The scenario is illustrative.
Sort into groups

Which firewall rule?

Exam skills 2.1.1

Choose the firewall rule or exception that lets each client in.

Log in to try this activity Interactive activities are free with an account.

Effects on administrators and tools

Firewall rules apply to data plane access from every client, including the Azure portal's Storage browser, Storage Explorer and AzCopy. An administrator who can manage the account in the portal may still see an error such as This request is not authorized to perform this operation when browsing containers from a network that is not allowed. Adding the administrator's public IP address (the portal offers Add your client IP address) or connecting from an allowed network resolves it. Control plane operations, such as changing settings through Azure Resource Manager, are not affected by the firewall.

Troubleshooting

Locked out by the firewall

Exam skills 2.1.1

Find the fix when the storage firewall blocks an administrator.

Log in to try this activity Interactive activities are free with an account.
Worked example

Restricting an account to a subnet and an office

A storage account must be reachable only from VMs in the subnet App in VNet1 and from the head office, whose outbound traffic uses the public address 203.0.113.10. Azure Backup must still be able to back up file shares in the account. What should you configure?

Set public network access to Enabled from selected virtual networks and IP addresses. Add a virtual network rule for VNet1/App, enabling the Microsoft.Storage service endpoint on the subnet; add an IP network rule for 203.0.113.10; and keep the trusted Microsoft services exception enabled for Azure Backup. An IP rule with the subnet's private range would not work, because IP rules accept only public addresses.

Check yourself

Can an IP network rule allow a VNet's private range, such as 10.1.0.0/24?

Show answer

No. IP rules accept public addresses only; subnets are allowed with virtual network rules and a service endpoint.

Exam Tips

Remember for the exam

  • Virtual network rules need the Microsoft.Storage service endpoint on the subnet.
  • IP rules accept public addresses only.
  • Allow Azure Backup, Site Recovery and Monitor: the trusted Microsoft services exception.
  • The firewall also applies to the portal's data browsing.