Skip to content

Commit a80b287

Browse files
authored
Merge pull request #296254 from dingmeng-xue/migration-aca-review
Add migration tooling and update blue-green deployment
2 parents a654b28 + b22cfdd commit a80b287

File tree

3 files changed

+103
-56
lines changed

3 files changed

+103
-56
lines changed

articles/spring-apps/includes/deprecation-note.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ author: KarlErickson
33
ms.author: karler
44
ms.service: azure-spring-apps
55
ms.topic: include
6-
ms.date: 09/30/2024
6+
ms.date: 03/17/2025
77
---
88

99
> [!NOTE]
10-
> The **Basic**, **Standard**, and **Enterprise** plans will be deprecated starting from mid-March, 2025, with a 3 year retirement period. We recommend transitioning to Azure Container Apps. For more information, see the [Azure Spring Apps retirement announcement](../basic-standard/retirement-announcement.md).
10+
> The **Basic**, **Standard**, and **Enterprise** plans entered a retirement period on March 17, 2025. For more information, see the [Azure Spring Apps retirement announcement](../basic-standard/retirement-announcement.md).
1111
>
12-
> The **Standard consumption and dedicated** plan will be deprecated starting September 30, 2024, with a complete shutdown after six months. We recommend transitioning to Azure Container Apps. For more information, see [Migrate Azure Spring Apps Standard consumption and dedicated plan to Azure Container Apps](../consumption-dedicated/overview-migration.md).
12+
> The **Standard consumption and dedicated** plan entered a retirement period on September 30, 2024, with a complete shutdown by the end of March 2025. For more information, see [Migrate Azure Spring Apps Standard consumption and dedicated plan to Azure Container Apps](../consumption-dedicated/overview-migration.md).
Lines changed: 47 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,19 @@
11
---
2-
title: The Experience of Blue-Green Deployment in Azure Container Apps
3-
description: Describes the experience of blue-green deployment in Azure Container Apps.
2+
title: Blue-Green Deployment to Azure Container Apps
3+
description: Describes blue-green deployment to Azure Container Apps.
44
author: KarlErickson
55
ms.author: karler
6-
ms.reviewer: dixue
6+
ms.reviewer: dingmeng-xue
77
ms.service: azure-spring-apps
88
ms.topic: upgrade-and-migration-article
9-
ms.date: 01/29/2025
9+
ms.date: 03/17/2025
1010
ms.custom: devx-track-java, devx-track-extended-java
1111
---
1212

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

1715
**This article applies to:** ✅ Basic/Standard ✅ Enterprise
1816

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

2319
## Create or update a container app with multiple active revisions enabled
@@ -26,11 +22,11 @@ To create a new container app with multiple active revisions enabled, use the fo
2622

