Open tjementum opened 10 months ago
In the first screenshot below, it shows latest, because I currently don't have the actual version when deploying Bicep. Thank you for the feedback, we will check and see how to make the improvement.
Notice that "traffic" has two revisions, where the revision named account-management-api--2023-10-31-7 with label 2023-10-31-7 has 0% traffic, and the one with 100% traffic has the latest label. This is clearly wrong. Remember I'm running in Single Revision mode.
This is actually by design. The latestRevision is a special revision and you can attach a label with it. At the same time, you can have the label for other revisions (even if it is the latest revsion) too. The single revision mode means you will only have one active revision and take 100% traffic at a time, but having other revisions with 0 weight is allowed.
Hi Howang,
Thanks for the answer... much appreciated 😃
I think I failed to describe the problem clearly. So let me try to explain my goal.
I'm trying to ensure the "active" revision has a label that shows the version number. I would love that to be an integrated part of Azure Container App.
The very first time I deploy the container app using Bicep I use the image with the latest
tag from my container registry, and set latest
as a label. I've actually changed that to initial
in my setup to make it clear. I think that is what made my post confusing?
After the initial deployment using Bicep, I update the container image using Azure CLI, I set the suffix to the version number. I use date as the version number e.g. 2023-11-30-7
. I ALSO change the label of the just deployed revision to 2023-11-30-7
. These are the two commands I run:
az containerapp update --name account-management-api ... --revision-suffix 2023-10-31-7
az containerapp revision label add --name account-management-api --label 2023-10-31-7 --revision account-management-api--2023-10-31-7
Would you agree this should set the label of the revision with suffix 2023-10-31-7
to 2023-10-31-7
? If you look at my screenshot the revision with suffix 2023-10-31-7
has the label latest
(coming from my initial Bicep deployment). IMO, this is clearly wrong, and hence the bug report.
If this is by design, then how can I change the label of the active revision using Azure CLI, so it shows e.g. the version number?
Hey @tjementum - were you able to solve this?
Would you be able to share your bicep solution?
PS: In my infrastructure deployment I've implemented a way for Bicep to read the currently active container image version, so it does not rollback to latest.
I think there's a bug in ACA where you cannot set label on a revision that has traffic weight 0 - both in single or multiple revision mode.
Would you be able to share your bicep solution?
I gave up using labels, but instead named my revisions with version numbers, see screenshot.
I'm building an Open-Source project that shows how to create a SaaS product, so you can find the entire solution here: https://github.com/platformplatform/PlatformPlatform.
If you follow the very simple "Getting started" steps, you should be able to get this up and running.
Is there any update to this? The ACA commands for labels do not work with traffic weight is set to 0%.
I was able to make it work but the issue is still there. If you read current state of ACA (not trivial) and then build your manifest accordingly, you can make it work
properties:
configuration:
ingress:
traffic:
- latestRevision: true
label: preview
weight: 0
- revisionName: __CURRENT_PRODUCTION_REVISION__
weight: 100
label: production
but it would be nice if it worked out of the box and you could have "preview" slots
I was able to make it work but the issue is still there.
Seems like you are using multiple revisions. The original problem is for single revisions.
This issue is a: (mark with an x)
Issue description
I'm trying to make the application version visible on my revisions page. I see two options:
But I have a problem:
latest
, because I currently don't have the actual version when deploying Bicep.I use
az containerapp update
to update the image version whenever a new version of my application is deployed. Bicep is not a good option to deploy updates to container images, as it's too slow and it potentially changes more than just the container image. However,az containerapp update
does not allow setting a label, but I can set a revision-suffix using:And afterwards I can set the label using the knowledge about the revision:
PS: In my infrastructure deployment I've implemented a way for Bicep to read the currently active container image version, so it does not rollback to
latest
. There is truly room for improvement here, as this is something everyone wants, but it's very cumbersome!" I would love to talk with the ACA team.Actual behavior [What actually happened.] This last
az containerapp revision label add
should set the label2023-10-31-7
on the revision namedaccount-management-api--2023-10-31-7
. But as this screenshot shows the label islatest
:Also, if I call
az containerapp show --name account-management-api ...
to inspect the container app I get this response:Notice that "traffic" has two revisions, where the revision named
account-management-api--2023-10-31-7
with label2023-10-31-7
has 0% traffic, and the one with 100% traffic has thelatest
label. This is clearly wrong. Remember I'm running in Single Revision mode.Expected behavior [What you expected to happen.]
I'm expecting that this command will set the label of the active revision
az containerapp revision label add --name account-management-api --label 2023-10-31-7 --revision account-management-api--2023-10-31-7
Even better. I would love if the
az containerapp update...
would take a--label
parameter, so this can be done in one operation.Steps to reproduce
I believe the reproduction steps are clear from above. Otherwise, a full reproducible example of a real-world solution can be found here PlatformPlatform (I will likely make a workaround, so check this commit).