Lesson 2 of 4 Private and Remote Connectivity

Configuring Azure Private Link Services

This lesson explains how to publish your own service privately, and how that differs from a private endpoint.

Learning outcomes

After completing this lesson, you will be able to:

  • Distinguish a Private Link service from a private endpoint.
  • Explain why address overlap is not a problem.
  • Choose a visibility setting.
  • Describe TCP Proxy v2.

Provider and consumer

A private endpoint is the consumer's side of a connection. The provider's side, for an Azure PaaS service, is run by Microsoft. If you run a service, and want customers or other internal teams to reach it privately, you need a Private Link service. Your application sits behind a load balancer, you create a Private Link service attached to it, and consumers create private endpoints that point to it.

Candidates must keep the terms apart. The following comparison shows the two sides.

Private endpoint
Who creates itThe consumer
Where it livesIn the consumer's virtual network
What it connects toAn Azure PaaS resource or a Private Link service
Address visibleA private IP in the consumer's network
Private Link service
Who creates itThe provider
Where it livesIn the provider's virtual network
What it connects toA Standard Load Balancer front end
Address visibleNAT addresses in the provider's subnet

How the connection works

A consumer sends traffic to its private endpoint, and Azure carries it through the backbone to the Private Link service. The service translates the source to one of its NAT IP addresses, drawn from a subnet that the provider chooses, and forwards the traffic to the load balancer. Because of this translation, the two address spaces can overlap without any conflict, and neither network needs peering. This is a key benefit: a provider can serve hundreds of customers who all use the same address ranges.

The requirements are as follows.

  • A Standard Load Balancer, since Basic is not supported, with a backend pool configured by NIC and not by IP address.
  • A subnet for NAT IP addresses, with at least eight free addresses recommended; each service can use up to eight NAT addresses.
  • IPv4 and TCP or UDP only.
  • Private Link service network policies disabled on the subnet that supplies the NAT addresses.

The following diagram follows consumer traffic to the provider's back end.

How a Private Link service connection works. A consumer sends traffic to its private endpoint, and Azure carries it over the backbone to the provider's Private Link service. The service translates the source to one of its NAT IP addresses and forwards the traffic to a Standard Load Balancer and its backend. Because of the translation, the two networks can use overlapping address ranges and need no peering.
NAT lets overlapping address spaces connect without peering.
Select all that apply

Private Link service requirements

Exam skills 2.3.7

Identify the requirements of a Private Link service.

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

Controlling who can connect

A Private Link service has an alias, a globally unique name that a provider gives to consumers. Visibility decides who can see the service and request a connection. The options are as follows.

VisibilityWho can requestUse
Role-based access control onlyPeople with rights on the serviceInternal services
Restricted by subscriptionListed subscriptionsKnown customers
Anyone with your aliasAnyone who has the aliasBroad public offerings, with approval required

Connection requests appear as Pending until the provider approves them. An auto-approval list skips this step for named subscriptions. Visibility and approval are separate gates: a subscription might be visible but still need approval, which gives two points of control.

Scenario questions

Visibility and the real client

Exam skills 2.3.7

Choose the Private Link service settings for each requirement.

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

Seeing the real client

NAT hides the consumer's address, because the back end sees a NAT address. If an application needs to know which consumer is connecting, for logging or tenant separation, it can enable TCP Proxy v2, which passes a header with the connection's source details and the private endpoint's linkId. The back-end application must understand this header, or connections fail, so enable it only after updating the application.

The idle timeout is about 300 seconds, so long-lived connections need TCP keep-alive. Private Link Service Direct Connect, which removes the need for a load balancer, is in public preview.

Security considerations

A Private Link service reduces exposure, since it has no public endpoint and no peering. It does not authenticate users. The provider must still secure the application with authentication, since any approved consumer's network can reach the load balancer's front end. NSGs on the back-end subnet should allow traffic from the NAT subnet, because that is the source that the back end sees. Monitor the service's bytes and connection metrics, and remove unused connections.

Worked example

Publishing to a customer

A software vendor runs an API behind a Standard Load Balancer in Azure. A customer's network overlaps with the vendor's, and the customer's policy forbids peering and public endpoints. Only that customer's subscription should be able to connect, and the vendor wishes to approve each connection. What should the vendor configure?

Create a Private Link service on the load balancer, with visibility Restricted by subscription that lists the customer's subscription, and leave the auto-approval list empty so that requests wait for approval. The customer creates a private endpoint with the service's alias.

Overlapping addresses rule out peering, and a VPN would have the same difficulty without NAT. A private endpoint created by the vendor would be on the wrong side of the connection. Adding the subscription to the auto-approval list would remove the approval step that the vendor wants.

Check yourself

Why must a back-end NSG allow the NAT subnet, rather than consumer addresses?

Show answer

NAT translates the source, so the back end sees a NAT address and not the consumer's.

Exam Tips

Remember for the exam

  • Provider creates a Private Link service; consumer creates a private endpoint.
  • It needs a Standard Load Balancer, with a NIC-based backend pool.
  • NAT allows overlapping address spaces.
  • Back-end NSGs must allow the NAT subnet.