Lesson 3 of 3 App Service Domains, TLS and Networking

Controlling App Service Inbound and Outbound Traffic

This lesson explains the inbound and outbound networking features of App Service and which requirement each one meets.

Learning outcomes

After completing this lesson, you will be able to:

  • Describe access restrictions and private endpoints for inbound traffic.
  • Describe VNet integration and Hybrid Connections for outbound traffic.
  • Choose the networking feature for a requirement.

Inbound features

Access restrictions are priority-ordered allow and deny rules for the app's public endpoint, matching IPv4 or IPv6 ranges, service tags (such as AzureFrontDoor.Backend with an X-Azure-FDID header filter) or virtual network subnets that have the Microsoft.Web service endpoint. Once any allow rule exists, an implicit deny-all applies. The advanced tool site (SCM or Kudu, used for deployment) has its own rules or can follow the main site's rules.

A private endpoint gives the app a private IP address in a subnet of a VNet, through Azure Private Link, with a privatelink.azurewebsites.net private DNS zone. Clients in the VNet, peered VNets and on-premises networks connected by VPN or ExpressRoute then reach the app privately, and public network access can be disabled. Private endpoints are supported in Basic and higher tiers. An App Service Environment provides inbound isolation for the whole environment.

The following diagram shows the inbound and outbound private paths.

Making an internal web app fully private in both directions. Inbound, a private endpoint for the app in the hub, with private DNS resolvable from on-premises, replaces public access, which is disabled. Outbound, VNet integration with a delegated subnet lets the app reach the Azure SQL private endpoint in the peered spoke.
The topology is simplified.
Scenario questions

Controlling inbound access

Exam skills 3.4.7

Choose the inbound networking feature for each requirement.

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

Outbound features

Virtual network integration lets the app make outbound calls into a VNet. It uses an empty subnet delegated to Microsoft.Web/serverFarms (a /26 or larger is recommended for scaling), in the same region as the app. Through it, the app reaches private IP addresses in the VNet, peered VNets, resources behind service endpoints and private endpoints, and on-premises networks through VPN or ExpressRoute gateways. With Outbound internet traffic routed through the VNet (route all), NSGs, UDRs and a NAT gateway or firewall apply to all outbound traffic, which gives the app a static outbound IP address through the NAT gateway.

Hybrid Connections reach a specific host and port on-premises through an Azure Relay and a Hybrid Connection Manager installed on-premises, without a VPN. The table below summarizes which feature solves which problem.

RequirementFeatureDirection
Allow only certain IP ranges or subnets to reach the appAccess restrictionsInbound
Reach the app on a private IP from the VNet or on-premisesPrivate endpointInbound
App calls a database on a private IP in a VNetVNet integrationOutbound
App needs a static outbound public IPVNet integration with route all and a NAT gatewayOutbound
App calls one on-premises server and port without a VPNHybrid ConnectionsOutbound
Sort into groups

Inbound or outbound feature?

Exam skills 3.4.7

Choose the feature for each App Service networking requirement.

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

A fully private app

An internal web app must be reachable only from the corporate network, which connects to an Azure hub VNet through ExpressRoute, and must read data from an Azure SQL database that has only a private endpoint in a spoke VNet peered with the hub. What should you configure on the app?

For inbound traffic, add a private endpoint for the app in the hub (or a spoke) with private DNS resolvable from on-premises, and disable public network access. For outbound traffic, enable VNet integration with a delegated subnet in a VNet that can reach the SQL private endpoint, with private DNS for privatelink.database.windows.net linked to it. VNet integration alone does not make the app private, and a private endpoint alone does not let the app make outbound calls into the VNet.

Check yourself

Does enabling VNet integration make an app reachable only from the VNet?

Show answer

No. VNet integration is for outbound traffic; inbound privacy needs a private endpoint or access restrictions.

Exam Tips

Remember for the exam

  • Inbound privacy: private endpoint. Inbound filtering: access restrictions.
  • Outbound into a VNet: VNet integration with a delegated subnet.
  • Static outbound IP: VNet integration routing all traffic through a NAT gateway.
  • The SCM (Kudu) site has its own access restriction rules.