An Azure service that provides an event-driven serverless compute platform.
Hi @Nagendra Matharasi ,
Welcome to the Microsoft Q&A Platform! Thank you for asking your question here.
Root cause
The error “Delegated subnet cannot be attached to StandardV2 NAT Gateway” is caused by a limitation in StandardV2 NAT Gateway: StandardV2 cannot be attached to delegated subnets for several Azure services - including Azure Web Apps / App Service (the service behind Functions’ VNet integration).
In other words, the integration subnet for a Function/App is a delegated subnet (Microsoft.Web), and StandardV2 currently isn’t supported on that kind of delegated subnet.
Possible solution
- Use a Standard (v1) NAT Gateway attached to the integration subnet. Standard (v1) NAT gateway is compatible with App Service / Function VNet integration and will provide a static outbound IP. This is the simplest, doc-recommended approach.
- If you require StandardV2 features (zone redundancy / IPv6) — at present you cannot attach a StandardV2 NAT to an App Service / delegated subnet. Options are:
- Re-evaluate whether you can accept Standard (v1) NAT (recommended).
- Use an alternate egress architecture (for example, funnel outbound through an Azure Firewall/egress appliance in a hub and use UDRs), but that is more complex and changes your design.
Note: You must also enable Route All for the webapp/function VNET integration so outbound traffic is sent to the VNET routes.