2723
```azurecli
2824
az containerapp create \
29-
--resource-group <RESOURCE_GROUP> \
30-
--name <APP_NAME> \
31-
--environment <APP_ENVIRONMENT_NAME> \
32-
--image mcr.microsoft.com/k8se/samples/test-app:<BLUE_COMMIT_ID> \
33-
--revision-suffix <BLUE_SUFFIX> \
25+
--resource-group <resource-group> \
26+
--name <app-name> \
27+
--environment <app-environment-name> \
28+
--image mcr.microsoft.com/k8se/samples/test-app:<blue-commit-ID> \
29+
--revision-suffix <blue-suffix> \
3430
--ingress external \
3531
--target-port 80 \
3632
--revisions-mode multiple
@@ -40,8 +36,8 @@ Alternatively, you can use the following command to update an existing app to en
4036

4137
```azurecli
4238
az containerapp revision set-mode \
43-
--resource-group <RESOURCE_GROUP> \
44-
--name <APP_NAME> \
39+
--resource-group <resource-group> \
40+
--name <app-name> \
4541
--mode multiple
4642
```
4743

@@ -51,29 +47,31 @@ To deploy a new revision, use the following command:
5147

5248
```azurecli
5349
az containerapp update \
54-
--resource-group <RESOURCE_GROUP> \
55-
--name <APP_NAME> \
50+
--resource-group <resource-group> \
51+
--name <app-name> \
5652
--image mcr.microsoft.com/k8se/samples/test-app:<GREEN_COMMIT_ID> \
5753
--revision-suffix <GREEN_SUFFIX>
5854
```
5955

60-
You can add labels to specific revisions as shown in the following example:
56+
To add labels to a specific revision, use the following commands:
6157

6258
```azurecli
6359
az containerapp revision label add \
64-
--resource-group <RESOURCE_GROUP> \
65-
--name <APP_NAME> \
60+
--resource-group <resource-group> \
61+
--name <app-name> \
6662
--label blue \
67-
--revision <APP_NAME>--<BLUE_SUFFIX>
63+
--revision <blue-revision-name>
6864
6965
az containerapp revision label add \
70-
--resource-group <RESOURCE_GROUP> \
71-
--name <APP_NAME> \
66+
--resource-group <resource-group> \
67+
--name <app-name> \
7268
--label green \
73-
--revision <APP_NAME>--<GREEN_SUFFIX>
69+
--revision <green-revision-name>
7470
```
7571

76-
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.
72+
Here, `<blue-revision-name>` is `<app-name>--<blue-suffix>`, and `<green-revision-name>` is `<app-name>--<green-suffix>`. You can only assign a label to one revision at a time.
73+
74+
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.
7775

7876
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.
7977

@@ -83,35 +81,35 @@ Each revision in Azure Container Apps has its own URL, enabling you to test and
8381

8482
```azurecli
8583
export GREEN_DOMAIN=$(az containerapp revision show \
86-
--resource-group <RESOURCE_GROUP> \
87-
--name <APP_NAME> \
88-
--revision <GREEN_REVISION_NAME> \
84+
--resource-group <resource-group> \
85+
--name <app-name> \
86+
--revision <green-revision-name> \
8987
--query "properties.fqdn" \
90-
--output tsv \
91-
| tr -d '\r\n')
88+
--output tsv)
9289
93-
curl -s http://$GREEN_DOMAIN
90+
curl -s https://$GREEN_DOMAIN
9491
```
9592

9693
Use the following commands to test with the label-specific fully qualified domain name (FQDN):
9794

9895
```azurecli
96+
export APP_NAME=<app-name>
97+
9998
# Get the containerapp environment default domain
100-
export APP_DOMAIN=$(az containerapp env show \
101-
--resource-group <RESOURCE_GROUP> \
102-
--name <APP_ENVIRONMENT_NAME> \
99+
export APP_ENVIRONMENT_DOMAIN=$(az containerapp env show \
100+
--resource-group <resource-group> \
101+
--name <app-environment-name> \
103102
--query "properties.defaultDomain" \
104-
--output tsv \
105-
| tr -d '\r\n')
103+
--output tsv)
106104
107105
# Test the production FQDN
108-
curl -s https://$APP_NAME.$APP_DOMAIN
106+
curl -s https://$APP_NAME.$APP_ENVIRONMENT_DOMAIN
109107
110108
# Test the blue label FQDN
111-
curl -s https://$APP_NAME---blue.$APP_DOMAIN
109+
curl -s https://$APP_NAME---blue.$APP_ENVIRONMENT_DOMAIN
112110
113111
# Test the green label FQDN
114-
curl -s https://$APP_NAME---green.$APP_DOMAIN
112+
curl -s https://$APP_NAME---green.$APP_ENVIRONMENT_DOMAIN
115113
```
116114

117115
## Send production traffic to the green revision
@@ -121,18 +119,18 @@ To switch production traffic to the green revision, use the following commands:
121119
```azurecli
122120
# switch based on revision name
123121
az containerapp ingress traffic set \
124-
--resource-group <RESOURCE_GROUP> \
125-
--name <APP_NAME> \
126-
--revision-weight <BLUE_REVISION_NAME>=0 <GREEN_REVISION_NAME>=100
122+
--resource-group <resource-group> \
123+
--name <app-name> \
124+
--revision-weight <blue-revision-name>=0 <green-revision-name>=100
127125
128126
# switch based on label
129127
az containerapp ingress traffic set \
130-
--resource-group <RESOURCE_GROUP> \
131-
--name <APP_NAME> \
128+
--resource-group <resource-group> \
129+
--name <app-name> \
132130
--label-weight blue=0 green=100
133131
```
134132

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

137135
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.
138136

@@ -146,9 +144,8 @@ To enable traffic splitting when using Spring Cloud Gateway, you need to set the
146144

147145
```azurecli
148146
az containerapp show \
149-
--resource-group <RESOURCE_GROUP> \
150-
--name <APP_NAME> \
147+
--resource-group <resource-group> \
148+
--name <app-name> \
151149
--query "properties.configuration.ingress.fqdn" \
152-
--output tsv \
153-
| tr -d '\r\n'
150+
--output tsv
154151
```

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

Lines changed: 53 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
---
22
title: Migrate to Azure Container Apps
3-
description: Describes an overview approach of migrating to Azure Container Apps.
3+
description: Describes migrating to Azure Container Apps.
44
author: KarlErickson
55
ms.author: karler
6-
ms.reviewer: dixue
6+
ms.reviewer: dingmeng-xue
77
ms.service: azure-spring-apps
88
ms.topic: upgrade-and-migration-article
9-
ms.date: 01/29/2025
9+
ms.date: 03/17/2025
1010
ms.custom: devx-track-java, devx-track-extended-java
1111
---
1212

@@ -78,6 +78,56 @@ 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 the Azure CLI. This command retrieves the configurations of existing Azure Spring Apps resources based on the resource ID of the service instance. It then translates these configurations into Bicep files for Azure Container App resources. This method enables you to quickly set up an Azure Container Apps managed environment and app resources while applying basic settings similar to those settings in your existing Azure Spring Apps resources. For more information, see [az spring export](/cli/azure/spring#az-spring-export).
84+
85+
To create Azure Container Apps resources that match the configurations of your existing Azure Spring Apps resources, use the following steps:
86+
87+
1. Install Azure CLI version 2.45.0 or higher and the latest version of the Azure Spring Apps extension by using the `az extension add --name spring` command.
88+
89+
1. Generate Bicep files to create the corresponding Azure Container Apps resources by using the following command:
90+
91+
```azurecli
92+
az spring export \
93+
--resource-group <resource-group-name> \
94+
--target aca \
95+
--subscription <subscription-id> \
96+
--service <service-name> \
97+
--output-folder <output-folder-name>
98+
```
99+
100+
1. The previous command generates a **README.md** file with detailed instructions. Follow those instructions to update the required parameters in the Bicep files.
101+
102+
> [!NOTE]
103+
> Azure Container Apps requires containerized image URLs. If you don't yet have a containerized image URL for your application, you can leave the quickstart image URL in the parameters unchanged, and deploy your own application later. For more information on obtaining container images, see [Overview of containerization](./migrate-to-azure-container-apps-build-overview.md)
104+
105+
1. If a resource group doesn't exist, create it by using the following command:
106+
107+
```azurecli
108+
az group create \
109+
--name <resource-group-name> \
110+
--subscription <subscription-id> \
111+
--location <location>
112+
```
113+
114+
1. Deploy Azure Container Apps resources to the resource group by using the following command:
115+
116+
> [!NOTE]
117+
> You might need to run the command multiple times and adjust the configuration based on the response message.
118+
119+
```azurecli
120+
az deployment group create \
121+
--resource-group <resource-group-name> \
122+
--template-file main.bicep \
123+
--parameters param.bicepparam \
124+
--subscription <subscription-id>
125+
```
126+
127+
1. Follow the instructions in the **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.
128+
129+
1. If you need the Terraform configuration of those resources, export them using the export workflow of the 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).
130+
81131
## Tutorial
82132
83133
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)