Persistent Fix IP for Azure Container Instances in VNet

Mahdi Barkhordari 0 Reputation points
2025-08-17T13:40:18.2133333+00:00

We are currently running two Azure Container Instances inside the same VNet and Subnet:

One container runs our backend service.

The other container runs Nginx.

These containers communicate with each other and with external systems. However, the issue is that every time the containers are restarted or redeployed, they receive new private IP addresses. This breaks our configuration and requires us to manually update the IP addresses each time. Like Nginx location configuration.

Our goal is to keep using Azure Container Instances (not switching to a VM) and maintain the existing VNet/Subnet setup without reconfiguring everything after a restart.

Could you please advise the recommended Azure-native approach?

Azure Container Instances
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. VasimTamboli 5,535 Reputation points MVP
    2025-08-17T14:53:06.5+00:00

    HI Mahdi,

    Azure Container Instances don’t currently support static private IP addresses that persist through restarts or redeployments. Each time you restart, the container gets a new IP, which breaks configurations relying on fixed IPs (like Nginx location settings).

    The recommended Azure-native approach is to use Azure Private DNS for service discovery. You assign DNS names to your containers inside the VNet and automate updating these DNS records whenever the containers restart. This way, your services can refer to stable DNS names instead of changing IPs, avoiding manual reconfiguration while keeping your existing VNet and subnet setup intact.

    For public access, use an Azure Application Gateway or Load Balancer with a static public IP in front of your containers.

    If you still think this is not complete answer then please let us know, we will happy to help you.

    1 person found this answer helpful.

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.