Every Thursday I post SC-500 practice questions. Every Saturday I take one exam topic and go deep: the real problem, how it works, the fix, and the exam traps. Week 3: private endpoints vs service endpoints, two features with similar names that solve different problems.
Lab story, lab names only (contoso.com). Screens are drawings, numbers are invented.
The problem: "it's private, we turned on the endpoint"
In this lab story, the storage account stlabhr01 holds HR documents. The network team said it was private: they had turned on a service endpoint for Microsoft.Storage on the subnet snet-lab-app, and set the storage firewall to Selected networks, allowing only that subnet.
Then three things happened in one month:
- The payroll team in the office, connected over VPN, could not open the files. Someone "fixed" it by adding the office's public IP range to the storage firewall.
- A pen tester showed that
stlabhr01.blob.core.windows.netstill resolved to a public IP, and still answered from the internet (with 403, but it answered). - A test VM in
snet-lab-appcopied a file to a storage account in another tenant. The service endpoint carried it happily over the Azure backbone.
None of this was a bug. A service endpoint was simply the wrong tool for what they wanted.
How it works: two different promises
| Service endpoint | Private endpoint | |
|---|---|---|
| What it is | A setting on a subnet | A network interface with a private IP in your VNet |
| The service's address | Still its public endpoint | A private IP from your subnet |
| Who can use it | Only that subnet in Azure | The VNet, peered VNets and on-premises (VPN or ExpressRoute) |
| DNS change needed | No | Yes, a privatelink private DNS zone |
| Can you turn public access off? | No, the public endpoint is what you use | Yes, disable public network access |
| Scope | Every account of that service type | One resource |
| Cost | No extra charge | Billed per hour and per GB |
The key line is the last but two. A service endpoint says "traffic from this subnet to Azure Storage goes over the Azure backbone and shows up with the subnet's private address". It is about the route and source identity, for the whole service. It does not care which storage account, yours or someone else's.
A private endpoint says "this one storage account now lives at 10.20.3.4 inside my network". Traffic to it never needs the public endpoint at all, and other accounts are not reachable through it.
The fix: private endpoint, private DNS, public door closed
1. Create the private endpoint for the blob service
az network private-endpoint create -g rg-lab-hr -n pe-stlabhr01-blob \
--vnet-name vnet-lab-app --subnet snet-lab-pe \
--private-connection-resource-id "$(az storage account show -n stlabhr01 --query id -o tsv)" \
--group-id blob --connection-name stlabhr01-blob
One private endpoint per sub-resource you use: blob, file, queue, table, dfs. The HR app only uses blob.
2. Make the name resolve to the private IP
Create the private DNS zone privatelink.blob.core.windows.net, link it to the VNet, and add a DNS zone group to the private endpoint so the A record is managed for you. For the office over VPN, forward DNS queries for blob.core.windows.net from your on-premises DNS to a resolver in Azure (Azure DNS Private Resolver), or nothing changes for them.
Test from a VM and from the office:
nslookup stlabhr01.blob.core.windows.net
# expected: an alias to stlabhr01.privatelink.blob.core.windows.net, address 10.20.3.4
3. Close the public door
Only after both tests work:
az storage account update -g rg-lab-hr -n stlabhr01 --public-network-access Disabled
Remove the office IP range that was added as a "fix", and remove the subnet rule and the service endpoint if nothing else on that subnet needs it.
4. And the copy to another tenant?
A private endpoint for stlabhr01 does not stop a VM from reaching other storage accounts over the internet. Data exfiltration control is a separate layer:
- If you stay on service endpoints, a service endpoint policy limits the subnet to specific storage accounts.
- In a hub-and-spoke design, send outbound traffic through Azure Firewall and allow only the storage FQDNs you own.
5. Keep it that way
- Azure Policy: built-in definitions audit storage accounts that should use private link and those that should disable public network access. Start in Audit.
- If you need NSG rules or route tables to apply to the private endpoint traffic, turn on network policies for private endpoints on that subnet. They are off by default.
SC-500 exam traps
- "Users on-premises over VPN must reach the storage account privately." Private endpoint. Service endpoints cannot be used for traffic from on-premises.
- "You enabled a service endpoint, and the VM's access to the storage account broke." With a service endpoint, the source IP switches from the VM's public address to its private VNet address, so an IP firewall rule for the old public IP stops matching. Use a virtual network rule instead.
-
"The private endpoint is green, but the app still reaches the public IP." DNS. Without the
privatelinkzone (or your own DNS records), the name still resolves to the public address. - "Stop a subnet from copying data to any storage account except two." Service endpoint policy (or a firewall), not a private endpoint.
- "Can the private endpoint reach the account from a peered VNet in another region?" Yes. Private endpoints work across regionally and globally peered VNets, as long as DNS resolves there too.
Before and after in this lab story
| Before | After | |
|---|---|---|
stlabhr01 resolves to |
Public IP | 10.20.3.4 (private) |
| Public network access | Enabled (selected networks + office IPs) | Disabled |
| Office users over VPN | Only through a public IP rule | Through the private endpoint |
| Copy to other tenants' storage | Allowed over the backbone | Blocked by firewall rules |
Coming next
Next deep dive: Defender for Cloud, Foundational CSPM vs Defender CSPM, and what the free tier never shows you. On Thursday: SC-500 practice questions, as usual.
Sources
- Virtual network service endpoints
- What is a private endpoint?
- Use private endpoints for Azure Storage
- Azure private endpoint DNS configuration
- Virtual network service endpoint policies for Azure Storage
- Manage network policies for private endpoints
Thanks for reading! I'm Cuong, and on CD Security Lab I rebuild real Microsoft security cases in a safe lab and explain them simply. Follow along:
- ▶️ YouTube (daily Shorts + explainers): CD Security Lab
- 💼 LinkedIn: Cuong Do
- 📘 Facebook: CD Security Lab
- 📸 Instagram: @cdsecuritylab
- 📝 More posts like this: Dev.to
Got a question about your own tenant? Drop it in the comments.




Top comments (0)