Reach a PaaS service through a private endpoint
Connect to Storage or a database over Private Link and fix a misresolving private DNS zone.
By Invicly Tech, , in Microsoft Azure Cloud Engineering. About 13 minutes to read.
In short
A private endpoint gives a PaaS service, such as a storage account or a database, a private IP address inside your VNet, using Azure Private Link. Your apps still use the normal service name, so DNS must answer with that private IP instead of the public one. Most private endpoint problems are really DNS problems.
Think of it like this: A private endpoint is a private side door into the shop; DNS is the map, and if the map still shows the front door, people keep walking to the front.
Explained simply
Many Azure services, such as Storage, Azure SQL Database and Key Vault, have public addresses on the internet by default. Even with firewalls and keys, some teams do not want their data services reachable from the internet at all. A private endpoint solves this by giving the service a private IP address inside your own VNet.
Behind the scenes this is called Azure Private Link. When you create a private endpoint, Azure adds a network card to one of your subnets, gives it an IP such as 10.10.3.4, and connects it to one part of the service, for example the blob part of a storage account.
Your app should keep using the normal name, such as stcontoso.blob.core.windows.net, because certificates and SDKs expect it. So DNS has to give a different answer inside your network: the private IP instead of the public one. A private DNS zone linked to your VNet does exactly that.
When something goes wrong, the first question is almost always the same: what does the name resolve to from where the app runs? If the answer is a public IP, the private endpoint is never used, and if public access is turned off, the connection fails.
Press Play on a diagram to walk through it one step at a time.
- App in VNet to Azure DNS 168.63.129.16: Who is stcontoso.blob.core.windows.net?1Who is stcontoso.blob.core.windows.net?
- Azure DNS 168.63.129.16 to Public DNS: Look up the public name2Look up the public name
- Public DNS to Azure DNS 168.63.129.16: CNAME: stcontoso.privatelink.blob.core.windows.net3CNAME: stcontoso.privatelink.blob.core.windows.net
- Azure DNS 168.63.129.16 to Private DNS zone: Linked zone privatelink.blob.core.windows.net?4Linked zone privatelink.blob.core.windows.net?
- Private DNS zone to Azure DNS 168.63.129.16: A record: 10.10.3.45A record: 10.10.3.4
- Azure DNS 168.63.129.16 to App in VNet: Answer: 10.10.3.4 (private)6Answer: 10.10.3.4 (private)
- 1Subnet
A subnet for private endpoints, such as snet-pe
- 2Private endpoint
Target resource and group ID
- 3Private DNS zone
The privatelink zone for that service
- 4Zone link
Link the zone to every client VNet
- 5Zone group
Lets Azure manage the A record
- 6Close the public door
Public network access: Disabled
In depth
What Private Link actually creates
A private endpoint is a network interface in a subnet you choose. It connects to one target sub-resource, called a group ID: blob, file, queue or dfs for Storage, sqlServer for Azure SQL Database, postgresqlServer for Azure Database for PostgreSQL flexible server, vault for Key Vault. A storage account that serves both blobs and files needs two private endpoints.
Traffic to the private IP travels over the Microsoft backbone to that one resource only, not to the whole service. That also limits data leaks: even if someone points your network at another storage account, the private endpoint will not reach it. Once the private path works, set public network access to Disabled on the service so the public address refuses connections. Private endpoints cost a small hourly charge plus a per-GB fee.
- One private endpoint per sub-resource (blob, file, dfs...)
- The endpoint gets a private IP from your subnet
- The service must approve the connection; same-tenant owners are approved automatically
- Disable public network access after testing
- Service keeps its public IP
- Subnet allowed on the service firewall
- No DNS changes needed
- Not reachable from on-premises
- Service gets a private IP in your VNet
- Public access can be turned off
- Needs a private DNS zone
- Reachable from peered VNets and on-premises
The DNS chain, step by step
When you create a private endpoint, Azure changes the public DNS for that resource. stcontoso.blob.core.windows.net now has a CNAME to stcontoso.privatelink.blob.core.windows.net. Outside your network, that privatelink name still leads to the public IP. Inside your network, a private DNS zone called privatelink.blob.core.windows.net holds an A record pointing stcontoso to 10.10.3.4.
Two things make that work. The zone must be linked to the VNet where the client sits, and the client must ask Azure DNS at 168.63.129.16, which is the default for VNets. A DNS zone group on the private endpoint creates and removes the A record for you, which is better than adding records by hand. Every service has its own zone name, so check the official list instead of guessing.
- Blob: privatelink.blob.core.windows.net
- Azure SQL: privatelink.database.windows.net
- PostgreSQL flexible server: privatelink.postgres.database.azure.com
- Key Vault: privatelink.vaultcore.azure.net
Letting apps use the private path
VMs and containers in the VNet use the private endpoint automatically once DNS is right. App Service and Azure Functions are different: they run on shared infrastructure outside your VNet. Regional VNet integration fixes that for outbound calls. You give the app an empty subnet delegated to Microsoft.Web/serverFarms, and its calls to private addresses go through that subnet and use the VNet's DNS settings.
Peered spokes need the private DNS zone linked to them too, or a central DNS setup in the hub. A common pattern keeps all privatelink zones in the hub subscription, links them to every spoke, and puts private endpoints in each workload's own subnet. VNet integration handles outbound only; to make the app itself private for inbound traffic, give the app its own private endpoint.
On-premises and custom DNS servers
Clients on-premises cannot query a private DNS zone directly, because 168.63.129.16 only answers from inside Azure. The usual fix is Azure DNS Private Resolver in the hub. Its inbound endpoint gets a private IP; on-premises DNS servers add a conditional forwarder for the public zone, such as blob.core.windows.net, pointing to that IP. The resolver then follows the CNAME into the linked privatelink zone.
The same rule applies to VNets that use custom DNS servers, for example domain controllers. Those servers must forward Azure names to 168.63.129.16 or to the resolver, otherwise they will return the public IP. Forward the public zone, not the privatelink zone, so names for resources without a private endpoint still resolve publicly.
- 1Laptop
Asks the office DNS server
- 2Office DNS
Conditional forwarder for blob.core.windows.net
- 3Private Resolver inbound
Private IP in the hub VNet
- 4Private DNS zone
Linked to the hub, returns 10.10.3.4
- 5Connection
Over VPN or ExpressRoute to the private IP
Troubleshooting a misresolved name
Work from DNS outwards. Run nslookup from the same place the app runs: a VM, the App Service console or a container shell. If you get a public IP, check the zone link to that VNet, then check the VNet's DNS server setting, then check the A record exists in the zone. If you get NXDOMAIN, the zone may have the wrong name, or a record exists for a different resource name.
If DNS returns the private IP but the connection still fails, look at the network: an NSG on the private endpoint subnet (enforced only when network policies are enabled on that subnet), a route sending traffic through a firewall that blocks it, or a pending connection approval. Never fix this with hosts file entries; they hide the real fault and break when the IP changes.
- Public IP returned: missing zone link or custom DNS not forwarding
- NXDOMAIN: wrong zone name or missing A record
- Private IP but timeout: NSG, route or firewall
- Check the connection state is Approved
Learn it in 5 short steps
About 35m each. Track them with a timer in your plan.
- 1Create a private endpoint~35m
- 2Link a private DNS zone~35m
- 3Integrate an app with the VNet~35m
- 4Check name resolution~35m
- 5Fix a misresolved name~35m
Key points
- The private endpoint is a network interface in your subnet with a private IP for one sub-resource, such as blob.
- The public name gets a CNAME to a privatelink name; a private DNS zone linked to the VNet answers it.
- Turn off public network access on the service once the private path works.
- App Service and Functions need VNet integration to send outbound traffic into the VNet.
- Custom or on-premises DNS servers must forward to Azure DNS (168.63.129.16) or use Azure DNS Private Resolver.
Key terms
Tap a card to flip it. 0/6 known
Examples
# Run from a VM or console inside the VNet
nslookup stcontoso.blob.core.windows.net
# Good: ...privatelink.blob.core.windows.net Address: 10.10.3.4
# Bad: a public address, so the zone link or A record is missingThe first test for any private endpoint: does the name resolve to a private IP?
Private endpoint for a storage account
You want blob storage reachable only from vnet-app. Step 1: create the private endpoint in snet-pe for the blob group ID. Step 2: create the privatelink.blob.core.windows.net zone. Step 3: link it to vnet-app. Step 4: add a DNS zone group so the A record is managed for you. Step 5: disable public access. Evidence: nslookup from a VM in vnet-app returns 10.10.x.x, and a request from your laptop gets an authorisation or network error. Cleanup: delete the resource group.
ST_ID=$(az storage account show -g rg-pe -n stcontoso --query id -o tsv)
az network private-endpoint create -g rg-pe -n pe-stcontoso-blob \
--vnet-name vnet-app --subnet snet-pe --private-connection-resource-id $ST_ID \
--group-id blob --connection-name conn-blob
az network private-dns zone create -g rg-pe -n privatelink.blob.core.windows.net
az network private-dns link vnet create -g rg-pe -n link-app \
-z privatelink.blob.core.windows.net -v vnet-app -e false
az network private-endpoint dns-zone-group create -g rg-pe -n default \
--endpoint-name pe-stcontoso-blob --private-dns-zone privatelink.blob.core.windows.net \
--zone-name blob
az storage account update -g rg-pe -n stcontoso --public-network-access DisabledLab: the app still resolves the public IP
A web app with VNet integration in vnet-spoke2 gets 403 errors from storage after public access was disabled. Step 1: open the app's console and run nslookup; it returns a public address. Step 2: list the zone's virtual network links; only vnet-app is linked, not vnet-spoke2. Step 3: add a link for vnet-spoke2. Step 4: run nslookup again after a minute; it now returns 10.10.3.4 through the privatelink CNAME. Step 5: restart the app if it cached the old answer, then confirm requests succeed. Rollback: remove the new link.
# In the App Service console (Kudu)
nslookup stcontoso.blob.core.windows.net
az network private-dns link vnet list -g rg-pe -z privatelink.blob.core.windows.net -o table
az network private-dns link vnet create -g rg-pe -n link-spoke2 \
-z privatelink.blob.core.windows.net -v /subscriptions/SUB_ID/resourceGroups/rg-spoke2/providers/Microsoft.Network/virtualNetworks/vnet-spoke2 -e falseQuick reference
- First test: nslookup the normal service name from where the app runs
- Public name CNAMEs to NAME.privatelink.SERVICE; the private zone answers with the private IP
- Link the privatelink zone to every VNet whose clients use the endpoint
- Use a DNS zone group so Azure manages the A record
- Custom DNS servers must forward to 168.63.129.16 or an Azure DNS Private Resolver
- App Service needs VNet integration (delegated subnet) to reach private endpoints
- After testing, set public network access to Disabled on the service
Common mistakes
- Creating the private DNS zone but forgetting to link it to the VNet the client uses.
- Adding the private IP to a hosts file on one machine and calling it fixed.
- Pointing the VNet at custom DNS servers that do not forward privatelink zones to Azure DNS.
Quick quiz
Pick an answer to see if you're right and why.
Practice exercises
Try each one yourself first. Use the hint if you get stuck, then compare with the solution.
- Exercise 1easy
Pick any public Azure Storage account name you own and run nslookup on its blob endpoint from your laptop. Note whether a privatelink CNAME appears.
- Exercise 2medium
Create a storage account, a private endpoint for blob, the privatelink zone, a VNet link and a zone group. Prove from a VM that the name resolves to a private IP. Cost: small hourly charges for the endpoint and VM; delete the group afterwards.
- Exercise 3hard
Break and fix: remove the VNet link from the zone, record the symptoms at the DNS and app level, then restore it. Write a three-line runbook entry from what you saw.
Check yourself
Answer in your head, reveal, then be honest with yourself.
Feel confident about this topic?
Frequently asked questions
- Do I need a separate private DNS zone for every storage account?
- No. One privatelink.blob.core.windows.net zone holds A records for all blob private endpoints. Most organisations keep one zone per service type, centrally in the hub.
- Why not just use the private IP address in my connection string?
- TLS certificates are issued for the service name, so connecting by IP fails certificate checks, and the IP can change if the endpoint is recreated. Always use the normal name and fix DNS.
- Does a private endpoint make my service unreachable from the internet?
- Not by itself. The public endpoint stays open until you set public network access to Disabled or restrict the service firewall.
- Can I test private endpoints without paying for a VM?
- Azure Cloud Shell can be deployed into a VNet, or you can use an App Service console with VNet integration. For a free design-only run, draw the DNS chain and write the expected nslookup output for each hop.