Your profile

One profile for every MSDEVBUILD site. Only you can see it, and the site owner if you write in.

Lesson 37 of 47
❮Prev Next❯

Service Endpoints vs Private Endpoints for PaaS

Module 4: Networking ⏱ 12 min read Updated

Your note

My notes for this lesson

Select any text in the lesson to highlight it or add a note. Saved in this browser.

    No highlights yet. Select a sentence in the lesson, then pick a colour or add a note.

    All my bookmarks and notes

    Reading settings

    For every lesson, saved in this browser.

    Text size
    Line spacing
    Font

    With IaaS you rent the virtual machine. Microsoft looks after the building, power and hardware; you patch the operating system.

    30-second answer

    A service endpoint is switched on per subnet (for example Microsoft.Storage). Traffic from that subnet reaches the service's public IP over the Microsoft backbone with the subnet as its identity, so the service firewall can allow just that subnet. It's free, but the service keeps a public endpoint and on-premises can't use it. A private endpoint is a NIC with a private IP in your subnet that maps to one resource and sub-resource (such as the blob service of one storage account) through Azure Private Link. It works from peered VNets and on-premises, lets you disable public access, and needs a privatelink private DNS zone (privatelink.blob.core.windows.net) linked to the VNet.

    Simulate it » No Azure account needed

    Exam objective: 4.2.4 Configure service endpoints for Azure platform as a service (PaaS). 4.2.5 Configure private endpoints for Azure PaaS. (Skills measured as of April 17, 2026)

    Simulations

    Feel it before you read it. No account needed, nothing leaves this page.

    Azure portal: Service endpoint vs private endpoint for a storage account Add a service endpoint, then a private endpoint with private DNS.
    </> Embed

    Embed this simulation

    Free for trainers, teachers and bloggers. Paste this into your page:

    Loading the portal…

    <strong>Service endpoint</strong>: in <strong>Networking</strong>, allow only selected networks and add <strong>vnet-paas/snet-app</strong>. The portal turns on the Microsoft.Storage endpoint on that subnet. The account keeps its public IP; traffic from the subnet just travels the Microsoft backbone.

    👆 Click the glowing item in the portal to continue

    Read the steps as text
    1. Service endpoint: in Networking, allow only selected networks and add vnet-paas/snet-app. The portal turns on the Microsoft.Storage endpoint on that subnet. The account keeps its public IP; traffic from the subnet just travels the Microsoft backbone.
    2. Private endpoint: switch to the Private endpoint connections tab and select + Private endpoint.
    3. Pick the target sub-resource. A blob endpoint doesn't cover Azure Files.
    4. The endpoint is a NIC in snet-pe with a private IP, for example 10.30.2.4.
    5. Keep Integrate with private DNS zone: Yes. Without it the name still resolves to the public IP and the endpoint goes unused.
    6. The zone is linked to vnet-paas and holds the A record. Now set Public network access: Disabled and only the private path works.

    🧪 Simulation for learning. Screens are simplified versions of the Azure portal; names, prices and IDs are examples. Nothing here touches real Azure.

    😟 THE PROBLEM

    The storage account is reachable from the whole internet just so one app subnet can use it.

    😊 THE SOLUTION

    Lock the account to the subnet with a service endpoint, or give it a private IP with a private endpoint.

    • Open public endpoint✓ Firewall allows only your subnet
    • On-premises needs access too✓ Private endpoint over VPN
    • Name still resolves public✓ privatelink private DNS zone
    🛠️ Solved with: Service and private endpoints

    Start with a question

    Is a staff-only lane at the airport the same as having your own gate inside the building?

    A staff lane still leads to the public terminal, but only people with a staff badge get through it. Your own gate is a door inside your office that opens straight onto the plane.

    A service endpoint is the staff lane: your subnet reaches the storage account’s public address, and the account’s firewall lets in only your subnet. A private endpoint is your own gate: the account gets a private address inside your network, so you can close the public terminal completely.

    Explain it like I’m 10

    The technical explanation

    Service endpoints

    Enable a service endpoint on a subnet for a service such as Microsoft.Storage, Microsoft.Sql, Microsoft.KeyVault or Microsoft.Web. Then:

    • Traffic from the subnet to that service takes the Microsoft backbone, and Azure adds a route with next hop VirtualNetworkServiceEndpoint.
    • The service sees the traffic coming from your subnet (private source IP), so you add a virtual network rule in its firewall and set the default action to deny.
    • The service’s endpoint is still public, and on-premises traffic can’t use the endpoint.
    • It’s free. A service endpoint policy can limit Microsoft.Storage to named storage accounts.
    az network vnet subnet update -g rg-net-paas --vnet-name vnet-paas -n snet-app --service-endpoints Microsoft.Storage
    az storage account network-rule add -g rg-net-paas --account-name stfabrikampaas01 --vnet-name vnet-paas --subnet snet-app
    az storage account update -g rg-net-paas -n stfabrikampaas01 --default-action Deny

    Portal: storage account → Networking → Firewalls and virtual networks → Enabled from selected virtual networks and IP addresses → + Add existing virtual network. The portal enables the endpoint on the subnet for you.

    Private endpoints

    A private endpoint is a NIC in your subnet with a private IP (for example 10.30.2.4) that connects through Azure Private Link to one resource and one target sub-resource (blob, file, queue, table, dfs, web for storage; sqlServer for SQL; vault for Key Vault). Then:

    • Clients in the VNet, peered VNets and on-premises (over VPN or ExpressRoute) reach the resource on that private IP.
    • You can set the resource’s public network access to Disabled.
    • Cost is about $0.01 an hour per endpoint plus per GB processed (illustrative).

    DNS makes or breaks it

    When a private endpoint exists, public DNS answers stfabrikampaas01.blob.core.windows.net with a CNAME to stfabrikampaas01.privatelink.blob.core.windows.net. If your VNet has a private DNS zone privatelink.blob.core.windows.net linked to it, with an A record for the account, the name resolves to the private IP. Without that zone or link, it resolves to the public IP, and if public access is off, connections fail.

    The portal’s Integrate with private DNS zone: Yes creates the zone, the VNet link and a DNS zone group that keeps the A record updated.

    az network private-endpoint create -g rg-net-paas -n pe-stfabrikam-blob --vnet-name vnet-paas --subnet snet-pe \
      --private-connection-resource-id <storage-account-id> --group-id blob --connection-name stfabrikam-blob
    az network private-dns zone create -g rg-net-paas -n privatelink.blob.core.windows.net
    az network private-dns link vnet create -g rg-net-paas -n link-vnet-paas \
      --zone-name privatelink.blob.core.windows.net --virtual-network vnet-paas --registration-enabled false
    az network private-endpoint dns-zone-group create -g rg-net-paas --endpoint-name pe-stfabrikam-blob \
      -n default --private-dns-zone privatelink.blob.core.windows.net --zone-name blob
    nslookup stfabrikampaas01.blob.core.windows.net

    Side by side

    Service endpointPrivate endpoint
    Service addressPublicPrivate IP in your subnet
    Works from on-premisesNoYes
    ScopeWhole service (policy can narrow storage)One resource and sub-resource
    DNS changeNoneprivatelink zone
    Disable public accessNoYes
    CostFreePer hour + per GB
    Architect level Network policies for private endpoints

    By default, NSGs and UDRs on a subnet don’t apply to private endpoints in it. You can turn on private endpoint network policies on the subnet (--private-endpoint-network-policies Enabled), after which NSG rules and route tables affect traffic to the endpoints. That’s how you force private endpoint traffic through a firewall.

    Real-world business scenario

    E-commerce

    Tailwind Traders (fictional)

    The problem
    Order exports sat in a storage account open to the internet so both the Azure app and the on-premises ERP could reach it. A misconfigured SAS token was found on a public forum.
    What they used
    A blob private endpoint in the hub, the privatelink.blob.core.windows.net zone linked to the hub and spokes, on-premises DNS forwarding to Azure DNS Private Resolver, and public network access set to Disabled on the account.
    Why that choice
    Both the app and the ERP reach the account on a private IP over peering and ExpressRoute, and nothing on the internet can reach it, token or not.
    The result
    The account disappeared from the internet, and the leaked token was useless from outside the network.

    When to use it and when not to

    ✓ Use it when…

    • Service endpoints for a quick, free lock-down of PaaS to specific Azure subnets.
    • Private endpoints when on-premises or peered networks need private access.
    • Private endpoints when public network access must be disabled completely.

    ✕ Think twice when…

    • Private endpoints without a plan for DNS.
    • Service endpoints when traffic comes from on-premises.
    • Assuming one private endpoint covers every sub-resource of a storage account.

    ↔ Alternatives to consider

    • Storage firewall IP rules for a few known public client IPs.
    • Azure DNS Private Resolver so on-premises DNS can resolve privatelink zones.
    • Service endpoint policies to stop data going to storage accounts you don't own.
    Ready for more?The full lesson adds the technical explanation, when to use it, interview questions and revision notes.

    Test yourself with exercises

    5 original practice questions in the AZ-104 style. Pick your answers, then check them. You will see why each option is right or wrong. Score 75% or more and this topic is marked complete.

    Question 1

    Question 1 of 5

    On-premises servers connect to Azure through ExpressRoute private peering. The servers must access a storage account without using the public internet, and public network access to the account must be disabled. What should you configure?

    Question 2

    Question 2 of 5

    You create a private endpoint for the blob service of a storage account. VMs in the virtual network still resolve the account name to a public IP address. What should you do?

    Question 3

    Question 3 of 5

    Only VMs in Subnet1 must be able to access a storage account. Access from on-premises is not required. You want a solution that has no additional cost. What should you configure?

    Question 4

    Question 4 of 5

    You enable a Microsoft.Storage service endpoint on Subnet1. Which next hop type appears in the effective routes of a VM in Subnet1 for the storage address prefixes?

    Question 5

    Question 5 of 5 · Select 2

    Which two statements about private endpoints are true? Each correct answer presents a complete solution.

    Interview preparation

    Say your answer out loud first, then open the model answer. Interviewers care more about your reasoning than the exact words.

    Beginner What's the main difference between a service endpoint and a private endpoint?

    Model answer

    With a service endpoint the storage account still has its public IP; my subnet just reaches it over Microsoft's network and the account's firewall can allow my subnet. With a private endpoint the storage account gets a private IP inside my VNet, so traffic never goes to a public address and I can turn public access off.

    Intermediate You created a private endpoint but the app still connects to the public IP. Why?

    Model answer

    DNS. The storage name has to resolve to the private IP, which needs the privatelink.blob.core.windows.net private DNS zone with an A record for the account, linked to the VNet the app runs in. Usually you let the portal integrate the zone, or add a DNS zone group to the endpoint.

    Experienced developer On-premises servers must reach a storage account over ExpressRoute without the internet. Which option and what else is needed?

    Model answer

    A private endpoint, because service endpoints only work from Azure subnets. On-premises DNS must resolve the account name to the private IP, typically by forwarding the zone to Azure DNS Private Resolver in the hub, which uses the linked privatelink zone.

    Scenario Security wants the app subnet to reach only the company's storage accounts, not any storage account in Azure. What can you do?

    Model answer

    With service endpoints, add a service endpoint policy on the subnet that lists the allowed accounts. With private endpoints it's naturally scoped, because each endpoint maps to one specific account, and I can block outbound to the Storage service tag in the NSG.

    Quick revision

    Key points

    • Service endpoint - per subnet, free, service keeps its public IP, firewall allows the subnet.
    • Service endpoints don't work from on-premises.
    • Private endpoint - private IP NIC for one resource + sub-resource, through Private Link.
    • Private endpoints work from peered VNets and on-premises, and allow public access to be disabled.
    • Private endpoints need a privatelink private DNS zone linked to the VNet.

    Important terminology

    Service endpoint
    A subnet setting that sends traffic for an Azure service over the Microsoft backbone and identifies the subnet to the service's firewall.
    Virtual network rule
    A storage account (or SQL, Key Vault…) firewall entry that allows traffic from a specific subnet with a service endpoint.
    Service endpoint policy
    A policy on a subnet that limits a Microsoft.Storage service endpoint to specific storage accounts, to reduce data exfiltration.
    Private endpoint
    A network interface with a private IP in your VNet that connects privately to one Azure resource through Private Link.
    Target sub-resource
    The part of a service a private endpoint maps to, such as blob, file, queue, table, dfs or web for a storage account.
    privatelink DNS zone
    A private DNS zone such as privatelink.blob.core.windows.net that resolves the resource's name to the private endpoint's IP.

    Common mistakes

    • Creating a private endpoint without private DNS, so names still resolve publicly.
    • Expecting a blob private endpoint to cover Azure Files too.
    • Choosing a service endpoint when on-premises clients need access.

    Exam tips

    • "From on-premises without the internet" = private endpoint.
    • "Allow only Subnet1 through the storage firewall" = service endpoint + virtual network rule.
    • "Resolves to a public IP after creating a private endpoint" = fix the private DNS zone / VNet link.

    Five quick revision questions

    1. 1.Where do you enable a service endpoint?Show

      On the subnet.

    2. 2.What does a private endpoint create in your subnet?Show

      A network interface with a private IP.

    3. 3.Which DNS zone does a blob private endpoint use?Show

      privatelink.blob.core.windows.net.

    4. 4.Do service endpoints cost extra?Show

      No, they're free.

    5. 5.Can a private endpoint be used from a peered VNet?Show

      Yes, if that VNet resolves the privatelink zone.

    Official references

    Finished this lesson? Tick it off. Your progress is saved in this browser.

    Next up: Azure DNS: Public and Private Zones and Records

    Studying with a friend? Send them this lesson

    It's free and needs no sign-up. Their progress saves in their own browser.

    Lesson done? Make it stick with a quick gameSort It, Match the Pairs, Lightning Round and Who Am I? Earn XP and badges. Play ❯

    Install MSDEVBUILD Azure

    Free · no account · works offline

    Save the whole course for offline ›

    Hi, I’m your Nimbus

    Your study buddy. Pick what we do next.

    MSDEVBUILD · Multi-Stack Dev Build

    Sign in to MSDEVBUILD

    One account for Azure certifications and the blog: sign in here and you are signed in on both. Your XP, streak, practice deck and certificate stay in sync on every device. Optional: everything works without an account.