Service & Private Endpoints
Service endpoints · private endpoints · connection states · private DNS zones · CLI and PowerShell
By the tools4free.dev team · Last reviewed November 13, 2026
Practice questions for this topic →
Service endpoint or private endpoint
| Service endpoint | Private endpoint | |
|---|---|---|
| What it is | Extends the vnet identity to an Azure service over the Azure backbone. Enabled per subnet | A NIC in your subnet with a private IP that connects to a Private Link resource |
| Service IP | The service's DNS name still resolves to its public IP | A private IP in your vnet |
| DNS | No change | Needs DNS: a private DNS zone, custom DNS or Private Resolver |
| From on-premises | Not usable | Reachable over VPN or ExpressRoute, and from peered vnets |
| Scope | Per subnet and per service | One endpoint per sub-resource |
Microsoft recommends Private Link and private endpoints for secure private access to PaaS services.
Service endpoints
- Two steps. (1) Turn on the service endpoint on the subnet (for example
Microsoft.Storage). (2) Add the virtual network rule on the service side (for example storage firewall default action Deny plus a network rule for the subnet). Doing only step 1 doesn't restrict access. - Traffic source changes from the VM's public IP to the vnet private IP. A service firewall rule that used the VM's public IP stops working after you enable the endpoint.
- Service endpoints have no extra charge.
- Enabling or disabling an endpoint closes existing TCP connections to that service.
- GA services include Storage (
Microsoft.Storage), SQL Database and Synapse dedicated SQL pools (Microsoft.Sql), Cosmos DB, Key Vault, Service Bus, Event Hubs, App Service (Microsoft.Web), Cognitive Services and Container Registry. - Limits: ARM vnets only. Not usable for on-premises traffic: allow the on-premises or ExpressRoute NAT public IPs in the service's IP firewall instead. SQL endpoints apply only within the vnet's region.
- Endpoint routes use next hop type VirtualNetworkServiceEndpoint on that subnet only. They are longer prefixes than 0.0.0.0/0 and override BGP and UDRs for that service's prefixes. A route table can't override them.
- Permissions: write access on the vnet to configure endpoints. To secure a service to the subnet you need
Microsoft.Network/virtualNetworks/subnets/joinViaServiceEndpoint/actionon the subnet. - Service endpoints don't change VM disk traffic. In multi-subnet or peered setups, enable endpoints on each subnet.
- To limit NSG outbound to a service, use service tags (for example Storage). Service endpoint policies filter to specific resources.
Private endpoints
- A read-only NIC is created automatically. Its IP stays the same for the endpoint's lifetime.
- The endpoint must be in the same region and subscription as its vnet. The target resource can be in a different region.
- Connections are one-way, started by the consumer.
- You need one private endpoint per sub-resource. Storage group IDs include blob, file, table, queue, dfs and web. SQL uses
sqlServer, Key Vault usesvaultand a web app usessites. Private endpoints on Storage need a general-purpose v2 account. - A private endpoint does not disable public access by itself. Restrict public network access on the service.
- Network policies on the endpoint subnet turn on NSG, UDR and ASG support for the endpoint.
- A static private IP is possible with the IP configuration, but not for AKS, Application Gateway, HDInsight, Recovery Services vaults or third-party Private Link services.
- Both subscriptions need the
Microsoft.Networkresource provider registered. - A load balancer backend pool can't consist of a private endpoint.
| Connection state | Meaning |
|---|---|
| Approved | The only state that can send traffic |
| Pending | Waiting for the resource owner to approve |
| Rejected | The owner rejected it |
| Disconnected | The owner removed it: delete the endpoint |
Auto-approval happens when you have the privateEndpointConnectionsApproval/action permission on the resource. Otherwise use manual approval: the owner approves, rejects or deletes the connection on the target resource.
Private DNS for private endpoints
- Public DNS has a CNAME from the service name to a
privatelinkzone name. Your private DNS zone must resolve that name to the endpoint IP. Applications keep using the same FQDN. - Link the zone to every vnet that needs to resolve it. Use the recommended zone names so DNS configures automatically.
- Don't put records for several services in one zone. Reusing a zone for two endpoints of different services deletes the first A record.
- A private zone such as
privatelink.blob.core.windows.netanswers NXDOMAIN for public resources that have no private endpoint, unless you enable fallback to internet or add a manual record. - Host file overrides are for testing only.
| Service | Private DNS zone |
|---|---|
| Blob | privatelink.blob.core.windows.net |
| File | privatelink.file.core.windows.net |
| Table | privatelink.table.core.windows.net |
| Queue | privatelink.queue.core.windows.net |
| Data Lake | privatelink.dfs.core.windows.net |
| Static website | privatelink.web.core.windows.net |
| SQL Database | privatelink.database.windows.net |
| Key Vault | privatelink.vaultcore.azure.net |
| Web Apps | privatelink.azurewebsites.net |
| Cosmos DB (SQL API) | privatelink.documents.azure.com |
| Service Bus and Event Hubs | privatelink.servicebus.windows.net |
| Container Registry | privatelink.azurecr.io |
Steps and commands
Service endpoint on storage: subnet › Service endpoints › Microsoft.Storage, then on the storage account Networking set Selected networks (default action Deny) and add the vnet and subnet. Private endpoint order: create the endpoint, create the private DNS zone with the recommended name, link the zone to the vnet (registration disabled), add a DNS zone group to the endpoint, then test with nslookup from a VM. It returns the private IP, with the public name as an alias.
| Task | Command |
|---|---|
| Subnet with service endpoint | az network vnet subnet create --vnet-name vnet-1 -g test-rg -n subnet-private --address-prefix 10.0.1.0/24 --service-endpoints Microsoft.Storage |
| Storage default action | az storage account update --name $acct -g test-rg --default-action Deny |
| Allow the subnet on storage | az storage account network-rule add -g test-rg --account-name $acct --vnet-name vnet-1 --subnet subnet-private |
| Create a private endpoint | az network private-endpoint create --connection-name connection-1 --name private-endpoint -g test-rg --subnet subnet-1 --vnet-name vnet-1 --private-connection-resource-id $id --group-id sites |
| Private DNS zone | az network private-dns zone create -g test-rg --name "privatelink.azurewebsites.net" |
| Link zone to vnet | az network private-dns link vnet create -g test-rg --zone-name "privatelink.azurewebsites.net" --name dns-link --virtual-network vnet-1 --registration-enabled false |
| DNS zone group | az network private-endpoint dns-zone-group create -g test-rg --endpoint-name private-endpoint --name zone-group --private-dns-zone "privatelink.azurewebsites.net" --zone-name webapp |
| PowerShell: service endpoint on subnet | New-AzVirtualNetworkSubnetConfig ... -ServiceEndpoint "Microsoft.Storage" |
| PowerShell: storage firewall | Update-AzStorageAccountNetworkRuleSet -DefaultAction Deny and Add-AzStorageAccountNetworkRule |
| PowerShell: private endpoint | New-AzPrivateLinkServiceConnection then New-AzPrivateEndpoint (mandatory: -Name, -ResourceGroupName, -Location, -Subnet, -PrivateLinkServiceConnection). -ByManualRequest asks for manual approval |
Limits
| Item | Value |
|---|---|
| Private endpoints per vnet | 1,000 |
| Private endpoints across peered vnets | 4,000 |
| Private endpoints per subscription | 64,000 |
| Subscriptions and regions with vnet rules, per vnet per service | up to 500 |
Exam Tips
Tick each tip once you can answer it without looking.
“Restrict a storage account to one subnet with no DNS change and no extra charge” → Service endpoint Microsoft.Storage on the subnet plus a storage network rule. Trap: a private endpoint needs DNS configuration.
“Enabled the Microsoft.Storage endpoint but storage is still open to all networks” → Set the default action to Deny (Selected networks) and add the subnet. Trap: rebooting the VM.
“On-premises users must reach storage restricted by a service endpoint” → Add the on-premises or ExpressRoute NAT public IPs to the storage firewall (or use a private endpoint). Trap: service endpoints do not work for on-premises traffic.
“After enabling a service endpoint, a storage IP rule for the VM's public IP stops working” → The source is now the vnet private IP: use a vnet rule. Trap: a DNS cache problem.
“Permission needed to secure a service to a subnet with an endpoint” → joinViaServiceEndpoint/action on the subnet. Trap: networkSecurityGroups/join/action.
“Next hop type for service endpoint traffic in effective routes” → VirtualNetworkServiceEndpoint. Trap: Internet.
“UDR 0.0.0.0/0 to an NVA on a subnet with a Storage endpoint: path to storage” → Still direct: endpoint routes are longer prefixes and a route table cannot override them. Trap: traffic being forced through the NVA.
“Private endpoints for blob and file on one storage account” → Two private endpoints (group IDs blob and file). Trap: one endpoint does not cover all sub-resources.
“Private DNS zone for a blob private endpoint” → privatelink.blob.core.windows.net. Trap: blob.core.windows.net itself.
“Private DNS zones for Azure SQL and Key Vault” → privatelink.database.windows.net and privatelink.vaultcore.azure.net. Trap: privatelink.sql.azure.net is not the recommended SQL name.
“Private endpoint created but the VM resolves the public IP” → The private DNS zone is not linked to the VM's vnet (or there is no zone group or custom DNS forwarder). Trap: an NSG block does not change the DNS answer.
“Private endpoint connection state is Pending” → The resource owner must approve it (manual approval, or you lack approval permission). Trap: restarting the endpoint.
“Private endpoint and its vnet” → Same region and subscription as the vnet; the target resource may be in another region. Trap: the target must be in the same region.
“Private endpoint on a storage account” → General-purpose v2 account. Trap: the Blob Storage kind.
“Private endpoint exists but public access still works” → Restrict or disable public network access on the service. Trap: the endpoint blocking public access automatically.
“Apply NSG or UDR to private endpoint traffic” → Enable network policies on the endpoint subnet. Trap: NSGs always apply to endpoints.
“Two services' endpoints sharing one private DNS zone” → Conflict: use one zone per service type. Trap: a single zone for all.
“Only this private endpoint state can send traffic” → Approved. Trap: Pending and Disconnected states also carry traffic.
Sources
- Azure virtual network service endpoints
- What is a private endpoint?
- Private endpoint private DNS zone values
- Quickstart: create a private endpoint (CLI)
- Tutorial: restrict access to PaaS with service endpoints
- Azure Virtual Network FAQ
- Azure virtual network traffic routing
- Azure Load Balancer components
- Azure subscription and service limits
- New-AzPrivateEndpoint
Checked against Microsoft Learn on November 13, 2026.