Home Microsoft AzureAzure Private Endpoints for Blob Storage: Secure Setup

Azure Private Endpoints for Blob Storage: Secure Setup

by Knowledge Base Linux
azure private endpoints blob storage architecture with a private endpoint inside a virtual network

By default, an Azure storage account is reachable over the public internet. Anyone who obtains a valid key or SAS token can connect from anywhere, and your firewall rules are the only thing standing between the account and the rest of the world. For workloads that handle sensitive data, that exposure is hard to justify. Azure private endpoints blob storage configuration solves the problem by giving your storage account a private IP address inside your virtual network, so traffic from your VMs never leaves the Azure backbone and the public endpoint can be switched off entirely.

In this guide you will learn how azure private endpoints blob storage works, how it differs from service endpoints, and how to set it up end to end: a virtual network and subnet, the private endpoint itself, the private DNS zone that makes name resolution work, disabling public network access, and testing the result from a VM. You will also learn to diagnose the four failures that most often break a private endpoint deployment.

azure private endpoints blob storage testing DNS resolution to a private IP from a virtual machine

Private Endpoints Versus Service Endpoints

Service endpoints and private endpoints both keep traffic off the public internet path, but they work differently. A service endpoint extends your virtual network identity to the storage service over the Azure backbone, yet the storage account still uses its public IP address and public DNS name. A private endpoint goes further: it assigns a network interface with a private IP address from your subnet to the storage account, and the storage DNS name resolves to that private IP inside your network. The storage account effectively becomes a resource on your virtual network.

That difference matters for security reviews. With a private endpoint, you can disable public network access on the storage account completely, and connections from outside the virtual network are rejected at the network layer rather than merely discouraged by firewall rules. Private endpoints also work for on-premises networks connected through ExpressRoute or a VPN gateway, provided DNS forwarding is configured, which makes them the standard choice for hybrid architectures.

Prerequisites for Azure Private Endpoints Blob Storage

Before you begin, you need an Azure subscription, a resource group, a virtual network with at least one subnet, and a general-purpose v2 storage account. You also need the Azure CLI installed and signed in, plus a test VM inside the same virtual network for verification. The subnet that hosts the private endpoint must have private endpoint network policies disabled, which is a setting that trips up many first deployments.

az account show --query name -o tsv
az network vnet list -g my-resource-group -o table
az storage account show -n mystorageaccount -g my-resource-group --query "publicNetworkAccess"

Decide on a naming convention before you create anything. You will create a private endpoint, a private DNS zone, a DNS zone group, and possibly a DNS zone virtual network link, and clear names make the resulting resources easy to audit later. Keep the storage account name in mind as well: it must be globally unique and between 3 and 24 lowercase letters and numbers.

Create the Subnet and Disable Network Policies

If you do not already have a dedicated subnet, create one for private endpoints. Then disable private endpoint network policies on that subnet. Without this step, network security group rules and user-defined routes can interfere with the endpoint, and the deployment may fail or behave unpredictably.

az network vnet subnet create   --resource-group my-resource-group   --vnet-name my-vnet   --name private-endpoint-subnet   --address-prefixes 10.0.2.0/24

az network vnet subnet update   --resource-group my-resource-group   --vnet-name my-vnet   --name private-endpoint-subnet   --disable-private-endpoint-network-policies true

Note that disabling private endpoint network policies does not remove your NSG from the subnet. It only changes how the platform treats traffic to the private endpoint interface. Your NSG rules still apply to the VMs in the subnet, which is why an overly strict NSG remains a common cause of failed connectivity tests later.

Create the Azure Private Endpoint for Blob Storage

With the subnet ready, create the private endpoint and point it at the blob sub-resource of your storage account. The --group-id blob value is what tells Azure this endpoint serves Blob storage rather than file, queue, or table storage. Each storage service needs its own private endpoint if you use more than one.

az network private-endpoint create   --resource-group my-resource-group   --name mystorage-pe   --vnet-name my-vnet   --subnet private-endpoint-subnet   --private-connection-resource-id /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/my-resource-group/providers/Microsoft.Storage/storageAccounts/mystorageaccount   --group-id blob   --connection-name mystorage-connection

Replace the subscription ID in the resource ID with your own, which you can find with az account show --query id -o tsv. After creation, check the provisioning state and the connection state. A healthy endpoint shows Succeeded and Approved. If the connection state shows Pending, the endpoint is waiting for approval, which is the expected behavior when the endpoint and the storage account live in different tenants or subscriptions, or when manual approval is configured.

