Storage networking: firewall, service endpoints, private endpoints
-
Phase 0: Before you start
-
Phase 1: The foundation
-
Phase 2: Day-to-day operations
-
Phase 3: Enterprise architecture
-
Phase 4: Troubleshooting step by step
-
Phase 5: Final project and career
An Azure private endpoint gives a storage account a private IP address inside your VNet, so your servers can reach it without going anywhere near the internet. Along with the storage firewall and service endpoints, it decides who can reach your data over the network.
A lot of “403” and “it worked yesterday” tickets start here, and most of them have nothing to do with permissions. They’re network rules, or DNS pointing at the wrong address.
In the lab you’ll lock the course storage account down in three stages, and then break DNS the way it breaks in real companies and fix it.
| Time | You need | Cost | By the end you can |
|---|---|---|---|
| About 60 minutes | The storage account from Lesson 21, web01 and vnet-saat, the CLI | About 2 US cents: a private endpoint and a private DNS zone for an hour, web01 on free hours | Use the storage firewall, service endpoints and private endpoints, and troubleshoot private endpoint DNS |
What it is, in one line
A private endpoint is a network card in your subnet with a private IP, and it leads straight to one Azure service.
In Simple Words
Three ways to guard a school library
The firewall is a guard at the front door holding a list that says “only children from these classes, plus this one visitor”, but the door still opens onto the main road. A service endpoint is a covered walkway from your classroom straight to that front door, so your class no longer walks along the road, though the library still has its public door.
A private endpoint builds a brand-new door into the library from inside your own corridor, with its own room number, and then you can brick up the front door completely. The catch is that everyone has to know the new room number, because if the school map still shows the old door they’ll walk into a wall.
Engineer's View
Firewall, service endpoints and private endpoints
- Storage firewall:
--default-action Denyalong with allow rules for public IPs or ranges (your office) and for VNet subnets. IP rules don’t apply to requests coming from the same Azure region, so use VNet rules for those. You can also allow trusted Microsoft services as an exception. - Service endpoint (
Microsoft.Storageon a subnet): traffic from that subnet goes to the storage account’s public address over the Azure backbone with the VM’s private IP as the source, so a VNet rule can let it in. It’s free, but the account keeps its public endpoint. - Private endpoint: a NIC in your subnet with a private IP, mapped to one sub-service (blob, file, queue, table, dfs, web). You pay per hour and per GB, and it can be reached from peered VNets and from on-premises over VPN or ExpressRoute. Once it’s in place you can set
--public-network-access Disabled. - DNS makes or breaks it: the public name
<account>.blob.core.windows.netis a CNAME to<account>.privatelink.blob.core.windows.net. A private DNS zoneprivatelink.blob.core.windows.net, linked to the VNet, answers that with the private IP. Without the link or the record, clients get the public IP and are refused. - The control plane isn’t affected: you can still create, change and delete the account through Azure Resource Manager from anywhere. Only data access gets filtered.
How it works, step by step
Here’s what happens when web01 reads a blob once the private endpoint is in place:
- web01 asks Azure DNS for
stsaat48213.blob.core.windows.net. - Public DNS answers with a CNAME to
stsaat48213.privatelink.blob.core.windows.net. - Because
privatelink.blob.core.windows.netis linked to vnet-saat, Azure DNS answers that name from the private zone: 10.30.3.4. - web01 connects to 10.30.3.4 on 443, and the private endpoint carries the traffic to the storage account over Microsoft’s network.
- Storage checks authentication and permissions as it normally would, and public network access can be switched off completely.
Anyone outside the VNet, your laptop for example, gets the same CNAME but resolves it through public DNS to the public IP, and with public access disabled that request gets refused.
So for any storage 403, the first two things to ask are which IP the client is resolving and which network rule is supposed to let that IP in.
Hands-on lab: Azure private endpoint for blob storage
Before you run any command, double-check it
Read every command twice before you press Enter. Check the target: the system or account, the IDs, the names and the sizes. These commands are for learning and were tested in our lab, not on your system. At work, run the read-only list commands first, follow your change process, make sure a backup exists, and ask a second person to check anything that changes or deletes data. You run them at your own risk.
Load the names you’ll need and start web01:
$st = (Get-Content C:\azure-lab\storage.txt)
$v = Get-Content C:\azure-lab\vnet-saat.json | ConvertFrom-Json
$id = az storage account show --resource-group rg-saat-data --name $st --query id -o tsv
az vm start --resource-group rg-saat-vms --name web011Baseline: what web01 sees today
Ask web01 to resolve the blob endpoint and send an anonymous request:
az vm run-command invoke --resource-group rg-saat-vms --name web01 --command-id RunShellScript --scripts "getent hosts $st.blob.core.windows.net; curl -sS https://$st.blob.core.windows.net/lab/hello.txt | grep -o '<Code>[A-Za-z]*</Code>'" --query "value[0].message" -o tsvYou should see something like this:
[stdout]
20.60.x.x blob.pnq21prdstr05a.store.core.windows.net stsaat48213.blob.core.windows.net
<Code>PublicAccessNotPermitted</Code>You get a public IP and an answer from storage itself, meaning the network let the request through and the account turned down anonymous access. That second line is how this lab tells “network OK” apart from “network blocked” without using any keys.
2Turn on the firewall with a service endpoint
Add your laptop’s public IP first so you don’t lock yourself out, then allow snet-web and deny everything else:
$ip = Invoke-RestMethod -Uri https://api.ipify.org
az network vnet subnet update --ids $v.'snet-web' --service-endpoints Microsoft.Storage -o none
az storage account network-rule add --resource-group rg-saat-data --account-name $st --ip-address $ip -o none
az storage account network-rule add --resource-group rg-saat-data --account-name $st --subnet $v.'snet-web' -o none
az storage account update --resource-group rg-saat-data --name $st --default-action Deny -o none
az storage account show --resource-group rg-saat-data --name $st --query "{default:networkRuleSet.defaultAction, ips:length(networkRuleSet.ipRules), subnets:length(networkRuleSet.virtualNetworkRules)}" -o table
az vm run-command invoke --resource-group rg-saat-vms --name web01 --command-id RunShellScript --scripts "getent hosts $st.blob.core.windows.net; curl -sS https://$st.blob.core.windows.net/lab/hello.txt | grep -o '<Code>[A-Za-z]*</Code>'" --query "value[0].message" -o tsvYou should see something like this:
Default Ips Subnets
--------- ----- ---------
Deny 1 1
[stdout]
20.60.x.x blob.pnq21prdstr05a.store.core.windows.net stsaat48213.blob.core.windows.net
<Code>PublicAccessNotPermitted</Code>web01 still gets through, because the VNet rule matches its subnet via the service endpoint. The IP rule is for your laptop and would do nothing for web01, since IP rules ignore traffic from the same region.
3Create a private endpoint for blob
Put it in snet-data and give it a private DNS zone that’s linked to vnet-saat:
$vnetId = az network vnet show --resource-group rg-saat-core --name vnet-saat --query id -o tsv
az network private-endpoint create --resource-group rg-saat-data --name pe-saat-blob --location centralindia --subnet $v.'snet-data' --private-connection-resource-id $id --group-id blob --connection-name pec-saat-blob --tags course=saatvedha-azure lesson=26 -o none
az network private-dns zone create --resource-group rg-saat-data --name privatelink.blob.core.windows.net --tags course=saatvedha-azure lesson=26 -o none
az network private-dns link vnet create --resource-group rg-saat-data --zone-name privatelink.blob.core.windows.net --name link-vnet-saat --virtual-network $vnetId --registration-enabled false -o none
az network private-endpoint dns-zone-group create --resource-group rg-saat-data --endpoint-name pe-saat-blob --name default --private-dns-zone privatelink.blob.core.windows.net --zone-name blob -o none
az network private-dns record-set a list --resource-group rg-saat-data --zone-name privatelink.blob.core.windows.net --query "[].{name:name, ip:aRecords[0].ipv4Address, ttl:ttl}" -o tableYou should see something like this:
Name Ip Ttl
----------- --------- -----
stsaat48213 10.30.3.4 10The zone group created the A record for you and will remove it if the endpoint is ever deleted. 10.30.3.4 is the first usable address in snet-data.
4Switch off public access and test again
Run this:
az storage account update --resource-group rg-saat-data --name $st --public-network-access Disabled -o none
az vm run-command invoke --resource-group rg-saat-vms --name web01 --command-id RunShellScript --scripts "getent hosts $st.blob.core.windows.net; curl -sS https://$st.blob.core.windows.net/lab/hello.txt | grep -o '<Code>[A-Za-z]*</Code>'" --query "value[0].message" -o tsvYou should see something like this:
[stdout]
10.30.3.4 stsaat48213.privatelink.blob.core.windows.net stsaat48213.blob.core.windows.net
<Code>PublicAccessNotPermitted</Code>The same name now gives a private IP and storage still answers. The account has no public door left at all, and only the private endpoint can reach it.

