Here are the steps and explanations for ensuring that all hosts deployed to subnet3-2 connect to the internet by using the same static public IP address:
To use the same static public IP address for multiple hosts, you need to create a NAT gateway and associate it with subnet3-2. A NAT gateway is a resource that performs network address translation (NAT) for outbound traffic from a subnet1. It allows you to use a single public IP address for multiple private IP addresses2.
To create a NAT gateway, you need to go to the Azure portal and select Create a resource. Search for NAT gateway, select NAT gateway, then select Create3.
On the Create a NAT gateway page, enter or select the following information and accept the defaults for the remaining settings:
Subscription: Select your subscription name
Resource group: Select your resource group
Name: Type a unique name for your NAT gateway
Region: Select the same region as your virtual network
Public IP address: Select Create new and type a name for your public IP address. Select Standard as the SKU and Static as the assignment method4.
Select Review + create and then select Create to create your NAT gateway3.
To associate the NAT gateway with subnet3-2, you need to go to the Virtual networks service in the Azure portal and select your virtual network.
On the Virtual network page, select Subnets under Settings, and then select subnet3-2 from the list.
On the Edit subnet page, under NAT gateway, select your NAT gateway from the drop-down list. Then select Save.