Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
Hi Dave Mace & thx for join me at Q&A platform,
On multitenant Linux App Service, I wouldn’t build KnownProxies around the private IP address you happen to observe as Kestrel’s immediate peer. That address is part of the App Service infrastructure and can change when workers move, scale, or the platform topology changes. The documented App Service inbound/outbound IP addresses aren’t a list of trusted front-end proxy addresses. ASPNETCORE_FORWARDEDHEADERS_ENABLED=true is the supported ASP.NET Core mechanism for enabling forwarded headers in this hosting scenario, but, as you noted, it effectively removes the default proxy restrictions. There doesn’t appear to be a documented App Service API or stable CIDR list that can be used to populate KnownProxies/KnownNetworks for the final platform hop. I wouldn’t rely on the observed rightmost X-Forwarded-For behavior as a security contract unless App Service explicitly documents it. ForwardLimit = 1 only limits how many entries the middleware processes; it doesn’t by itself establish that the peer or selected header value is trustworthy.
If your security model requires cryptographically or topologically trustworthy client IP information with an explicitly controlled proxy boundary, the safer architecture is to put a proxy you control, such as Application Gateway or another appropriate ingress layer, in front of the app and restrict App Service so traffic can only arrive through that path. You can then configure ASP.NET Core to trust that known proxy/network rather than undocumented App Service infrastructure addresses.
For the direct-public-ingress case, the specific guarantees you’re asking about — stable identity of the final proxy, protection against peer impersonation, and exact normalization of caller-supplied X-Forwarded-For/X-Forwarded-Proto — really need an authoritative answer from the App Service engineering team. I don’t think it would be safe to infer those guarantees from sampled traffic or private/link-local addresses observed on a worker.
rgds,
Alex