ACR Containers Not Updating #4266
-
Note This is a branch of this initial discussion where the solution is to define a custom base image. This new discussion is to focus on When an update to a .NET Aspire service container is made, Azure Container Registry (ACR) is not picking up the changes when deploying. Here's an example lifecycle to explain: Deploy 1
Now, let's say I changed the base container for apiservice, and rebuilt and redeploy to Azure Deploy 2
ProblemWhen visiting the application, it is still using apiservice To eliminate if this was a cache optimization side effect (not re-pulling image with the same tag), I started deploying images with explicit versioning in the tag ( Unfortunately, explicit version tags did not resolve the problem. WorkaroundI was able to workaround this by manually editing the container for the API service in Azure and choosing the GitHub registry version, instead of the ACR one. Here's a screenshot of where I edit the running container and chose my GitHub image instead of the ACR one. This effectively bypasses the part of the lifecycle where I suspect the problem lies (the latest image is not being pulled by ACR). Once the container's image was changed to the GitHub copy, it was working as expected: Moving ForwardUnfortunately, this is short-lived solution, because on the very next So, you can see why there is suspicion that ACR is not pulling the latest image, but I do not have any evidence other than the above described behavior of the image in ACR is always the old version. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 14 replies
-
Beta Was this translation helpful? Give feedback.
-
@LanceMcCarthy , when you say:
what do you mean? Is it just making changes to a project? (project.v0) or do you mean a container.v0 and you are updating the img for it? |
Beta Was this translation helpful? Give feedback.
by design, azd does not support passing
-p ContainerBaseImage
when runningdotnet publish
.You need to set the base image into the project, like: https://learn.microsoft.com/dotnet/core/docker/publish-as-container?pivots=dotnet-8-0#containerbaseimage
Then when azd runs
dotnet publish
, dotnet will use that base image you set :)