|
1 | 1 | ---
|
2 | 2 | title: Revisions in Azure Container Apps Preview
|
3 |
| -description: Learn how revisions are created in Azure Container Apps |
| 3 | +description: Learn about revisions in Azure Container Apps |
4 | 4 | services: container-apps
|
5 | 5 | author: craigshoemaker
|
6 | 6 | ms.service: container-apps
|
7 | 7 | ms.topic: conceptual
|
8 |
| -ms.date: 11/02/2021 |
| 8 | +ms.date: 05/11/2022 |
9 | 9 | ms.author: cshoe
|
10 | 10 | ms.custom: ignite-fall-2021
|
11 | 11 | ---
|
12 | 12 |
|
13 | 13 | # Revisions in Azure Container Apps Preview
|
14 | 14 |
|
15 |
| -A revision is an immutable snapshot of a container app. |
| 15 | +Azure Container Apps implements container app versioning by creating revisions. A revision is an immutable snapshot of a container app version. |
16 | 16 |
|
17 | 17 | - The first revision is automatically created when you deploy your container app.
|
18 |
| -- New revisions are automatically created when a container app's `template` configuration changes. |
19 |
| -- While revisions are immutable, they're affected by changes to global configuration values, which apply to all revisions. |
| 18 | +- New revisions are automatically created when you make a [*revision-scope*](#revision-scope-changes) change to your container app. |
| 19 | +- While revisions are immutable, they're affected by [*application-scope*](#application-scope-changes) changes, which apply to all revisions. |
| 20 | +- You can retain up to 100 revisions, giving you a historical record of your container app updates. |
| 21 | +- You can run multiple revisions concurrently. |
| 22 | +- You can split external HTTP traffic between active revisions. |
20 | 23 |
|
21 | 24 | :::image type="content" source="media/revisions/azure-container-apps-revisions.png" alt-text="Azure Container Apps: Containers":::
|
22 | 25 |
|
23 |
| -Revisions are most useful when you enable [ingress](ingress.md) to make your container app accessible via HTTP. Revisions are often used when you want to direct traffic from one snapshot of your container app to the next. Typical traffic direction strategies include [A/B testing](https://wikipedia.org/wiki/A/B_testing) and [BlueGreen deployment](https://martinfowler.com/bliki/BlueGreenDeployment.html). |
| 26 | + |
| 27 | +## Use cases |
| 28 | + |
| 29 | +Container Apps revisions help you manage the release of updates to your container app by creating a new revision each time you make a *revision-scope* change to your app. You can control which revisions are active, and the external traffic that is routed to each active revision. |
| 30 | + |
| 31 | +You can use revisions to: |
| 32 | + |
| 33 | +- Release a new version of your app. |
| 34 | +- Quickly revert to an earlier version of your app. |
| 35 | +- Split traffic between revisions for [A/B testing](https://wikipedia.org/wiki/A/B_testing). |
| 36 | +- Gradually phase in a new revision in blue-green deployments. For more information about blue-green deployment, see [BlueGreenDeployment](https://martinfowler.com/bliki/BlueGreenDeployment.html). |
24 | 37 |
|
25 | 38 | The following diagram shows a container app with two revisions.
|
26 | 39 |
|
27 | 40 | :::image type="content" source="media/revisions/azure-container-apps-revisions-traffic-split.png" alt-text="Azure Container Apps: Traffic splitting among revisions":::
|
28 | 41 |
|
29 |
| -The scenario shown above presumes the container app is in following state: |
| 42 | +The scenario shown above presumes the container app is in the following state: |
30 | 43 |
|
31 |
| -- [Ingress](ingress.md) is enabled, which makes the container app available via HTTP. |
32 |
| -- The first revision is deployed as _Revision 1_. |
| 44 | +- [Ingress](ingress.md) is enabled, making the container app available via HTTP. |
| 45 | +- The first revision was deployed as _Revision 1_. |
33 | 46 | - After the container was updated, a new revision was activated as _Revision 2_.
|
34 |
| -- [Traffic splitting](revisions-manage.md#traffic-splitting) rules are configured so that _Revision 1_ receives 80% of the requests, while _Revision 2_ receives the remaining 20%. |
| 47 | +- [Traffic splitting](revisions-manage.md#traffic-splitting) rules are configured so that _Revision 1_ receives 80% of the requests, and _Revision 2_ receives the remaining 20%. |
| 48 | + |
| 49 | +## Revision name suffix |
| 50 | + |
| 51 | +Revision names are used to identify a revision, and in the revision's URL. You can customize the revision name by setting the revision suffix. |
| 52 | + |
| 53 | +The format of a revision name is: |
| 54 | + |
| 55 | +```text |
| 56 | +<container app name>--<revision suffix> |
| 57 | +``` |
| 58 | + |
| 59 | +By default, Container Apps creates a unique revision name with a suffix consisting of a semi-random string of alphanumeric characters. You can customize the name by setting a unique custom revision suffix. |
| 60 | + |
| 61 | +For example, for a container app named *album-api*, setting the revision suffix name to *1st-revision* would create a revision with the name *album-api--1st-revision*. |
| 62 | + |
| 63 | +You can set the revision suffix in the [ARM template](azure-resource-manager-api-spec.md#propertiestemplate), through the Azure CLI `az containerapp create` and `az containerapp update` commands, or when creating a revision via the Azure portal. |
35 | 64 |
|
36 | 65 | ## Change types
|
37 | 66 |
|
38 |
| -Changes made to a container app fall under one of two categories: *revision-scope* and *application-scope* changes. Revision-scope changes are any change that triggers a new revision, while application-scope changes don't create revisions. |
| 67 | +Changes to a container app fall under two categories: *revision-scope* or *application-scope* changes. *Revision-scope* changes trigger a new revision when you deploy your app, while *application-scope* changes don't. |
39 | 68 |
|
40 | 69 | ### Revision-scope changes
|
41 | 70 |
|
42 |
| -The following types of changes create a new revision: |
| 71 | +A new revision is created when a container app is updated with *revision-scope* changes. The changes are limited to the revision in which they're deployed, and don't affect other revisions. |
| 72 | + |
| 73 | +A *revision-scope* change is any change to the parameters in the [`properties.template`](azure-resource-manager-api-spec.md#propertiestemplate) section of the container app resource template. |
43 | 74 |
|
44 |
| -- Changes to containers |
45 |
| -- Add or update scaling rules |
46 |
| -- Changes to Dapr settings |
47 |
| -- Any change that affects the `template` section of the configuration |
| 75 | +These parameters include: |
| 76 | + |
| 77 | +- [Revision suffix](#revision-name-suffix) |
| 78 | +- Container configuration and images |
| 79 | +- Scale rules for the container application |
48 | 80 |
|
49 | 81 | ### Application-scope changes
|
50 | 82 |
|
51 |
| -The following types of changes do not create a new revision: |
| 83 | +When you deploy a container app with *application-scope* changes: |
| 84 | + |
| 85 | +- The changes are globally applied to all revisions. |
| 86 | +- A new revision isn't created. |
| 87 | + |
| 88 | +*Application-scope* changes are defined as any change to the parameters in the [`properties.configuration`](azure-resource-manager-api-spec.md#propertiesconfiguration) section of the container app resource template. |
| 89 | + |
| 90 | +These parameters include: |
| 91 | + |
| 92 | +- [Secret values](manage-secrets.md) (revisions must be restarted before a container recognizes new secret values) |
| 93 | +- [Revision mode](#revision-modes) |
| 94 | +- Ingress configuration including: |
| 95 | + - Turning [ingress](ingress.md) on or off |
| 96 | + - [Traffic splitting rules](revisions-manage.md#traffic-splitting) |
| 97 | + - Labels |
| 98 | +- Credentials for private container registries |
| 99 | +- Dapr settings |
| 100 | + |
52 | 101 |
|
53 |
| -- Changes to [traffic splitting rules](revisions-manage.md#traffic-splitting) |
54 |
| -- Turning [ingress](ingress.md) on or off |
55 |
| -- Changes to [secret values](manage-secrets.md) |
56 |
| -- Any change outside the `template` section of the configuration |
| 102 | +## Revision modes |
57 | 103 |
|
58 |
| -While changes to secrets are an application-scope change, revisions must be [restarted](revisions.md) before a container recognizes new secret values. |
| 104 | +The revision mode controls whether only a single revision or multiple revisions of your container app can be simultaneously active. You can set your app's revision mode from your container app's **Revision management** page in the Azure portal, using Azure CLI commands, or in the ARM template. |
| 105 | + |
| 106 | +### Single revision mode |
| 107 | + |
| 108 | +By default, a container app is in *single revision mode*. In this mode, only one revision is active at a time. When a new revision is created, the latest revision replaces the active revision. |
| 109 | + |
| 110 | +### Multiple revision mode |
| 111 | + |
| 112 | +Set the revision mode to *multiple revision mode*, to run multiple revisions of your app simultaneously. While in this mode, new revisions are activated alongside current active revisions. |
| 113 | + |
| 114 | +For an app implementing external HTTP ingress, you can control the percentage of traffic going to each active revision from your container app's **Revision management** page in the Azure portal, using Azure CLI commands, or in an ARM template. For more information, see [Traffic splitting](revisions-manage.md#traffic-splitting). |
| 115 | + |
| 116 | +## Revision Labels |
| 117 | + |
| 118 | +For container apps with external HTTP traffic, labels are a portable means to direct traffic to specific revisions. A label provides a unique URL that you can use to route traffic to the revision that the label is assigned. To switch traffic between revisions, you can move the label from one revision to another. |
| 119 | + |
| 120 | +- Labels keep the same URL when moved from one revision to another. |
| 121 | +- A label can be applied to only one revision at a time. |
| 122 | +- Allocation for traffic splitting isn't required for revisions with labels. |
| 123 | +- Labels are most useful when the app is in *multiple revision mode*. |
| 124 | +- You can enable labels, traffic splitting or both. |
| 125 | + |
| 126 | +Labels are useful for testing new revisions. For example, when you want to give access to a set of test users, you can give them the label's URL. Then when you want to move your users to a different revision, you can move the label to that revision. |
| 127 | + |
| 128 | +Labels work independently of traffic splitting. Traffic splitting distributes traffic going to the container app's application URL to revisions based on the percentage of traffic. When traffic is directed to a label's URL, the traffic is routed to one specific revision. |
| 129 | + |
| 130 | +A label name must: |
| 131 | + |
| 132 | +- consist of lower case alphanumeric characters or dashes ('-') |
| 133 | +- start with an alphabetic character |
| 134 | +- end with an alphanumeric character |
| 135 | +- not have two consecutive dashes (--) |
| 136 | +- not be more than 64 characters |
| 137 | + |
| 138 | +You can manage labels from your container app's **Revision management** page in the Azure portal. |
| 139 | + |
| 140 | +:::image type="content" source="media/revisions/screen-shot-revision-mgmt-labels.png" alt-text="Screenshot of Container Apps revision management."::: |
| 141 | + |
| 142 | +You can find the label URL in the revision details pane. |
| 143 | + |
| 144 | +:::image type="content" source="media/revisions/screen-shot-revision-mgmt-revision-details.png" alt-text="Screenshot of Container Apps revision details."::: |
59 | 145 |
|
60 | 146 | ## Activation state
|
61 | 147 |
|
62 |
| -New revisions remain active until you deactivate them, or you set your container app to automatically deactivate old revisions. |
| 148 | +In *multiple revision mode*, revisions remain active until you deactivate them. You can activate and deactivate revisions from your container app's **Revision management** page in the Azure portal or from the Azure CLI. |
63 | 149 |
|
64 |
| -- Inactive revisions remain as a snapshot record of your container app in a certain state. |
65 |
| -- You are not charged for inactive revisions. |
66 |
| -- Up to 100 revisions remain available before being purged. |
| 150 | +You aren't charged for the inactive revisions. You can have a maximum of 100 revisions, after which the oldest revision is purged. |
67 | 151 |
|
68 | 152 | ## Next steps
|
69 | 153 |
|
70 | 154 | > [!div class="nextstepaction"]
|
71 | 155 | > [Application lifecycle management](application-lifecycle-management.md)
|
| 156 | +
|
0 commit comments