Azure Virtual Network Service Endpoints provide a secure way to connect your virtual network directly to supported Azure platform-as-a-service (PaaS) resources. They work by extending the identity of your virtual network and its subnets into the Azure service. Traffic between your virtual network and the service then flows over the secure Microsoft backbone network, bypassing the public internet entirely. This design keeps your traffic private, improves network security, and optimizes routing by following the most direct path within Azure's infrastructure.
Once you enable a service endpoint, you can lock down your PaaS resources, such as Azure Storage or Azure SQL Database, to only accept connections from your specific virtual network or subnet. This removes the need for those resources to have public IP addresses that are accessible from the internet. To plan your deployment, you must analyze which Azure services support endpoints and plan your virtual network topology accordingly. You enable service endpoints at the subnet level by selecting a subnet and adding the specific service endpoint resource provider, such as Microsoft.Storage.
After enabling the service endpoint on your subnet, you must configure your Network Security Groups (NSGs) to restrict outbound traffic. This step ensures that only the necessary service endpoint traffic is allowed to leave the subnet. You must also configure the Azure PaaS resource itself to complete the secure connection. This involves adding a virtual network rule or firewall rule on the PaaS service that explicitly grants access only from the IP address range of your virtual network or the specific subnet where the endpoint is enabled. This two-step process ensures all traffic remains on the private Azure backbone and cannot be accessed from outside.
Private endpoints give Azure services a private IP address inside your virtual network, connecting through Azure Private Link instead of the public internet. When you enable a private endpoint, the system changes how DNS resolves the service name. Instead of pointing to a public address, it points to the private IP address in your network. This keeps traffic on the Azure backbone and removes the exposure that comes with public endpoints.
There are three main options for DNS resolution depending on your environment. A host file works for quick tests on a single machine but does not scale well. Private DNS Zones automatically create and manage the A-records or CNAMEs that map service names to private IP addresses. The Azure Private Resolver handles more complex scenarios where you need to forward DNS queries between local networks and cloud networks.
Private DNS zones must connect to your virtual networks through virtual network links. This link lets any virtual machine in that network resolve private endpoint addresses without extra configuration. Best practices include using one zone per service type to prevent duplicate records and creating separate zones for each endpoint in peered networks. You should also disable automatic registration when you run custom DNS servers to stop unintended record changes.
For network security, NSG rules and Azure Firewall policies control what traffic can reach the private endpoint. The goal is to block all public traffic while allowing only the specific ports and subnets that need access. You should log both NSG and firewall activity to monitor who tries to connect and catch any policy violations. To validate your setup, run the nslookup command to confirm the service name resolves to the private IP address, then test actual connections and review diagnostic logs.
A Private Link service is your own service, powered by Azure Private Link, that you run behind an Azure Standard Load Balancer. To access this or other private services, you configure a private endpoint, which is a network interface that uses a private IP address from your virtual network. By using this setup, network traffic travels exclusively over the Azure backbone network instead of the public internet. This design isolates traffic and provides granular access to specific resource instances, which greatly reduces the risk of data exfiltration. These endpoints can be established within the same virtual network or across peered networks, but they require you to register the Microsoft.Network resource provider first.
To set up a private endpoint, you must first gather a few essential resources and permissions. You need a resource group containing both the target service and the destination virtual network with an assigned subnet. You must also have appropriate role-based access control (RBAC) permissions on both the target resource and its resource group. During creation, you must decide between an auto approval flow, which uses in-line RBAC permissions, or a manual approval flow that requires the service owner to approve the connection.
To ensure traffic routes correctly, you must integrate a private DNS zone that maps the fully qualified domain name of the service to the private IP of the endpoint. To enforce this secure path, you can configure NSGs on your subnet to block outbound internet traffic, forcing all communication destined for the service through the private endpoint. After deploying the endpoint, you should validate its health and access controls from a virtual machine located in the same subnet. Running an nslookup command confirms that the service name resolves to the private IP address, and attempting to access the service publicly should return a 403 Forbidden error. You can use Azure Monitor and Network Watcher to continuously track connectivity health and diagnose any routing issues.
To secure Azure App Service and Azure Functions, you must manage both inbound and outbound traffic paths. Inbound traffic is secured using private endpoints, which assign a private IP from your virtual network to the app, making it inaccessible from the public internet. Outbound traffic is routed into the virtual network using regional virtual network integration. This integration allows the app to securely access resources like databases, virtual machines, or other PaaS services inside your private network without exposing the traffic to the public internet.
This outbound integration depends on a dedicated subnet within your virtual network that must be delegated to the app service and cannot be shared with other resource types. You can configure route settings to decide whether all outbound traffic or only RFC 1918 private traffic goes through the virtual network. Managing this traffic path allows you to apply NSGs and route tables to outbound app traffic, ensuring that your serverless and web workloads respect the same security boundaries as your infrastructure-as-a-service (IaaS) resources.
In an App Service Environment (ASE), achieving private connectivity and traffic control is essential for securing PaaS workloads. Through service endpoints and private endpoints, you can restrict access to Azure resources solely to your designated virtual networks. Service endpoints let Azure services recognize the identity of your VNet and switch outbound traffic from public IPv4 to private IPv4 addresses on the Microsoft backbone. Private endpoints assign a private IP within your VNet, bringing the service directly into your network and eliminating public exposure.
Configuring service endpoints begins by enabling them on the App Service subnet. Note that connections reset when the source IP switches from public to private, and DNS entries still resolve to public IP addresses. To control outbound traffic, you must use service tags in NSG rules to allow traffic only to specific Azure services, as their IP ranges are dynamic. For deeper isolation, implement private endpoints to provide a network interface with a private IP address in your VNet. While inbound traffic is secured via the private endpoint, outbound traffic from your app continues over the App Service infrastructure using virtual network integration.
To enforce precise traffic control, apply NSGs on the App Service subnet using a deny by default, permit by exception model. For advanced outbound control, you can force traffic through an Azure Firewall virtual appliance using a user-defined route and create application rules to allow only approved destination domain names. Finally, validate your configuration using Azure Network Watcher and monitor traffic with firewall diagnostics logs for troubleshooting and security posture assessment.
Private endpoints provide secure connectivity to Azure SQL Managed Instance by assigning a private IP address from within a virtual network. When you create a private endpoint, Azure automatically deploys a network interface that holds the private IP address and sets up a private DNS zone with an A record for name resolution. This setup replaces the public endpoint and enforces a least-privilege access model, meaning traffic no longer travels over the internet to reach the database. The private endpoint must be placed in a dedicated subnet to maintain proper network isolation from other resources.
When configuring DNS for private endpoints, you must ensure that required Azure SQL domain names resolve correctly while avoiding conflicts with custom DNS servers. The domains windows.net, database.windows.net, and related Azure service domains must remain reachable through Azure's platform DNS. Use the privatelink.database.windows.net DNS suffix to map the private endpoint's address, which allows SQL clients to connect using the same server name they would use with a public endpoint. It is critical not to block the AzurePlatformDNS service tag in your network security groups, because Azure relies on this for platform-level DNS resolution that your custom DNS server cannot provide.
Azure SQL Managed Instance uses service-aided subnet configuration to automatically manage network security group rules and route tables within the dedicated subnet. Azure automatically creates NSG rules with the prefix Microsoft.Sql-managedInstances_UseOnly_mi- that are required for the managed instance to function properly, and you can add optional rules using the prefix Microsoft.Sql-managedInstances_UseOnly_mi-optional- for custom filtering. You should layer additional NSG rules to allow traffic only on the ports that SQL Managed Instance requires: TCP port 1433 for standard SQL connections and ports 11000 through 11999 for columnstore queries and other specialized operations. These rules should restrict traffic to only the specific IP addresses within your dedicated subnet that need database access.
There are important networking constraints to understand when deploying private endpoint connectivity. Azure SQL Managed Instance does not support deployment in private subnets that lack default outbound access or in virtual networks that have encryption enabled. If you use ExpressRoute with Microsoft peering or global VNet peering to connect across regions, ensure that each peered subnet has its own distinct NSG and route table configuration that meets SQL Managed Instance requirements. Finally, validate your implementation by running DNS resolution tests through Azure Network Watcher and testing SQL client connections from within the virtual network to confirm that the private endpoint is reachable and that name resolution returns the correct private IP address.
Are you a guardian of your domain? Lean how to leverage your aptitude in security to protect Microsoft Azure technologies, with a goal of earning the Microsoft Certified: Azure Security Engineer Associate certification!
Prepare and test your skills

