Azure Containers Instance — Enable Fixed Outbound Connectivity
There are cases where customers want to have a fixed IP address for Outbound connectivity to whitelist in their firewall for security reasons. Bu default Azure Containers Instance assigns a different Public IP address at every start of the workload. A solution for this case would be to use a Vnet Nat Gateway with a Private networking in ACI as follows:
Will do our tests using a public repository Nginx image at the creation of the ACI resource. By default, this will create a new VNET with a default subnet. The next step will be to create a NAT Gateway in Azure Portal, assign a Resource Group and a name for this resource,
create a Public IP address or assign a existing Public IP, and on the next tab, Subnet, will choose from Virtual Network dropdown menu the Subnet associated with the ACI.
After our resource is created, will test the assigned IP address of our Container by connecting to that resource and issuing the command: curl ifconfig.me