Azure Storage Networking: Private Endpoint

Microsoft Docs

This document outlines how to use private endpoints with Azure Storage accounts to enhance security and control network access.

What is a Private Endpoint?

A private endpoint is a network interface that connects you privately and securely to a Platform as a Service (PaaS) offering in Azure. It uses a private IP address from your virtual network, effectively bringing the Azure service into your virtual network.

This is particularly useful for Azure Storage to:

Prerequisites

Creating a Private Endpoint for Azure Storage

Using the Azure Portal

  1. Navigate to your Storage Account in the Azure portal.
  2. Under Settings, select Networking.
  3. Choose the Private endpoint connections tab.
  4. Click + Private endpoint.
  5. Basics Tab:
    • Select your Subscription and Resource group.
    • Provide a Name for your private endpoint.
    • Choose a Region.
  6. Resource Tab:
    • Connection method: Select 'Connect to an Azure resource in my directory' or 'Connect to an Azure resource by resource ID or alias'.
    • Subscription: Select the subscription containing your storage account.
    • Resource type: Select 'Microsoft.Storage/storageAccounts'.
    • Instance: Select your storage account.
    • Target sub-resource: Choose the service you want to connect to (e.g., 'blob', 'file', 'queue', 'table').
  7. Configuration Tab:
    • Virtual network: Select your VNet.
    • Subnet: Select the subnet within your VNet.
    • Integrate with private DNS zone: For seamless name resolution, it's recommended to enable this. Azure will typically create a private DNS zone for the storage account.
  8. Tags Tab: Optionally add tags.
  9. Click Review + create, then Create.

Using Azure CLI

Replace placeholders with your actual values.

az network private-endpoint create \ --name MyPrivateEndpoint \ --resource-group MyResourceGroup \ --vnet-name MyVNet \ --subnet MySubnet \ --private-connection-resource-id "/subscriptions/YOUR_SUBSCRIPTION_ID/resourceGroups/MY_STORAGE_RG/providers/Microsoft.Storage/storageAccounts/MY_STORAGE_ACCOUNT" \ --group-ids blob \ --location westus2 \ --connection-name MyStorageConnection

For DNS integration, you would typically create a private DNS zone and link it to your VNet, then create an A record pointing to the private endpoint's IP. For example:

# Example for blob service DNS az network private-dns zone create \ --resource-group MyResourceGroup \ --name "privatelink.blob.core.windows.net" az network private-dns link vnet create \ --resource-group MyResourceGroup \ --name MyDnsLink \ --zone-name "privatelink.blob.core.windows.net" \ --virtual-network MyVNet \ --registration-enabled false az network private-dns record-set a add-record \ --resource-group MyResourceGroup \ --zone-name "privatelink.blob.core.windows.net" \ --record-set-name "mystorageaccount" \ --ipv4-address "PRIVATE_ENDPOINT_IP_ADDRESS"

Verifying Connectivity

Once the private endpoint is provisioned, you can test connectivity from a virtual machine within the connected virtual network.

Important: When using private endpoints, ensure that public network access to your storage account is disabled (under Storage Account -> Networking -> Firewalls and virtual networks -> Public network access: Disabled) to maximize security.

Managing Private Endpoints

You can manage your private endpoints through the Azure portal or Azure CLI. This includes updating configurations, deleting endpoints, and reviewing connection status.

Scenarios and Best Practices

Considerations: Private endpoints introduce a private IP address dependency. Ensure your subnet has sufficient IP address space. Also, be mindful of the private DNS zone management for seamless name resolution.

For more advanced scenarios or troubleshooting, refer to the official Azure Storage documentation.