Prepare and test your skills

Service endpoints extend the identity of your virtual network and its subnets to supported Azure PaaS resources, so traffic flows over the Microsoft backbone, and you can lock down resources to accept connections only from your subnet. Private endpoints assign a private IP address from your virtual network to the Azure service through Azure Private Link, bringing the service directly into your network and eliminating public exposure. Service endpoints do not assign a private IP to the service, while private endpoints do.
When you enable a private endpoint, DNS resolution for the service name changes from pointing to a public address to pointing to the private IP address inside your virtual network. You can manage this with a host file for quick tests, Private DNS Zones that automatically create and manage A-records or CNAMEs, or the Azure Private Resolver for forwarding queries between local and cloud networks.
During private endpoint creation, you choose between an auto approval flow, which uses in-line role-based access control (RBAC) permissions, or a manual approval flow that requires the service owner to approve the connection. Both flows require a resource group containing the target service and the destination virtual network with an assigned subnet, plus appropriate RBAC permissions on the target resource and its resource group.
Azure SQL Managed Instance does not support deployment in private subnets that lack default outbound access or in virtual networks that have encryption enabled. The private endpoint must be placed in a dedicated subnet, and you must not block the AzurePlatformDNS service tag because Azure relies on it for platform-level DNS resolution. If you use ExpressRoute with Microsoft peering or global VNet peering, each peered subnet must have its own distinct NSG and route table configuration that meets SQL Managed Instance requirements.