az network private-endpoint show   --resource-group my-resource-group   --name mystorage-pe   --query "{provisioning:provisioningState, connection:privateLinkServiceConnections[0].privateLinkServiceConnectionState.status}" -o table

Configure Private DNS for Azure Private Endpoints Blob Storage

Creating the endpoint is only half the job. Your VMs still resolve mystorageaccount.blob.core.windows.net to the public IP unless private DNS overrides it. Create a private DNS zone named privatelink.blob.core.windows.net, link it to your virtual network, and attach it to the endpoint with a DNS zone group. The zone group automates the creation of the A record that maps the storage name to the endpoint private IP.

az network private-dns zone create   --resource-group my-resource-group   --name privatelink.blob.core.windows.net

az network private-dns link vnet create   --resource-group my-resource-group   --zone-name privatelink.blob.core.windows.net   --name my-vnet-link   --virtual-network my-vnet   --registration-enabled false

az network private-endpoint dns-zone-group create   --resource-group my-resource-group   --endpoint-name mystorage-pe   --name default   --zone-name privatelink.blob.core.windows.net   --private-dns-zone privatelink.blob.core.windows.net

If you manage DNS centrally in a hub virtual network, create the zone there and link it to the spoke networks instead of creating a zone per network. The key requirement is the same in both designs: every VM that must reach the storage privately needs a DNS path to the private zone, whether direct or forwarded.

Disable Public Network Access on the Storage Account

Once the private endpoint and DNS are working, disable public network access on the storage account. This is the step that converts the private endpoint from a nice-to-have into a real security boundary. After this change, only connections through private endpoints, and any explicitly allowed exceptions, can reach the account.

az storage account update   --resource-group my-resource-group   --name mystorageaccount   --public-network-access Disabled

Apply this change only after you have verified private connectivity, because disabling public access before DNS works will lock out every client, including your own testing VM if its DNS still resolves publicly. Also review any services that previously reached the account over the public endpoint, such as Azure Functions, Logic Apps, or backup tools, and give each of them a private path or an approved exception before you flip the switch. For background on securing the surrounding network, see our guide to Azure virtual networks and network security groups, and for storage performance choices see Azure Blob storage tiers explained. The official reference is the Azure Private Endpoint documentation.

Test Azure Private Endpoints Blob Storage from a VM

Testing is straightforward and decisive. From a VM inside the virtual network, resolve the storage account name and confirm it returns a private IP address from your subnet range, not a public address. Then confirm that an actual storage operation succeeds from that VM.

nslookup mystorageaccount.blob.core.windows.net
dig +short mystorageaccount.blob.core.windows.net

A correct result shows an address like 10.0.2.4. If you see a public address, DNS is not using the private zone, and traffic is not private even though the endpoint exists. Once DNS is correct, test an upload with the Azure CLI from the VM, using a connection string or a SAS token, and confirm it completes. Finally, test from outside the network, for example from your workstation, and confirm that the connection is refused now that public access is disabled.

az storage blob upload   --account-name mystorageaccount   --container-name test   --name hello.txt   --file ./hello.txt   --auth-mode login

Troubleshooting Azure Private Endpoints Blob Storage

DNS still resolves to a public IP. The private DNS zone is missing, not linked to the VM virtual network, or the DNS zone group was never created so no A record exists. Check the zone records and the virtual network link, and flush the DNS cache on the test VM before retesting.

Connection state stuck at Pending. The endpoint awaits approval on the storage account side. Approve it from the storage account networking page or with the CLI, or recreate the endpoint with automatic approval when both resources are in the same subscription and tenant.

NSG blocks the connection. Even with private endpoint network policies disabled on the endpoint subnet, the VM subnet NSG can still block outbound traffic on port 443. Verify the effective security rules on the VM network interface and allow HTTPS to the endpoint subnet.

Storage firewall rejects the request. If public access is disabled but a client still arrives over the public endpoint, the storage firewall denies it. This is working as intended. Give that client a private path, or add a temporary firewall exception while you migrate it, and remove the exception afterwards.

Conclusion

Azure private endpoints blob storage configuration takes more steps than a firewall rule, but it delivers a stronger guarantee: storage traffic stays on private addresses inside your network, and the public endpoint can be closed completely. Build the subnet with network policies disabled, create the endpoint for the blob sub-resource, wire up private DNS with a zone group, verify with nslookup before disabling public access, and test from both inside and outside the network. That sequence gives you a storage account that is reachable exactly where it should be, and nowhere else.

You may also like

KbLinux

Typically replies within a day

Hello, Welcome to the site. Please click below button for chatting me through Telegram.