I’m trying to set up an Azure Application Gateway with Container Instances as the backend. The problem is that the container’s IP address changes every time I deploy it, making it hard to maintain an up-to-date backend target.
I’ve looked at the available options, but I haven’t been able to find a dynamic solution, perhaps something like using container tags instead of static IPs.
Here’s what I’ve tried so far:
Configuring the backend with the container’s private IP address
Exploring the backend target settings in the Azure portal
None of these approaches seem to work, as the IP address keeps changing. Can anyone suggest a method to make this setup work with Application Gateway, or is there a better alternative?
I appreciate any insights or best practices you can share. Thanks in advance!
hey iris, try using azure dns private zones to create a custom domain for your container. then, set the app gateway to use that profile insted of the changing ip. its tricky at first but should handle dynamic ips well. let me know if ya need further help!
Have u thought about using azure container apps? i’ve heard they work better with app gateway. or maybe look into service discovery options? could be a game-changer for ur setup. what’s ur main reason for using container instances? curious about ur use case!
Having worked with Azure Application Gateway and Container Instances, I’ve encountered similar challenges. One effective solution I’ve implemented is using Azure Container Apps instead of Container Instances. Container Apps provide better integration with Application Gateway and support dynamic IP allocation.
Another approach that worked well in my projects is utilizing Azure API Management as an intermediary layer. It can handle the dynamic nature of Container Instances and provide a stable endpoint for the Application Gateway.
If you must stick with Container Instances, consider setting up an Azure Function that periodically checks the container’s IP and updates the Application Gateway’s backend pool. This automation can help maintain connectivity despite changing IPs.
Remember, each solution has trade-offs in terms of complexity and cost. Evaluate based on your specific requirements and scalability needs.