Lesson 5 of 6 Securing Azure Virtual Networks

Reaching PaaS Services with Service Endpoints

This lesson explains how service endpoints work and their characteristics and limitations.

Learning outcomes

After completing this lesson, you will be able to:

  • Explain how service endpoints change traffic to PaaS services.
  • Describe the virtual network rule needed on the service.
  • Identify the limitations of service endpoints.

How service endpoints work

A service endpoint is enabled on a subnet for a service, such as Microsoft.Storage, Microsoft.Sql, Microsoft.KeyVault, Microsoft.Web or Microsoft.ServiceBus. Azure then adds routes so that traffic from the subnet to that service travels over the backbone, and the traffic arrives at the service with the VM's private source IP address and the subnet's identity instead of a public IP.

The service resource then uses that identity: a storage account, SQL server or key vault adds a virtual network rule for the subnet in its firewall and denies other networks. Without the rule, enabling the endpoint only optimizes routing.

The following diagram compares a service endpoint with a private endpoint for restricting an Azure SQL logical server to one subnet.

Restricting an Azure SQL logical server to one subnet at no extra cost. A Microsoft.Sql service endpoint on subnet Web plus a virtual network rule on the server, with public access limited to selected networks and no IP rules, does it for free. A private endpoint would add hourly and data processing charges that are unnecessary here.
The scenario is illustrative.
Put in order

Locking a storage account to a subnet

Exam skills 4.2.4

Arrange the steps that limit a storage account to one subnet with a service endpoint.

Log in to try this activity Interactive activities are free with an account.

Characteristics and limitations

The service is still reached at its public endpoint: DNS still returns a public IP, nothing is deployed in the VNet, and service endpoints are free. The endpoint covers the whole service type, such as all storage accounts in Azure, unless a service endpoint policy restricts Microsoft.Storage traffic to specific accounts, which helps prevent data exfiltration. Service endpoints do not extend to on-premises networks or peered VNets: each subnet that needs access must enable its own endpoint and be added to the rule.

Enabling or disabling a service endpoint on a subnet briefly interrupts existing connections from it, because source addresses change from public to private. Storage accounts in the same region and the paired region are covered by Microsoft.Storage; Microsoft.Storage.Global covers all regions.

True or false

Service endpoint limits

Exam skills 4.2.4

Check what service endpoints do and do not cover.

Log in to try this activity Interactive activities are free with an account.
Worked example

Locking down a SQL server

Web servers in subnet Web must connect to an Azure SQL logical server, and no other network may connect. The company does not want to pay for additional networking resources and does not need on-premises access. What should you configure?

Enable the Microsoft.Sql service endpoint on subnet Web and add a virtual network rule for that subnet on the SQL server's networking page, with public access limited to selected networks and no IP rules. Service endpoints are free, while a private endpoint would add hourly and data processing charges and is unnecessary without on-premises access.

Check yourself

After enabling a service endpoint, what IP address does DNS return for the storage account?

Show answer

Still the public IP address; service endpoints do not change DNS or give the service a private IP.

Exam Tips

Remember for the exam

  • Service endpoints are free and keep the service's public endpoint.
  • Enable the endpoint on the subnet and add a virtual network rule on the service.
  • They do not provide access from on-premises networks.
  • Service endpoint policies limit Storage access to specific accounts.