✅ Checkpoint: web01 resolves the account to 10.30.3.4 and reaches it, and public network access is Disabled.
Break It, Then Fix It
These two are the most common storage network tickets you’ll ever see.
1Break it: the VNet link goes missing
Delete the DNS zone’s link to vnet-saat, which is exactly what happens when someone “tidies up” DNS, and then test from web01:
az network private-dns link vnet delete --resource-group rg-saat-data --zone-name privatelink.blob.core.windows.net --name link-vnet-saat --yes
Start-Sleep -Seconds 60
az vm run-command invoke --resource-group rg-saat-vms --name web01 --command-id RunShellScript --scripts "getent hosts $st.blob.core.windows.net; curl -sS https://$st.blob.core.windows.net/lab/hello.txt | grep -o '<Code>[A-Za-z]*</Code>'" --query "value[0].message" -o tsvYou’ll see something like this:
[stdout]
20.60.x.x blob.pnq21prdstr05a.store.core.windows.net stsaat48213.blob.core.windows.net
<Code>AuthorizationFailure</Code>The private endpoint is fine and the A record is still sitting in the zone, but vnet-saat no longer uses that zone. So web01 resolves the public IP, finds the public door shut, and gets 403 AuthorizationFailure, “This request is not authorized to perform this operation.” Apps report this as a permission error, which sends people off checking roles when the problem is DNS.
Fix it: link the zone again, and check the IP first:
az network private-dns link vnet create --resource-group rg-saat-data --zone-name privatelink.blob.core.windows.net --name link-vnet-saat --virtual-network $vnetId --registration-enabled false -o none
Start-Sleep -Seconds 60
az vm run-command invoke --resource-group rg-saat-vms --name web01 --command-id RunShellScript --scripts "getent hosts $st.blob.core.windows.net; curl -sS https://$st.blob.core.windows.net/lab/hello.txt | grep -o '<Code>[A-Za-z]*</Code>'" --query "value[0].message" -o tsvYou should see something like this:
[stdout]
10.30.3.4 stsaat48213.privatelink.blob.core.windows.net stsaat48213.blob.core.windows.net
<Code>PublicAccessNotPermitted</Code>2Break it: “the CLI stopped working on my laptop”
List blobs from your laptop the same way you did in Lesson 21:
az storage blob list --account-name $st --container-name lab --auth-mode login -o tableYou’ll get this error:
The request may be blocked by network rules of storage account. Please check network rule set using 'az storage account show -n accountname --query networkRuleSet'.
If you want to change the default action to apply when no rule matches, please use 'az storage account update'.Your Entra ID role is fine; it’s the network that isn’t. Public access is Disabled, so the IP rule you added in step 2 no longer counts. In a company, admins reach data like this over a VPN, from a jump box inside the VNet, or through Bastion.
Fix it for the lab: put the account back to the open default so later lessons work from your laptop, and remove the private endpoint pieces:
az storage account update --resource-group rg-saat-data --name $st --public-network-access Enabled --default-action Allow -o none
az storage account network-rule remove --resource-group rg-saat-data --account-name $st --ip-address $ip -o none
az storage account network-rule remove --resource-group rg-saat-data --account-name $st --subnet $v.'snet-web' -o none
az network private-endpoint delete --resource-group rg-saat-data --name pe-saat-blob
az network private-dns link vnet delete --resource-group rg-saat-data --zone-name privatelink.blob.core.windows.net --name link-vnet-saat --yes
az network private-dns zone delete --resource-group rg-saat-data --name privatelink.blob.core.windows.net --yes
az vm deallocate --resource-group rg-saat-vms --name web01
az storage blob list --account-name $st --container-name lab --auth-mode login --query "[].name" -o tsv
C:\azure-lab\Find-LabResources.ps1 -Lesson 26You should see this:
hello.txt
Nothing tagged course=saatvedha-azure is left.
✅ Checkpoint: You fixed a private endpoint DNS failure and a laptop blocked by network rules. The account is open again for the next lessons, and web01 is deallocated.
Leave the Microsoft.Storage service endpoint on snet-web. It costs nothing, and you’ll use it again in Lesson 64.
This happened at work
The backup that failed every night after a “security fix”
A bank’s security team switched off public access on 40 storage accounts and created private endpoints for each of them. They tested the change from the main VNet and everything worked, but the next morning every nightly backup from the DR region had failed with HTTP 403.
The DR VNet was peered with the main VNet, so the private endpoints themselves were reachable. The problem was that the privatelink.blob.core.windows.net zone had only been linked to the main VNet, so the backup servers in DR resolved the public IPs and walked straight into the closed door.
What they changed: the private DNS zones moved to a central hub subscription, and Azure Policy now links them to every VNet as soon as it’s created. On-premises DNS forwards privatelink names to an Azure DNS Private Resolver, and the change checklist has a new line, “resolve the name from every client network”, that has to be done before anyone turns public access off.
Common mistakes and troubleshooting
| Mistake | What you see | What to do |
|---|---|---|
| Private DNS zone not linked to the client VNet | 403 AuthorizationFailure; public IP resolved | Link the privatelink zone to every VNet that has clients. |
| Endpoint created without a DNS zone group | Name never resolves privately | Add a zone group, or create the A record yourself. |
| IP rule for an Azure VM in the same region | VM still blocked | Use a VNet rule with a service endpoint instead. |
| Disabling public access before testing all clients | Backups and apps fail overnight | Resolve and test from every network before you switch it off. |
| On-premises DNS not forwarding privatelink names | Office users get the public IP | Forward them to Azure DNS Private Resolver. |
| Endpoint for blob only, app uses dfs or file | Some calls fail | Create one endpoint for each sub-service the app uses. |
| Assuming 403 means RBAC | Hours spent on roles | Check the resolved IP and the network rules first. |
Interview questions
Click a question to open it. Each one is phrased the way an interviewer would ask it, and underneath you’ll find why they ask it and one way you could answer in your own words.
Fresher level
1. What is a private endpoint?
Why they ask this: It’s the basic definition.
How you might answer: It’s a network interface with a private IP in my subnet that connects to one Azure service resource, like the blob service of a storage account, over Microsoft’s network instead of through a public address.
2. What is the difference between a service endpoint and a private endpoint?
Why they ask this: It’s the classic comparison.
How you might answer: A service endpoint lets a subnet reach the service’s public address over the Azure backbone, and the storage firewall can allow that subnet in. A private endpoint gives the service its own private IP inside the VNet, which peered and on-premises networks can reach, and it lets you turn the public endpoint off.
3. What does the storage firewall do?
Why they ask this: It’s a basic configuration check.
How you might answer: It sets a default action, usually Deny, and then allows listed public IPs, VNet subnets with service endpoints, private endpoints, and trusted Microsoft services if you choose. It only filters data access, not management through Azure Resource Manager.
2–5 years experience
4. An app gets 403 from storage after private endpoints were added. How do you troubleshoot?
Why they ask this: It’s the classic question for Phase 4.
How you might answer: I’d start on the app’s server, resolve the storage name and check that it comes back with the private endpoint IP. If I get a public IP instead, either the privatelink zone isn’t linked to that VNet or on-premises DNS isn’t forwarding. After that I’d look at the account’s network rules, and only then at RBAC or SAS.
5. Why don’t IP rules work for a VM in the same region?
Why they ask this: They want the detail that catches people out.
How you might answer: Traffic from Azure in the same region doesn’t come from the VM’s public IP, so the storage firewall ignores IP rules for it. You’d let it in with a VNet rule and a service endpoint, or with a private endpoint.
6. How do on-premises users reach a storage account that only has a private endpoint?
Why they ask this: They want to see you understand hybrid DNS.
How you might answer: They come in over VPN or ExpressRoute to the VNet, and on-premises DNS forwards the privatelink zones to Azure DNS Private Resolver or a DNS server in Azure. Users keep using the normal blob.core.windows.net name, and DNS hands back the private IP.
Senior level
7. How would you design private endpoint DNS for a large hub-and-spoke network?
Why they ask this: They’re after an enterprise pattern.
How you might answer: I’d keep the privatelink zones centrally in the hub and link them to every spoke, with Azure Policy creating the DNS zone group whenever someone makes a private endpoint. A Private Resolver in the hub handles forwarding from on-premises, and teams aren’t allowed to create their own privatelink zones, so we never get split answers.
8. What are the cost and limit trade-offs of private endpoints?
Why they ask this: They want to see practical sense.
How you might answer: Every endpoint is charged per hour and per GB processed, and you need one per sub-service per account, so with hundreds of accounts it adds up fast. I’d use them for sensitive data and use service endpoints with the firewall for the less sensitive cases.
9. How do you roll out “public access disabled” across many storage accounts safely?
Why they ask this: They want to hear about change management.
How you might answer: First I’d find out from the logs who connects to each account, then create the endpoints and DNS, and test resolution and access from every client network. Next I’d switch the firewall to Deny with logging and watch for failures, and only after that disable public access. An Azure Policy keeps new accounts in line.
Quick quiz
Q1. Which feature gives a storage account a private IP in your VNet?
- Service endpoint
- Private endpoint
- IP rule
- SAS token
Show answer
B — A private endpoint is a NIC with a private IP.
Q2. Which DNS zone does a blob private endpoint use?
- blob.core.windows.net
- privatelink.blob.core.windows.net
- saat.internal
- core.windows.net
Show answer
B — privatelink.blob.core.windows.net holds the private A records.
Q3. A VM in the same region is blocked despite an IP rule for its public IP. Why?
- Wrong tier
- IP rules ignore same-region traffic
- SAS expired
- Soft delete is on
Show answer
B — Use a VNet rule or a private endpoint.
Q4. After the zone’s VNet link is deleted, clients get:
- The private IP
- The public IP and a 403
- A new SAS
- A 404 always
Show answer
B — They resolve publicly and hit the closed public door.
Q5. Does the storage firewall block az storage account update?
- Yes
- No, management goes through Resource Manager
- Only from laptops
- Only on GRS
Show answer
B — The firewall filters data access only.
Quick recap
You can now lock down storage networking, and sort it out when it causes trouble.
- Firewall: default Deny plus IP and VNet rules.
- Service endpoints let a subnet through the firewall, but the public door stays open.
- Private endpoints give you a private IP and let you shut the public door.
- DNS has to return the private IP from every client network.
- For any storage 403, check the resolved IP first, then network rules, and permissions last.
Next lesson
Lesson 27: Azure Bastion: no more public RDP and SSH → Next you’ll connect to web01 and win01 through Bastion, with no public IPs and no open ports.
Further reading: Azure private endpoint
Want to go deeper into Azure private endpoint? See Microsoft’s Use private endpoints for Azure Storage and Azure private endpoint DNS configuration. You can also see the full plan for this course on the Azure Cloud Administration course page.
