Updating an existing Container Instance

admanb-vw 21 Reputation points
2022-10-27T19:10:42.133+00:00

I'm using a pipeline to call az container create to create an ACI from a container stored in an ACR. On initial run this works fine -- it creates the ACI, pulls the container, and starts it. But on subsequent runs it's extremely inconsistent. Sometimes it seems to work, sometimes it works but takes a long time, and sometimes it never works at all.

Is there a different process that needs to be used besides just a new create in order to update an existing ACI?

Azure Container Registry
Azure Container Registry
An Azure service that provides a registry of Docker and Open Container Initiative images.
508 questions
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

1 answer

Sort by: Most helpful
  1. shiva patpi 13,366 Reputation points Microsoft Employee Moderator
    2022-10-27T20:58:26.17+00:00

    Hello @admanb-vw ,
    In order to update an existing container instance we don't have "update" command , we will have to use rely on az container create command as mentioned in the document: https://learn.microsoft.com/en-us/azure/container-instances/container-instances-update

    But the main difference between the first time az container create & second time is - when we call the az container create for the second time - it will NOT go all the way to ACR to pull all the layers - it will try to use the cache of the previous deployment and modified layers will get pulled!!

    Probably you might to make a note of the scenarios and let us know in which cases it takes time & in which cases it takes long time etc. (Is that happening frequently?)

    One of the ways to see the live logs when the container is getting updated or created is to attach the instance using the below command and fetch the logs - it will show us the detailed logs in a step-by-step manner.
    az container logs (ref: https://learn.microsoft.com/en-us/azure/container-instances/container-instances-get-logs)

    You can also use az container attach command to see the diagnostic logs when the container is starting up.

    Regards,
    Shiva.

    1 person found this answer helpful.
    0 comments No comments

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.