An Azure service that provides customers with a serverless container experience.
@Shreyas Waikar (Persistent Systems Inc)
Thanks for the detailed write-up super helpful! From what you’ve shared, it sounds like Azure probably kicked off a restart (like a host migration or maintenance), which led to your Container Group being recreated and getting a new private IP in the delegated subnet.
If you’re running Azure Container Instances in a VNet using subnet delegation to Microsoft.ContainerInstance/containerGroups, you won’t get a guaranteed IP address every time the container group restarts or gets recreated by the platform. Basically, whenever the group is taken down and spun up again, it gets treated like a brand-new allocation, so DHCP will just hand out whatever IP is free at that moment.
- Use a Static/Reserved Approach via Azure DNS or Internal Load Balancer
Rather than relying on the raw IP, front your ACI with an Azure Internal Load Balancer (ILB) or use an Azure Private DNS Zone to resolve a stable hostname to the container group. This way, even if the IP changes, the FQDN stays consistent and your App Service proxy can target the DNS name instead of a hardcoded IP.
https://learn.microsoft.com/en-us/azure/container-instances/container-instances-vnethttps://learn.microsoft.com/en-us/azure/dns/private-dns-overview
- Pin the IP via a Static IP Workaround (Application Gateway / NAT)
Deploy an Azure Application Gateway (internal) or NAT Gateway in front of the ACI. The gateway holds the stable IP; ACI can change behind it without affecting upstream services.
https://learn.microsoft.com/en-us/azure/application-gateway/overview
- Update App Service's BACKEND_URL Dynamically
As a short-term mitigation, you can use a startup script or Azure Automation Runbook that detects IP changes (via Azure Resource Graph or ARM API) and updates the App Service application setting automatically.
https://learn.microsoft.com/en-us/azure/governance/resource-graph/overview
Thanks,
Manish.