Skip to content

Commit 9103dad

Browse files
committed
Add migration tooling and update blue-green deployment
1 parent b204038 commit 9103dad

File tree

2 files changed

+62
-42
lines changed

2 files changed

+62
-42
lines changed

articles/spring-apps/migration/migrate-to-azure-container-apps-blue-green.md

Lines changed: 30 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,16 @@ title: The Experience of Blue-Green Deployment in Azure Container Apps
33
description: Describes the experience of blue-green deployment in Azure Container Apps.
44
author: KarlErickson
55
ms.author: karler
6-
ms.reviewer: dixue
76
ms.service: azure-spring-apps
87
ms.topic: upgrade-and-migration-article
9-
ms.date: 01/29/2025
8+
ms.date: 11/18/2024
109
ms.custom: devx-track-java, devx-track-extended-java
1110
---
1211

13-
# The experience of blue-green deployment in Azure Container Apps
14-
15-
[!INCLUDE [deprecation-note](../includes/deprecation-note.md)]
12+
# The Experience of Blue-Green Deployment in Azure Container Apps
1613

1714
**This article applies to:** ✅ Basic/Standard ✅ Enterprise
1815

19-
This article describes blue-green deployment with Azure Container Apps.
20-
2116
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).
2217

2318
## Create or update a container app with multiple active revisions enabled
@@ -57,66 +52,60 @@ az containerapp update \
5752
--revision-suffix <GREEN_SUFFIX>
5853
```
5954

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:
6156

6257
```azurecli
6358
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>
6863
6964
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>
7469
```
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.
7571

7672
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.
7773

7874
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.
7975

80-
## Test a new revision
76+
## Test new revision
8177

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:
8379

8480
```azurecli
85-
export GREEN_DOMAIN=$(az containerapp revision show \
86-
--resource-group <RESOURCE_GROUP> \
87-
--name <APP_NAME> \
88-
--revision <GREEN_REVISION_NAME> \
89-
--query "properties.fqdn" \
90-
--output tsv \
91-
| tr -d '\r\n')
81+
GREEN_DOMAIN=$(az containerapp revision show --resource-group <RESOURCE_GROUP> --name <APP_NAME> --revision <GREEN_REVISION_NAME> --query "properties.fqdn" -o tsv)
9282
93-
curl -s http://$GREEN_DOMAIN
83+
curl -s https://$GREEN_DOMAIN
9484
```
9585

96-
Use the following commands to test with the label-specific fully qualified domain name (FQDN):
86+
Additionally, test with the label-specific FQDN:
9787

9888
```azurecli
9989
# Get the containerapp environment default domain
100-
export APP_DOMAIN=$(az containerapp env show \
90+
export APP_ENV_DOMAIN=$(az containerapp env show \
10191
--resource-group <RESOURCE_GROUP> \
10292
--name <APP_ENVIRONMENT_NAME> \
10393
--query "properties.defaultDomain" \
104-
--output tsv \
105-
| tr -d '\r\n')
94+
--output tsv)
10695
10796
# Test the production FQDN
108-
curl -s https://$APP_NAME.$APP_DOMAIN
97+
curl -s https://$APP_NAME.$APP_ENV_DOMAIN
10998
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
112101
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
115104
```
116105

117106
## Send production traffic to the green revision
118107

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:
120109

121110
```azurecli
122111
# switch based on revision name
@@ -132,23 +121,22 @@ az containerapp ingress traffic set \
132121
--label-weight blue=0 green=100
133122
```
134123

135-
Ensure that the total label weight doesn't exceed 100.
124+
Ensure that the total label weight equals 100%.
136125

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.
138127

139128
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).
140129

141130
## Limitation
142131

143132
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.
144133

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:
146135

147136
```azurecli
148137
az containerapp show \
149138
--resource-group <RESOURCE_GROUP> \
150139
--name <APP_NAME> \
151140
--query "properties.configuration.ingress.fqdn" \
152-
--output tsv \
153-
| tr -d '\r\n'
154-
```
141+
--output tsv
142+
```

articles/spring-apps/migration/migrate-to-azure-container-apps-overview.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,38 @@ The migration approach from Azure Spring Apps to Azure Container Apps involves t
7878

7979
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).
8080

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.
104+
```azurecli
105+
az deployment group create
106+
--resource-group <resource-group-name> --template-file main.bicep --parameters param.bicepparam --subscription <subscription-id>
107+
```
108+
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+
81113
## Tutorial
82114

83115
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

Comments
 (0)