An Azure networking service that is used to provision private networks and optionally to connect to on-premises datacenters.
Hello @SivaKalyan Yamarthi
NAT Gateway costs increase based on outbound traffic volume and SNAT connection usage from any resource in the associated subnet.
Identifying the consumer must be done indirectly by using VNet Flow Logs to correlate source private IP addresses with the underlying resources (such as VMs, VMSS instances, or Paas apps), and by analyzing destination IPs and ports to infer traffic type.
To check which resources are using the NAT Gateway, follow the steps below:
Step 1: Go to your NAT Gateway → Networking, and check which resources (such as subnets) the NAT Gateway is associated with.
Step 2: Enable Virtual Network flow logs on the NAT subnet.
Go to the virtual network where the NAT Gateway is assigned → Virtual network flow logs → Create a flow log.
Under Analytics, make sure to enable Traffic Analytics and select the Log Analytics workspace
Once you create the Virtual Network flow logs, the logs will appear as JSON files in the Storage account container.
In this setup, the VM does not have a public IP and the subnet is associated with a NAT Gateway. NSG flow logs show outbound traffic from the VM private IP to public destination IPs allowed by the DefaultRule_AllowInternetOutBound rule.
Since the subnet had a NAT Gateway attached at the time of the traffic, this outbound internet traffic would have been translated and egressed through the NAT Gateway public IP.
My VM Configuration:
**
When the NAT Gateway was attached to the subnet, outbound internet traffic from the VM was translated and egressed through the NAT Gateway public IP, which is reflected in NAT Gateway metrics.
After detaching the NAT Gateway, NAT metrics show no inbound, outbound, or SNAT activity, confirming that traffic is no longer flowing through the NAT Gateway.
**
Ref: Virtual network flow logs compared to network security group flow logs
Please do not forget to
and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.