Sign in

Network Security for Azure Storage

This document provides a comprehensive overview of the network security features available for Azure Storage accounts. Protecting your data in Azure Storage is paramount, and understanding these security mechanisms is key to building secure and robust applications.

Understanding Azure Storage Network Security

Azure Storage offers a variety of options to control network access to your storage accounts. These controls allow you to restrict access to specific IP addresses, virtual networks, or to make your data publicly accessible.

Firewall and Virtual Network Rules

The Azure Storage firewall and virtual network settings allow you to restrict network access to your storage account. By default, all network access to your storage account is allowed. You can change this default behavior to deny all access and then selectively allow access from specified IP addresses or virtual network subnets.

Tip: For the most restrictive security posture, consider using private endpoints and disabling public network access.

Configuring Network Security

Using the Azure Portal

You can configure network security settings through the Azure portal:

  1. Navigate to your storage account in the Azure portal.
  2. In the left-hand menu, under "Security + networking", select "Networking".
  3. Choose the desired network access configuration: "Public endpoint (all networks)", "Public endpoint (selected networks)", or "Private endpoint connections".
  4. If you select "Public endpoint (selected networks)", you can add IP addresses or virtual networks.
  5. If you choose to use "Private endpoint connections", you can create or manage private endpoints.

Using Azure CLI

The Azure Command-Line Interface (CLI) can also be used to manage network security rules. Here are some example commands:


# Enable firewall for selected networks and add an IP range
az storage account update --name <storage-account-name> --resource-group <resource-group-name> --bypass none --default-action deny --add "networkAcls.ipRules" --ip-address "203.0.113.0/24"

# Disable public access entirely
az storage account update --name <storage-account-name> --resource-group <resource-group-name> --public-network-access disabled

# Create a private endpoint
az network private-endpoint create --name <private-endpoint-name> --resource-group <resource-group-name> --location <location> --subnet <subnet-id> --private-connection-resource-id "/subscriptions/<subscription-id>/resourceGroups/<resource-group-name>/providers/Microsoft.Storage/storageAccounts/<storage-account-name>" --group-ids "blob"
            

Network Security Best Practices

Note: Network security rules are applied at the storage account level and affect all services (Blob, File, Queue, Table) within that account.

Key Security Features Summary

Feature Description Use Case
Public Endpoint (All Networks) Allows access from any IP address. Publicly accessible data, development environments.
Public Endpoint (Selected Networks) Allows access from specified IP addresses or VNets. Controlled access from specific networks or IP ranges.
Private Endpoint Access storage via a private IP address within your VNet. Secure access from within your VNet, minimizing internet exposure.
Service Endpoints Extends your virtual network identity to Azure services. Secure and optimized access to Azure Storage from VNets.