Azure App Gateway V2 cannot be configured with NSG Azure App Gateway V2 cannot be configured with NSG azure azure

Azure App Gateway V2 cannot be configured with NSG


The error message displays that you need to add incoming internet traffic on ports 65200 - 65535 to subnet-default in your Network security group-BannerCIDRNsg.

enter image description here

Per Application Gateway FAQ, you can whitelist Application Gateway access to a few source IPs.

This scenario can be done using NSGs on Application Gateway subnet. The following restrictions should be put on the subnet in the listed order of priority:

Allow incoming traffic from source IP/IP range.

Exceptions must be put in for incoming traffic on ports 65503-65534 for the Application Gateway V1 SKU and ports 65200 - 65535 for the V2 SKU. This port-range is required for Azure infrastructure communication. They are protected (locked down) by Azure certificates. Without proper certificates, external entities, including the customers of those gateways, will not be able to initiate any changes on those endpoints.

Allow incoming Azure Load Balancer probes (AzureLoadBalancer tag) and inbound virtual network traffic (VirtualNetwork tag) on the NSG.

Block all other incoming traffic with a Deny all rule.

Allow outbound traffic to the internet for all destinations.


I was getting the error message "Subnet associated to gateway with v2 sku" when trying to associate a subnet containing a Gateway V2 WAF to an existing NSG.

Strangely though it was no problem navigating to the VNET -> SubNet and after clicking the given SubNet then associating the NSG to that SubNet.


To associate NSG to the subnet containing an application gateway, allow traffic from

  1. source: 'GatewayManager', port: Any to Destination: 'GatewayManager' service tag, Destination port: 65503-65534
  2. Traffic from the AzureLoadBalancer tag with the destination subnet as Any must be allowed.Note: just be cautious that you don't add deny rule before these inbound rules, so give them a low priority no, to avoid accidental misconfiguration

Also,

  1. Outbound Internet connectivity can't be blocked

Reference : https://docs.microsoft.com/en-us/azure/application-gateway/configuration-infrastructure#network-security-groups