背景
Bug か仕様か、bugっぽいですかね。
Public listener , private listener は同じPortを設定された場合、NSGに必ずFrontend IP(Public, private)に通信許可するルールが必須です。それがないと、NSGがAppGWに関連付けすらできません。
私の考えでは、これはClient通信要件で、AppGW自身のInfra通信要件ではないため、該当ルールがなくても、とりあえずNSGが関連付けはできるはず。つまり、後で必要に応じでNSG上で追加設定すればいいはずです。NSGの関連付けすらできないのはおかしい。
検証
前提条件:
Public listener , private listener は同じPortを設定。
Frontend Ip :10.6.0.9 ,135.149.43.56.
以下のようにNSGに優先度130 (Frontend Ip :10.6.0.9 ,135.149.43.56.)がある場合、問題なく、NSGをAppGW subnetに関連付けができます。
以下のようにNSGに優先度130 (Frontend Ip :10.6.0.9 ,135.149.43.56.)がない場合、NSGをAppGW subnetに関連付けが失敗します。
Failed to save network security group for subnet 'default'. Error: Failed to save changes due to conflicting Application Gateway and Network Security Group configurations. When configuring or using common port for public and private listeners on application gateway, the Destination IP of the inbound flow changes to the frontend IPs of your gateway.You must thus update the Inbound rule for the NSG resource testnsg that is associated with the subnet default of application gateway appgatewaytan. Allow the frontend IPs as Destination and all listener Ports as per https://aka.ms/agnsg.