prevent azure container instance change IP

Oleksandr Kucherenko 75 Reputation points
2023-05-15T14:41:04.3866667+00:00

We have Azure container instance with IP, which is updates each time after restart. Is far as I understand there is no possibility to use static IP for this. Is there A way to use FQDN? Or prevent it from changing or what is the best variant to fix it?

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

Accepted answer
  1. Ammar-Abdelqader01 1,006 Reputation points Microsoft Employee
    2023-05-15T14:46:48.5566667+00:00

    Hello @Oleksandr Kucherenko

    thank you for your question to use static IP with ACI you can go with one of those solutions as below:

    1- Expose a static IP address for a container group

    2- Configure a single public IP address for outbound and inbound traffic to a container group

    3- Configure a NAT gateway for static IP address for outbound traffic from a container group

    4- Deploy a container group with custom DNS settings here what are you looking for.

    if this has been helpful, please take a moment to accept answers as this helps increase visibility of this question for other members of the Microsoft Q&A community. Thank you for helping to improve Microsoft Q&A!

    User's image


1 additional answer

Sort by: Most helpful
  1. AirGordon 7,030 Reputation points
    2023-05-15T14:51:16.72+00:00

    There is a quick-start in the docs that show how to leverage a Static IP via deploying an additional service; An Azure Application Gateway.
    https://video2.skills-academy.com/en-us/azure/container-instances/container-instances-application-gateway

    You can create Azure Container Instances with a FQDN though, which is much simpler and results in a FQDN like; your-aci-dns-name.westeurope.azurecontainer.io

    This is the command you'd use in the Azure CLI;

    az container create --resource-group myResourceGroup --name mycontainer --image mcr.microsoft.com/azuredocs/aci-helloworld --dns-name-label your-aci-dns-name --ports 80

    If you are wanting to update an existing container instance then you just run the same command;

    # Update DNS name label (restarts container), leave other properties unchanged
    az container create --resource-group myResourceGroup --name mycontainer \
        --image nginx:alpine --dns-name-label myapplication