You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This article describes blue-green deployment with Azure Container Apps.
20
-
21
16
In Azure Container Apps, you can enable blue-green deployment by combining [container apps revisions](../../container-apps/revisions.md), [traffic weights](../../container-apps/traffic-splitting.md), and [revision labels](../../container-apps/revisions.md#labels).
22
17
23
18
## Create or update a container app with multiple active revisions enabled
@@ -57,66 +52,60 @@ az containerapp update \
57
52
--revision-suffix <GREEN_SUFFIX>
58
53
```
59
54
60
-
You can add labels to specific revisions as shown in the following example:
55
+
To add labels to a specific revision, use the following command:
61
56
62
57
```azurecli
63
58
az containerapp revision label add \
64
-
--resource-group <RESOURCE_GROUP> \
65
-
--name <APP_NAME> \
66
-
--label blue \
67
-
--revision <APP_NAME>--<BLUE_SUFFIX>
59
+
--name <APP_NAME> \
60
+
--resource-group <RESOURCE_GROUP> \
61
+
--label blue \
62
+
--revision <BLUE_REVISION_NAME>
68
63
69
64
az containerapp revision label add \
70
-
--resource-group <RESOURCE_GROUP> \
71
-
--name <APP_NAME> \
72
-
--label green \
73
-
--revision <APP_NAME>--<GREEN_SUFFIX>
65
+
--name <APP_NAME> \
66
+
--resource-group <RESOURCE_GROUP> \
67
+
--label green \
68
+
--revision <GREEN_REVISION_NAME>
74
69
```
70
+
Here, `<BLUE_REVISION_NAME>` is `<APP_NAME>--<BLUE_SUFFIX>`, and `<GREEN_REVISION_NAME>` is `<APP_NAME>--<GREEN_SUFFIX>`. A label can only be assigned to one revision at a time.
75
71
76
72
Initially, the revision with the *blue*`commitId` takes 100% of production traffic, while the newly deployed revision with the *green*`commitId` doesn't take any production traffic.
77
73
78
74
In Azure Spring Apps, you can deploy at most two revisions of one app: one set as Production and the other as Staging. However, Azure Container Apps supports deploying multiple revisions for a single app.
79
75
80
-
## Test a new revision
76
+
## Test new revision
81
77
82
-
Each revision in Azure Container Apps has its own URL, enabling you to test and verify your deployment against the specific URL. Use the following commands to test the green revision with a specific domain, even though all production traffic is directed to the blue revision:
78
+
Each revision in Azure Container Apps has its own URL, enabling you to test and verify your deployment against the specific URL. Test the green revision with a specific domain, even though all production traffic is directed to the blue revision:
83
79
84
80
```azurecli
85
-
export GREEN_DOMAIN=$(az containerapp revision show \
Use the following commands to test with the label-specific fully qualified domain name (FQDN):
86
+
Additionally, test with the label-specific FQDN:
97
87
98
88
```azurecli
99
89
# Get the containerapp environment default domain
100
-
export APP_DOMAIN=$(az containerapp env show \
90
+
export APP_ENV_DOMAIN=$(az containerapp env show \
101
91
--resource-group <RESOURCE_GROUP> \
102
92
--name <APP_ENVIRONMENT_NAME> \
103
93
--query "properties.defaultDomain" \
104
-
--output tsv \
105
-
| tr -d '\r\n')
94
+
--output tsv)
106
95
107
96
# Test the production FQDN
108
-
curl -s https://$APP_NAME.$APP_DOMAIN
97
+
curl -s https://$APP_NAME.$APP_ENV_DOMAIN
109
98
110
-
# Test the blue label FQDN
111
-
curl -s https://$APP_NAME---blue.$APP_DOMAIN
99
+
# Test the blue lable FQDN
100
+
curl -s https://$APP_NAME---blue.$APP_ENV_DOMAIN
112
101
113
-
# Test the green label FQDN
114
-
curl -s https://$APP_NAME---green.$APP_DOMAIN
102
+
# Test the green lable FQDN
103
+
curl -s https://$APP_NAME---green.$APP_ENV_DOMAIN
115
104
```
116
105
117
106
## Send production traffic to the green revision
118
107
119
-
To switch production traffic to the green revision, use the following commands:
108
+
To switch production traffic to the green revision, use the following command:
120
109
121
110
```azurecli
122
111
# switch based on revision name
@@ -132,23 +121,22 @@ az containerapp ingress traffic set \
132
121
--label-weight blue=0 green=100
133
122
```
134
123
135
-
Ensure that the total label weight doesn't exceed 100.
124
+
Ensure that the total label weight equals 100%.
136
125
137
-
Azure Container Apps not only enables you to switch traffic between blue-green deployments but also between multiple revisions. You can also redirect a specific amount of production traffic to the green deployment.
126
+
Azure Container Apps not only allows you to switch traffic between blue-green deployments but also between multiple revisions. Additionally, you can redirect a specific amount of production traffic to the green deployment.
138
127
139
128
For more information about blue-green deployment in Azure Container Apps, see [Blue-Green Deployment in Azure Container Apps](../../container-apps/blue-green-deployment.md).
140
129
141
130
## Limitation
142
131
143
132
The Eureka Server isn't suitable for blue-green deployment because all revisions of the app are registered with the Eureka Server, preventing effective traffic splitting.
144
133
145
-
To enable traffic splitting when using Spring Cloud Gateway, you need to set the application URL in the URI field of your gateway configuration. You can obtain the application URL by using the following command:
134
+
To enable traffic splitting when using Spring Cloud Gateway, you need to set the application URL in the URI field of your gateway configuration. You can obtain the application URL using the following command:
Copy file name to clipboardExpand all lines: articles/spring-apps/migration/migrate-to-azure-container-apps-overview.md
+32Lines changed: 32 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -78,6 +78,38 @@ The migration approach from Azure Spring Apps to Azure Container Apps involves t
78
78
79
79
1. Client and automation tools: To streamline daily development and operational tasks, take advantage of client tools and automation solutions. These tools include the Azure CLI, Azure DevOps, GitHub Actions, and extensions in client tools or IDEs. These tools can help automate deployments, monitor performance, and manage resources efficiently, reducing manual effort and enhancing operational agility. To learn about popular tools, see [Clients or automation tools for Azure Container Apps](./migrate-to-azure-container-apps-automation.md).
80
80
81
+
## Migration assistant tool
82
+
83
+
To speed up your migration and help you evaluate features on Azure Container Apps, we provide a new command in Azure CLI. This command retrieves the configurations of existing Azure Spring Apps resource based on the resource id of service instance and translates them into Biceps files for Azure Container App resources. This method allows you to quickly set up an Azure Container Apps managed environment and applications while applying basic settings similar to those in your Azure Spring Apps. For more details, refer to the following steps or see [az spring export](/cli/azure/spring#az-spring-export)
84
+
85
+
1. Install Azure CLI version 2.45.0 or higher and latest version of Azure Spring Apps extension using the following command `az extension add --name spring`.
86
+
1. Generate Bicep files to create the corresponding Azure Container Apps resources. It also generates a `README.md` file with detailed instructions.
87
+
```azurecli
88
+
az spring export \
89
+
--target aca \
90
+
--subscription <subscription-id> \
91
+
--resource-group <resource-group-name> \
92
+
--service <service-name> \
93
+
--output-folder <output-folder-name>
94
+
```
95
+
1. Follow the instructions in `README.md` to update the required parameters in the Bicep files.
96
+
1. Create a resource group if it doesn't exist.
97
+
```azurecli
98
+
az group create \
99
+
--subscription <subscription-id> \
100
+
--name <resource-group-name> \
101
+
--location <location>
102
+
```
103
+
1. Deploy Azure Container Apps resources to the resource group. You may need to run the command multiple times and adjust the configuration based on the response message.
1. Follow the instructions in `README.md` file to update resources for advanced features. These features include uploading certificates, enabling a custom domain, adding role assignments to the system-assigned managed identity, and more.
109
+
110
+
If you need the Terraform configuration of those resources, you can export them using the export workflow of Azure Terraform Resource Provider. For more information, see [Overview of the Azure Terraform Resource Provider](/azure/developer/terraform/azure-terraform-resource-provider/resource-provider-overview).
111
+
112
+
81
113
## Tutorial
82
114
83
115
We provide a tutorial to demonstrate the end-to-end experience of running the ACME Fitness Store application on Azure Container Apps. For more information, see [acme-fitness-store/azure-container-apps](https://github.com/Azure-Samples/acme-fitness-store/tree/Azure/azure-container-apps). This tutorial offers hands-on guidance, helping you quickly gain practical insights and confidence in deploying and managing containerized applications on the platform.
0 commit comments