Search code examples
azureazure-devopsazure-container-instances

Azure ACI Private IP Changes When Re-Deployed


When I re-deploy my container group, the private IP address changes. It's usually one of three addresses. So, I recognize that my load balancer can just have all three of those, and seems to know which one is actually live at the moment, but I would much rather be able to have the load balancer pointed at a single DNS name, or be able to specify the private IP address that my container is going to get. Anyone know a good solution for this?

I'm using a custom JSON template to deploy each time. Is there a solution in that context, or the Azure CLI?

Thank you


Solution

  • You can’t assign a static private IP address to your Azure Container Instance

    The private IP address might change when you restart the ACI or redeploy it

    Azure container instances don’t automatically register and synchronize the IP address with the associated DNS record

    The private IP address allocation for a container instance is done based on the availability of the first available IP address in the subnet

    You can deploy the container group into a subnet of very small address range so that you can know the next private address which will be allocated to your container instance