I'm using azure containerapps, and have done for over a year now. I have configured an Azure Devops pipeline to update the the image and revision using a pipeline. Until about one month ago this has worked absolutely fine. Yesterday I performed an update using the same process and have received an error both from the cli (az) and from devops pipelines of the following:
Revision name has an invalid value 'myapp--1.0.263'. A revision name must consist of lower case alphanumeric characters or '-', start with an alphabetic character, and end with an alphanumeric character. The length of the revision name must not be more than a combined 54 characters with the container app name.
I have an existing older revision running fine but I have no idea where this erroneous revision number has come from(my revisions show the random string you get by default). Perhaps this is an older revision I put up hundreds of releases ago. I'm running in single mode so traffic management should be disabled. Does anyone have any idea what this might be or how I can work around it? My YAML file is also set to single traffic. I'm not specifying the suffix anywhere in my code/yaml or az command e.g.
az containerapp update -n my-app -g my-rg --yaml ContainerAppConfiguration.yml
Any clues of where to look would be appreciated.
I'm using azure containerapps, and have done for over a year now. I have configured an Azure Devops pipeline to update the the image and revision using a pipeline. Until about one month ago this has worked absolutely fine. Yesterday I performed an update using the same process and have received an error both from the cli (az) and from devops pipelines of the following:
Revision name has an invalid value 'myapp--1.0.263'. A revision name must consist of lower case alphanumeric characters or '-', start with an alphabetic character, and end with an alphanumeric character. The length of the revision name must not be more than a combined 54 characters with the container app name.
I have an existing older revision running fine but I have no idea where this erroneous revision number has come from(my revisions show the random string you get by default). Perhaps this is an older revision I put up hundreds of releases ago. I'm running in single mode so traffic management should be disabled. Does anyone have any idea what this might be or how I can work around it? My YAML file is also set to single traffic. I'm not specifying the suffix anywhere in my code/yaml or az command e.g.
az containerapp update -n my-app -g my-rg --yaml ContainerAppConfiguration.yml
Any clues of where to look would be appreciated.
Share Improve this question asked Mar 20 at 15:54 The SenatorThe Senator 5,4112 gold badges38 silver badges52 bronze badges 2- Try setting --revision-suffix newrev in your az containerapp update command or delete old invalid revisions to bypass Azure's stricter naming rules @TheSenator – Vinay B Commented Mar 21 at 5:18
- Thanks for the advice, in the end I toggled between single and multi revision support which seemed to clear the problem out. – The Senator Commented Apr 6 at 20:21
2 Answers
Reset to default 0A recent update of a containerapp using the YAML based approach is showing an 'invalid revision' number
While upgrading the version of Azure Container Apps, you might come across this type of blockers because the revision name must follow specific rules.
In your az containerapp update
command, it looks like the revision suffix might be getting generated automatically. Which is not inline with the instruction shared in Microsoft document mentioned below.
Refer: https://learn.microsoft/en-us/azure/container-apps/revisions#name-suffix
Where it clearly mentioned, the following steps need to be:
- Consist of lowercase alphanumeric characters or hyphens (
-
). - Start with an alphabetic character.
- End with an alphanumeric character.
- Not contain consecutive hyphens (
--
). - Be no longer than 64 characters in total, including the container app name.
From the query, the revision name myapp--1.0.263
violates the convention due to the consecutive hyphens.
To overcome this, adjust your Azure DevOps pipeline to generate revision names correctly as per the policy and stop using consecutive hyphens and ensure the name starts and ends with alphanumeric characters.
You can also try Custom Revision where we need to update your container app by setting the revision suffix to a valid value.
az containerapp update -n my-app -g my-rg --image my-image:1.0.263 --revision-suffix v1-0-263
You also can try cleaning up old revisions that might be conflicting with the naming conventions by deactivating them.
az containerapp revision deactivate --name <APPLICATION_NAME> --revision <REVISION_NAME> --resource-group <RESOURCE_GROUP_NAME>
Refer:
https://learn.microsoft/en-us/azure/container-apps/revisions-manage?tabs=bash#revision-deactivate
How to delete a revision in Azure Container Apps? answered by Anon.
It turned out to be very difficult executing a command using az (the revision error was not due to me trying to add a new revision, it appeared to be an old ghost from a previous time when multiple revisions were enabled) or trying any variants of the command directly. As a last resort I toggled between single and multiple revision mode (using the portal) to get rid of this mysterious old artefact and then the exactly same container update worked successfully.
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744397904a4572238.html
评论列表(0条)