1

I've a private Azure Container instance running that is part of a Virtual network. I need to connect to that ACI from a public Azure App Service app, which I also added to the same Virtual network.

I am indeed able to connect from the App Service to the ACI via the private ip address, but this ip address changes every time the ACI is redeployed. I've searched and tried stuff like Private DNS but I still need to change the ip manually in that DNS after every redeploy of the ACI. I've searched and tried stuff like Private DNS but I still need to change the ip manually in that DNS after every redeploy of the ACI.

I just need an IP or URL to connect to the private ACI that always works without me manually editing the private ip address when it's changed because of a redeploy. I can't seem to find a solution.

Ricardo
  • 11
  • 2
  • The IP address can also change after it's deployed, eg if the container instance restarts for updates, so even if you have an ARM template that sets the IP during deploy, you could get errors later down the track – EionRobb Aug 31 '23 at 08:04

1 Answers1

-1

I'd suggest using a dedicated subnet for the ACI instance (rather than using a subnet for multiple ACI workloads). You can create a small (/29) subnet that will ensure it's not competing for addresses with other workloads.

I've tested deleting then redeploying, it results in the same private IP being used. I've also deployed and programmatically restarted and the ACI instance keeps the same private IP.

GordonBy
  • 3,099
  • 6
  • 31
  • 53
  • 1
    Our production workload has been giving different results. IP is randomly changed to the next available IP when ACI instance is re-started. Also, ACI supports only dedicated delegated subnets, so there should not be interfering IP allocations from other service types. – jikuja May 24 '23 at 16:34
  • You have multiple container groups in the subnet? You're orchestrating the ACI restart (`az container restart`), or it's due to the restart policy of the container? – GordonBy May 24 '23 at 16:43
  • Due to restart policy. We got a single container running in the ACI and it has been assigning randomly three first IP addresses of the subnet. – jikuja May 25 '23 at 21:28