Azure Container Instances and public access

David Drápela 75 Reputation points
2023-08-09T15:43:25.2266667+00:00

Hello,

I am migrating an on-premise service to Azure. The app uses .Net and I can containerize it in Docker. It is just a single container with no scaling. For data persistence PostgreSQL database is used. The app has two TCP (non HTTP) ports open for connection with desktop client apps and devices communication, both using custom protocols.

I find ACI suitable for this because it seems to meet my needs and I do not have to care about the OS. I would also like to use Azure Database for PostgreSQL.

I have made a POC setup and it seems to work great. The ports are open and desktop clients can connect, the devices also work without any issue. Because I know the public IP can change after restart I am using FQDN as an endpoint. Clients will connect to the service using custom domain name with a CNAME record pointing to ACI FQDN.

The problem is that after the container restart there is still the old IP in the DNS cache and the desktop apps and devices are able to reconnect after like 5 minutes. This is too long for the use case scenario, the service needs to be responsive ASAP.

What would be the best solution to this issue?

I have tried setting up a Traffic Manager profile and deploying the ACI with private network configuration but I fail to set it up in TM endpoints configuration - there is no option for ACI. The Azure App Gateway is also not an option because it routes just HTTP requests.

Thanks.

Azure Container Instances
Azure Container Instances
An Azure service that provides customers with a serverless container experience.
757 questions
0 comments No comments
{count} votes

Accepted answer
  1. AirGordon 7,150 Reputation points
    2023-08-09T17:44:20.2333333+00:00

    If you review my answer in this question, you'll see a simple solution. I'm using a Public Load Balancer in front of a Private Azure Container Instance.

    A Static Public IP address means you don't need to worry about DNS caching, and instead of deploying complex services for routing you can use a simple Load Balancer connecting the Public IP to the ACI.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

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